Liferay.Loader.define("frontend-js-web@5.0.45/liferay/util/toggle_controls",["module","exports","require","./get_lexicon_icon","./session.es"],(function(e,s,o){var t;window;{Object.defineProperty(s,"__esModule",{value:!0}),s.default=function(s){const o=document.body,t=(s=s._node||o).querySelector(".toggle-controls");if(!t)return;let n="visible"===Liferay._editControlsState,c=e[n],r=t.querySelector(".lexicon-icon");r&&(c.icon=r);o.classList.add(c.cssClass),Liferay.fire("toggleControls",{enabled:n}),t.addEventListener("click",(()=>{n=!n;const s=c;c=e[n],o.classList.toggle(s.cssClass),o.classList.toggle(c.cssClass);const t=c.iconCssClass,a=c.state,d=(0,l.default)(t);c.icon=d,r.replaceWith(d),r=d,Liferay._editControlsState=a,(0,i.setSessionValue)("com.liferay.frontend.js.web_toggleControls",a),Liferay.fire("toggleControls",{enabled:n,src:"ui"})}))};var l=(t=o("./get_lexicon_icon"))&&t.__esModule?t:{default:t},i=o("./session.es");const e={false:{cssClass:"controls-hidden",iconCssClass:"hidden",state:"hidden"},true:{cssClass:"controls-visible",iconCssClass:"view",state:"visible"}}}}));
//# sourceMappingURL=toggle_controls.js.map