Liferay.Loader.define("@liferay/commerce-term-web@1.0.18/js/commerce_order_types",["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,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=function({datasetId:e,rootPortletId:r,termExternalReferenceCode:t,termId:a}){const s=n.default.AdminOrderAPI("v1");(0,d.default)("itemFinder","item-finder-root-order-types",{apiUrl:"/o/headless-commerce-admin-order/v1.0/order-types/",getSelectedItems:()=>Promise.resolve([]),inputPlaceholder:Liferay.Language.get("find-an-order-type"),itemCreation:!1,itemSelectedMessage:Liferay.Language.get("order-type-selected"),itemsKey:"id",linkedDatasetsId:[e],onItemSelected:function(r){const n={orderTypeExternalReferenceCode:r.externalReferenceCode,orderTypeId:r.id,termExternalReferenceCode:t,termId:a};return s.addTermOrderType(a,n).then((()=>{Liferay.fire(i.UPDATE_DATASET_DISPLAY,{id:e})})).catch((e=>{const r={"the-qualifier-is-already-linked":Liferay.Language.get("the-qualifier-is-already-linked")};(0,o.openToast)({message:r[e.message]||Liferay.Language.get("an-unexpected-error-occurred"),title:Liferay.Language.get("error"),type:"danger"})}))},pageSize:10,panelHeaderLabel:Liferay.Language.get("add-order-types"),portletId:r,schema:[{fieldName:["name","LANG"]}],titleLabel:Liferay.Language.get("add-existing-order-type")})};var n=a(t("commerce-frontend-js/ServiceProvider/index")),d=a(t("commerce-frontend-js/components/item_finder/entry")),i=t("commerce-frontend-js/utilities/eventsDefinitions"),o=t("frontend-js-web");function a(e){return e&&e.__esModule?e:{default:e}}}}));
//# sourceMappingURL=commerce_order_types.js.map