Liferay.Loader.define("@liferay/commerce-channel-web@4.0.52/js/CommerceChannelSite",["module","exports","require","frontend-js-web"],(function(e,t,o){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default({itemSelectorUrl:e,portletNamespace:t,removeCommerceChannelSiteIcon:o,searchContainerId:n}){Liferay.componentReady("".concat(t).concat(n)).then((n=>{const c=document.getElementById("".concat(t,"selectSite"));c&&c.addEventListener("click",(c=>{c.preventDefault(),(0,a.openSelectionModal)({onSelect:e=>{if(!e)return;const a=n.getData(),c=document.querySelector('a[data-rowid="'.concat(a,'"]'));if(c){const e=c.closest("tr");e&&n.deleteRow(e,c.dataset.rowid)}const d=[];d.push(e.name),d.push('<a class="float-right modify-link" data-rowId="'.concat(e.id,'" href="javascript:void(0);">').concat(o,"</a>"));const r=document.getElementById("".concat(t,"siteGroupId"));r&&(r.value=e.id),n.addRow(d,e.id),n.updateDataStore()},selectEventName:"sitesSelectItem",title:(0,a.sub)(Liferay.Language.get("select-x"),Liferay.Language.get("site")),url:e})}));const d=n.get("contentBox");(0,a.delegate)(d.getDOMNode(),"click",".modify-link",(e=>{const o=e.delegateTarget,a=o.closest("tr");n.deleteRow(a,o.dataset.rowid);const c=document.getElementById("".concat(t,"siteGroupId"));c&&(c.value=0)}))}))};var a=o("frontend-js-web")}));
//# sourceMappingURL=CommerceChannelSite.js.map