const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./useSticky-BKvKCIqm.css","./vendor-vue3-html2pdf-DBfPfU4j.css","./index-CKK3F4Kz.css","./index-BHeTvzz7.css"])))=>i.map(i=>d[i]);
import{d as f}from"./vendor-vue-runtime-dom-B2rky8vu.js";import{_ as p}from"./convert-case-to-camel-case.utils-CK5dBN7n.js";import{d as h,c as A}from"./vendor-pinia-BSPefQhS.js";import{u as v}from"./translationsStore-D6vLzgNA.js";import{d as b,C as I,a as E,e as T,$ as y,k as P,t as w,i as H,v as D}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{r as C}from"./vendor-vue-reactivity-CheHbvBM.js";import"./vendor-vue-shared-DrzsEcag.js";const L=h("stickyApp",{state:()=>({settings:null,calcId:null,title:"",wooCheckoutSettings:null,currencySettings:null,isProActive:!1,hasEmbedCalc:!1}),getters:{getStickySettings:t=>t.settings,getCalcId:t=>t.calcId,getCalcTitle:t=>t.title,getWooCheckoutSettings:t=>t.wooCheckoutSettings,getCurrencySettings:t=>t.currencySettings,getIsProActive:t=>t.isProActive,getHasEmbedCalc:t=>t.hasEmbedCalc},actions:{initStickySettings(t){this.settings=t},initWooCheckoutSettings(t){this.wooCheckoutSettings=t},initCurrencySettings(t){this.currencySettings=t},initCalcId(t){this.calcId=+t||null},initTitle(t){this.title=t},setIsProActive(t){this.isProActive=t},setHasEmbedCalc(t){this.hasEmbedCalc=t}}}),j=t=>t.replace(/_([a-z])/g,(e,c)=>c.toUpperCase());function r(t){return Array.isArray(t)?t.map(r):t!==null&&typeof t=="object"?Object.keys(t).reduce((e,c)=>{const o=j(c);return e[o]=r(t[c]),e},{}):t}const q=b({__name:"App",setup(t){var u;const e=L(),c=v(),o=C(!1),k=I("calc_id"),a=(u=window.ccb_sticky_data)==null?void 0:u[k];if(a&&"stickySettings"in a){const i=r(a);e.setIsProActive(i.is_pro_active),e.setHasEmbedCalc(i.hasEmbedCalc),e.initTitle(i.title),e.initCalcId(i.calcId),e.initStickySettings(i.stickySettings),e.initWooCheckoutSettings(i.wooCheckoutSettings),e.initCurrencySettings(i.currency),c.initTranslations(a.translations)}const l=()=>{var s;let i=0;((s=e.getStickySettings)==null?void 0:s.displayType)!=="banner"&&(i=100),setTimeout(()=>{var m,g;!e.getHasEmbedCalc&&(((m=e.getStickySettings)==null?void 0:m.oneClickAction)==="pdf"||((g=e.getStickySettings)==null?void 0:g.oneClickAction)==="invoice")?o.value=!1:o.value=!0,setTimeout(()=>{var d,S;const n=document.querySelector("#ccb-sticky-floating-wrapper");(d=n==null?void 0:n.classList)!=null&&d.contains("ccb-show")||(S=n==null?void 0:n.classList)==null||S.add("ccb-show")},500)},i)};E(()=>{var i;if(((i=e.getStickySettings)==null?void 0:i.oneClickAction)==="scroll_to"){const s=document.querySelectorAll(`.ccb-main-widget[data-calc-id="${e.getCalcId}"]`);s!=null&&s.length&&l()}else l()});const _=T(()=>{var i;return((i=e.getStickySettings)==null?void 0:i.displayType)==="banner"?y(()=>p(()=>import("./index-CrQ6OO4O.js"),__vite__mapDeps([0,1,2]),import.meta.url)):y(()=>p(()=>import("./index-cr3PNecz.js"),__vite__mapDeps([0,1,3]),import.meta.url))});return(i,s)=>o.value?(H(),P(D(_.value),{key:0})):w("",!0)}}),O=document.querySelectorAll(".ccb-sticky-calc");O.forEach(t=>{const e=C(null),c=f(q).provide("calc_id",t.getAttribute("data-calc-id"));e.value=c,c.use(A()),c.mount(t)});export{L as u};
//# sourceMappingURL=sticky-3wbT2QJo.js.map
