Liferay.Loader.define("@liferay/commerce-warehouse-web@4.0.44/js/channels",["module","exports","require","commerce-frontend-js/ServiceProvider/index","commerce-frontend-js/components/item_finder/entry","commerce-frontend-js/utilities/eventsDefinitions","frontend-js-web"],(function(e,n,t){window;{Object.defineProperty(n,"__esModule",{value:!0}),n.default=function _default({commerceInventoryWarehouseId:e,datasetId:n,rootPortletId:t,warehouseExternalReferenceCode:d}){const c=r.default.AdminInventoryAPI("v1");(0,a.default)("itemFinder","item-finder-root-channel",{apiUrl:"/o/headless-commerce-admin-channel/v1.0/channels",getSelectedItems:()=>Promise.resolve([]),inputPlaceholder:Liferay.Language.get("find-a-channel"),itemCreation:!1,itemSelectedMessage:Liferay.Language.get("channel-selected"),itemsKey:"id",linkedDatasetsId:[n],onItemSelected:function selectItem(t){const r={channelExternalReferenceCode:t.externalReferenceCode,channelId:t.id,warehouseExternalReferenceCode:d,warehouseId:e};return c.addWarehouseChannel(e,r).then((()=>{Liferay.fire(i.UPDATE_DATASET_DISPLAY,{id:n})})).catch((e=>{(0,o.openToast)({message:e.message||e.title,type:"danger"})}))},pageSize:10,panelHeaderLabel:Liferay.Language.get("add-channels"),portletId:t,schema:[{fieldName:"name"}],titleLabel:Liferay.Language.get("add-existing-channel")})};var r=_interopRequireDefault(t("commerce-frontend-js/ServiceProvider/index")),a=_interopRequireDefault(t("commerce-frontend-js/components/item_finder/entry")),i=t("commerce-frontend-js/utilities/eventsDefinitions"),o=t("frontend-js-web");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=channels.js.map