Liferay.Loader.define("commerce-organization-web@5.0.44/js/utils/MultiSelectHandler",["module","exports","require","./constants","./index"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=a("./constants"),l=a("./index");class MultiSelectHandler{constructor(){this.selectable=[],this.unselectable=[]}updateSelectableItems(e,t){const a=new Set;e.forEach((e=>{const t=e.descendants();t.shift();const s=e.ancestors();s.shift(),[...s,...t].forEach((e=>{a.add(e.data.chartNodeId)}))}));t.selectAll(".chart-item").each(((e,t,c)=>{!a.has(e.data.chartNodeId)&&"user"!==e.data.type&&"add"!==e.data.type&&(0,l.hasPermission)(e.data,s.ACTION_KEYS[e.data.type].MOVE)?(c[t].classList.add("selectable"),e.data.selectable=!0,this.selectable.push({data:e.data,node:c[t]})):(c[t].classList.add("unselectable"),e.data.selectable=!1,this.unselectable.push({data:e.data,node:c[t]}))}))}resetSelectableItems(){this.selectable.length&&(this.selectable.forEach((e=>{e.node.classList.remove("selectable"),e.data.selectable=void 0})),this.selectable=[]),this.unselectable.length&&(this.unselectable.forEach((e=>{e.node.classList.remove("unselectable"),e.data.selectable=void 0})),this.unselectable=[])}}t.default=MultiSelectHandler}}));
//# sourceMappingURL=MultiSelectHandler.js.map