/*! For license information please see frontend-handlers.js.LICENSE.txt */
!function(){"use strict";var e={"./packages/packages/core/frontend-handlers/src/handlers-registry.ts":function(e,n,t){t.r(n),t.d(n,{handlers:function(){return r},register:function(){return register},unregister:function(){return unregister}});const r=new Map,register=({elementType:e,id:n,callback:t})=>{r.has(e)||r.set(e,new Map),r.get(e)?.has(n)||r.get(e)?.set(n,t)},unregister=({elementType:e,id:n})=>{r.has(e)&&(n?(r.get(e)?.delete(n),0===r.get(e)?.size&&r.delete(e)):r.delete(e))}},"./packages/packages/core/frontend-handlers/src/init.ts":function(e,n,t){t.r(n),t.d(n,{init:function(){return init}});var r=t("./packages/packages/core/frontend-handlers/src/lifecycle-events.ts");function init(){window.addEventListener("elementor/element/render",e=>{const n=e,{id:t,type:a,element:s}=n.detail;(0,r.onElementDestroy)({elementType:a,elementId:t}),(0,r.onElementRender)({element:s,elementType:a,elementId:t})}),window.addEventListener("elementor/element/destroy",e=>{const n=e,{id:t,type:a}=n.detail;(0,r.onElementDestroy)({elementType:a,elementId:t})}),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-e-type]").forEach(e=>{const n=e,{eType:t,id:r}=n.dataset;t&&r&&window.dispatchEvent(new CustomEvent("elementor/element/render",{detail:{id:r,type:t,element:e}}))})})}},"./packages/packages/core/frontend-handlers/src/lifecycle-events.ts":function(e,n,t){t.r(n),t.d(n,{onElementDestroy:function(){return onElementDestroy},onElementRender:function(){return onElementRender}});var r=t("./packages/packages/core/frontend-handlers/src/handlers-registry.ts");const a=new Map,s="elementor/element/rendered",onElementRender=({element:e,elementType:n,elementId:t})=>{const o=new AbortController,i=[],dispatchRenderedEvent=()=>{e.dispatchEvent(new CustomEvent(s,{bubbles:!0,detail:{element:e,elementType:n,elementId:t}}))};e.isConnected?dispatchRenderedEvent():requestAnimationFrame(()=>{dispatchRenderedEvent()}),r.handlers.has(n)&&(Array.from(r.handlers.get(n)?.values()??[]).forEach(n=>{const t=e.getAttribute("data-e-settings"),r=n({element:e,signal:o.signal,settings:t?JSON.parse(t):{},listenToChildren:n=>({render:t=>{e.addEventListener(s,e=>{const{elementType:r}=e.detail;n.includes(r)&&t()},{signal:o.signal})}})});"function"==typeof r&&i.push(r)}),a.has(n)||a.set(n,new Map),a.get(n)?.set(t,()=>{o.abort(),i.forEach(e=>e())}))},onElementDestroy=({elementType:e,elementId:n})=>{const t=a.get(e)?.get(n);t&&(t(),a.get(e)?.delete(n),0===a.get(e)?.size&&a.delete(e))}}},n={};function __webpack_require__(t){var r=n[t];if(void 0!==r)return r.exports;var a=n[t]={exports:{}};return e[t](a,a.exports,__webpack_require__),a.exports}__webpack_require__.d=function(e,n){for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},__webpack_require__.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};!function(){__webpack_require__.r(t),__webpack_require__.d(t,{init:function(){return n.init},register:function(){return e.register},unregister:function(){return e.unregister}});var e=__webpack_require__("./packages/packages/core/frontend-handlers/src/handlers-registry.ts"),n=__webpack_require__("./packages/packages/core/frontend-handlers/src/init.ts")}(),(window.elementorV2=window.elementorV2||{}).frontendHandlers=t}(),window.elementorV2.frontendHandlers?.init?.();
//# sourceMappingURL=frontend-handlers.js.map