Liferay.Loader.define("@liferay/commerce-warehouse-web@4.0.35/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({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(t){const r={channelExternalReferenceCode:t.externalReferenceCode,channelId:t.id,warehouseExternalReferenceCode:d,warehouseId:e};return c.addWarehouseChannel(e,r).then((()=>{Liferay.fire(o.UPDATE_DATASET_DISPLAY,{id:n})})).catch((e=>{(0,i.openToast)({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=d(t("commerce-frontend-js/ServiceProvider/index")),a=d(t("commerce-frontend-js/components/item_finder/entry")),o=t("commerce-frontend-js/utilities/eventsDefinitions"),i=t("frontend-js-web");function d(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=channels.js.map