(()=>{const e=jQuery;function t(){window.elementorFrontend.hooks.addFilter("jet-popup/widget-extensions/popup-data",JetEngine.prepareJetPopup),JetEngine.addPopupFilter()}function n(){window.JetPlugins.hooks.addFilter("jet-popup.show-popup.data","JetEngine.popupData",(e,t,n)=>n?(n.data("popupIsJetEngine")&&(e=JetEngine.prepareJetPopup(e,{"is-jet-engine":!0},n)),e):e)}function i(e,t,n){if(t["is-jet-engine"]){e.isJetEngine=!0;var i=n.closest(".jet-listing-grid__items"),o=n.closest(".jet-listing-grid__item"),d=n.closest(".jet-calendar-week__day-event"),a=n.closest("[data-item-object]"),r=!1,s="default";if(i.length)e.listingSource=i.data("listing-source"),e.listingId=i.data("listing-id"),e.queryId=i.data("query-id");else{var p=n.closest("[data-query-id]"),l=n.closest("[data-listing-source]");p.length&&(e.queryId=p.data("query-id")),l.length&&(e.listingSource=l.data("listing-source"))}if(a?.length?(e.postId=a.data("item-object"),!(r=a.data("render-type"))&&a.hasClass("jet-dynamic-table__row")&&(r="jet-data-table")):o.length?(e.postId=o.data("post-id"),r="jet-engine"):d.length?(e.postId=d.data("post-id"),r="jet-engine-calendar"):window.elementorFrontendConfig&&window.elementorFrontendConfig.post&&(e.postId=window.elementorFrontendConfig.post.id),window.JetEngineFormsEditor&&window.JetEngineFormsEditor.hasEditor&&(e.hasEditor=!0),window.JetSmartFilters){switch(r){case"jet-engine":var g=i.data("nav");g.widget_settings?._element_id&&(s=g.widget_settings._element_id);break;case"jet-engine-calendar":var u=d.closest(".jet-listing-calendar").data("settings");u._element_id&&(s=u._element_id);break;case"jet-data-table":const e=n.closest(".jet-dynamic-table")[0].dataset.queryId,t=JetEngineSettings.query_builder.custom_ids;0!==t.length&&t?.[e]&&(s=t[e])}r=window.JetPlugins.hooks.applyFilters("jet-engine.prepareJetPopupData.filterProvider",r,n,t),s=window.JetPlugins.hooks.applyFilters("jet-engine.prepareJetPopupData.filterQueryId",s,n,t),e.queryId&&r&&window.JetSmartFilters?.filterGroups?.[r+"/"+s]?.currentQuery&&(e.filtered_query=window.JetSmartFilters.filterGroups[r+"/"+s].currentQuery)}}return e}function o(t,n,i){if(t){var o={popupId:"jet-popup-"+t};n&&(o.isJetEngine=!0,o.postId=i),e(window).trigger({type:"jet-popup-open-trigger",popupData:o})}}window.JetPlugins.hooks.addAction("jet-engine.modules-include","module-calendar",function(d){d.triggerPopup=o,d.addPopupFilter=n,d.prepareJetPopup=i,e(window).on("elementor/frontend/init",t)})})();