@billgangcom/theme-lib 1.62.2 → 1.62.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.cjs.js +2 -2
- package/dist/builder.es.js +210 -204
- package/package.json +1 -1
package/dist/builder.cjs.js
CHANGED
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
`,s+=` --border-sm: var(--scale-1);
|
|
85
85
|
`,s+=` --border-md: var(--scale-2);
|
|
86
86
|
`,s+=` --border-lg: var(--scale-4);
|
|
87
|
-
`,s+="}",s},fs=t=>{const n=document.getElementById("dynamic-styles");if(n)n.innerHTML=t;else{const s=document.createElement("style");s.id="dynamic-styles",s.innerHTML=t,document.head.appendChild(s)}};let Ue=new Set;const _s=t=>{const n=new Map;return Object.entries(t).forEach(([s,o])=>{typeof o=="object"&&Object.entries(o).forEach(([a,r])=>{var i;if(r&&r.font){const l=r.font.replace(/\s+/g,"+");n.has(l)||n.set(l,new Set),(i=n.get(l))==null||i.add(r.weight)}})}),n},vs=t=>{const n=new Map;return Object.entries(t).forEach(([s,o])=>{typeof o=="object"&&Object.keys(o).forEach(a=>{var r;if(a==="font"&&o[a]){const i=o[a].replace(/\s+/g,"+");n.has(i)||n.set(i,new Set),(r=n.get(i))==null||r.add("400")}})}),n},ws=t=>{Ue.forEach(n=>{if(!t.has(n)){const s=document.querySelector(`link[data-font="${n}"]`);s&&s.remove(),Ue.delete(n)}})},Cs=t=>{const n=new Set;t.forEach((s,o)=>{const a=Array.from(s).join(";"),r=`${o}:wght@${a}`;if(n.add(r),!Ue.has(r)){const i=document.createElement("link");i.rel="stylesheet",i.href=`https://fonts.googleapis.com/css2?family=${r}&display=swap`,i.setAttribute("data-font",r),document.head.appendChild(i),Ue.add(r)}}),ws(n)},bs=t=>{if(t.fonts){const n=_s(t.fonts.desktop),s=vs(t.buttons),o=new Map(n);s.forEach((a,r)=>{if(o.has(r)){const i=o.get(r);a.forEach(l=>i==null?void 0:i.add(l))}else o.set(r,new Set(a))}),Cs(o)}};function Es(){try{const{editBlock:t,currentBlock:n,blocks:s,header:o,setHeader:a,footer:r,setFooter:i,announcement:l,setAnnouncement:x}=e.useLayersStore.getState(),{currentPage:g,pages:p}=e.usePagesStore.getState(),{currentInstance:h}=e.useBlocksStore.getState(),{settings:c,setSettings:d}=e.useSettingsStore.getState();if(d(c),n&&h&&p){if(n==="header"&&o)a(o);else if(n==="footer"&&r)i(r);else if(n==="announcement"&&l)x(l);else if(n==="header"||n==="footer"||n==="announcement")throw new Error(`Missing ${n} data.`);const S={blockSettings:{}};if(!h.blockSettings)throw new Error("currentInstance.blockSettings is undefined.");if(Object.keys(h.blockSettings).filter(m=>!["displayName","isAddable"].includes(m)).forEach(m=>{S.blockSettings[m]=h.blockSettings[m]}),!p[g])throw new Error(`Page "${g}" does not exist.`);if(!s[p[g].path].data||!s[p[g].path].data[n])throw new Error(`Layer or block for page "${p[g].path}" and block "${n}" does not exist.`);t(p[g].path,n,{name:s[p[g].path].data[n].name,value:S})}}catch(t){console.error("Error in hotReload function:",t)}}async function ks(t,n,s,o){const a=e.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${e.SL_API_URL}/v1/public/${a}/tickets`,{setNotification:i}=e.useNotificationStore.getState(),l=await e.request({method:"post",url:r,body:{title:t,firstMessage:n,email:o,recaptcha:s},withToken:!1});return l.status===200&&i({message:"Ticket created successfully. We will contact you by mail",status:"success"}),l}const Rs="_tooltip_1ch07_1",ys="_fadeIn_1ch07_1",Ts={tooltip:Rs,fadeIn:ys},ve=t=>{const{text:n}=t,{setShowTooltip:s}=e.useTooltipStore();return j.useEffect(()=>(s(!0),()=>{s(!1)}),[]),e.jsxRuntimeExports.jsx("div",{className:Ts.tooltip,children:n})},Ls=()=>{const{undo:t,redo:n,past:s,future:o}=e.useHistoryStore(),[a,r]=j.useState(!1),[i,l]=j.useState(!1),[x,g]=j.useState(!1),[p,h]=j.useState(!1),[c,d]=j.useState(null),{setNotification:S}=e.useNotificationStore();return j.useEffect(()=>{r(s.length===0)},[s]),j.useEffect(()=>{l(o.length===0)},[o]),e.jsxRuntimeExports.jsxs("div",{className:we.buttons,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(we.button,{[we.disabled]:a}),onMouseEnter:()=>{const m=setTimeout(()=>{h(!0),g(!1)},200);d(m)},onMouseLeave:()=>{c&&clearTimeout(c),h(!1),g(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{a||(t(),S({message:"Changes undone",status:"success"}))},fill:a?"#757575":"#252525"}),p&&e.jsxRuntimeExports.jsx(ve,{text:a?"Nothing to undo":"Click to undo changes"})]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(we.button,{[we.disabled]:i}),onMouseEnter:()=>{const m=setTimeout(()=>{g(!0),h(!1)},200);d(m)},onMouseLeave:()=>{c&&clearTimeout(c),g(!1),h(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{i||(n(),S({message:"Changes redone",status:"success"}))},fill:i?"#757575":"#252525"}),x&&e.jsxRuntimeExports.jsx(ve,{text:i?"Nothing to redo":"Click to redo changes"})]})]})},Ns="_devices_ls6k9_1",Bs="_device_ls6k9_1",Ps="_active_ls6k9_27",rt={devices:Ns,device:Bs,active:Ps},As=()=>e.jsxRuntimeExports.jsx("div",{className:rt.devices,children:Bt.map(t=>e.jsxRuntimeExports.jsx(Is,{device:t}))}),Is=t=>{const{device:n}=t,{currentDevice:s,setCurrentDevice:o}=e.useDeviceStore(),[a,r]=j.useState(!1),[i,l]=j.useState(null);return e.jsxRuntimeExports.jsxs("div",{className:e.clx(rt.device,{[rt.active]:s.value===n.value}),onClick:()=>o(n),onMouseEnter:()=>{const x=setTimeout(()=>{r(!0)},200);l(x)},onMouseLeave:()=>{i&&clearTimeout(i),r(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:n.icon,fill:s.value===n.value?"#252525":"#757575",width:20,height:20}),a&&e.jsxRuntimeExports.jsx(ve,{text:`Switch to ${n.value} view`})]},n.value)},$s="_preview_1x3m8_2",Ms="_active_1x3m8_19",Xe={preview:$s,active:Ms},Fs=()=>{const{onPreview:t}=e.usePreviewStore(),[n,s]=j.useState(!1),[o,a]=j.useState(null);return e.jsxRuntimeExports.jsxs("a",{href:"/",className:e.clx(Xe.preview,{[Xe.active]:t}),target:"_blank",onMouseEnter:()=>{const r=setTimeout(()=>{s(!0)},200);a(r)},onMouseLeave:()=>{o&&clearTimeout(o),s(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowUpRight",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:Xe.text,children:"Preview"}),n&&e.jsxRuntimeExports.jsx(ve,{text:"Open draft theme in new tab"})]})},Hs="_settings_u4cv4_1",Ds={settings:Hs},Os="_pages_167qp_1",Us="_text_167qp_21",Vs="_modal_167qp_27",zs="_open_167qp_46",Gs="_page_167qp_1",qs="_hoverable_167qp_61",Ws="_separator_167qp_65",Zs="_button_167qp_70",Xs="_items_167qp_85",Q={pages:Os,default:"_default_167qp_5",text:Us,modal:Vs,open:zs,page:Gs,hoverable:qs,separator:Ws,button:Zs,items:Xs},oe=t=>t?t.replace(/_/g," ").split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" and "):"";function fe(t,n){if(!n||!n[t])return"unknown name";const s=new n[t];return!s.blockSettings||!s.blockSettings.displayName?"unknown name":s.blockSettings.displayName}const kt=(t,n,s,o,a,r,i)=>{const l=t.currentTarget.getBoundingClientRect(),x=window.innerHeight-l.bottom,g=l.top,p=window.innerWidth-l.right,h=l.left;let c,d;return c=l.bottom+o+window.scrollY,d=l.left,(x<n||x<a)&&(g>=n+i?c=l.top-n-o+window.scrollY:c=window.scrollY+i),c-window.scrollY<i&&(c=window.scrollY+i),(p<s||p<r)&&(h>=s?d=l.right-s:d=(window.innerWidth-s)/2),d<l.right+r&&(d=l.right+r),d<l.right&&d+s>l.left&&c<l.bottom&&c+n>l.top&&(p>=s+r?d=l.right+o+r:x>=n?c=l.bottom+o+window.scrollY:(c=window.scrollY+i,d=(window.innerWidth-s)/2)),{top:c,left:d}},Ys=async t=>{const n=localStorage.getItem("shopId")||void 0,s=localStorage.getItem("draftId"),o=`${e.API_URL}/v2/builder/shops/${n}/drafts/${s}/pages/${encodeURIComponent(t)}`;return await e.request({url:o,withToken:!0,method:"delete"})},Ks=()=>{const{currentPage:t,setCurrentPage:n,setIsOpenModal:s,pages:o,setIsEdit:a,setEditedPage:r,deletePage:i,setIsOpenSelectModal:l}=e.usePagesStore(),{deletePage:x,setCurrentBlock:g}=e.useLayersStore(),[p,h]=j.useState(null),{setTitle:c,setDescription:d,setOnConfirm:S}=e.useConfirmationModalStore(),[m,f]=j.useState(!1),v=j.useRef(null);return e.useOnClickOutside(v,()=>{m&&f(!1)}),j.useEffect(()=>{m?l(!0):setTimeout(()=>{l(!1)},300)},[m]),e.jsxRuntimeExports.jsxs("div",{className:Q.pages,ref:v,children:[e.jsxRuntimeExports.jsxs("div",{className:Q.default,onClick:_=>{_.stopPropagation(),f(u=>!u)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:o&&o[t]&&o[t].icon||"File",fill:"#252525",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:Q.text,children:o&&o[t]&&e.defaultPagePaths.includes(o[t].path)?`${oe(o[t].name)} page`:o&&o[t]&&o[t].name}),e.jsxRuntimeExports.jsx("div",{style:{transform:m?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretDown",width:20,height:20})})]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(Q.modal,{[Q.open]:m}),onClick:_=>_.stopPropagation(),children:[o&&e.jsxRuntimeExports.jsx("div",{className:Q.items,children:Object.keys(o).map(_=>{const u=o[_];return e.jsxRuntimeExports.jsxs("div",{className:e.clx(Q.page,{[Q.hoverable]:p===_}),onMouseEnter:()=>h(_),onMouseLeave:()=>h(null),onClick:()=>{h(null),a(!1),g(null),n(_),f(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:u.icon,fill:"#252525"}),e.jsxRuntimeExports.jsx("span",{className:Q.text,children:e.defaultPagePaths.includes(u.path)?`${oe(u.name)} page`:u.name}),p===_&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Gear",fill:"#757575",onClick:C=>{C.stopPropagation(),a(!0),r(_),s(!0)}}),!e.defaultPagePaths.includes(u.path)&&e.jsxRuntimeExports.jsx(e.Icon,{name:"Trash",fill:"#C12A2A",onClick:C=>{C.stopPropagation(),c("Delete Page"),d(`Are you sure you want to delete ${u.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),console.log(o[t].path,u.path),S(()=>{C.stopPropagation(),o[t].path===u.path&&n(Object.keys(o)[0]),i(_),x(u.name),Ys(u.path)})}})]}),o[t]&&o[t].name===u.name&&e.jsxRuntimeExports.jsx(e.Icon,{name:"Check",fill:"#FF3F19"})]},_)})}),e.jsxRuntimeExports.jsx("div",{className:Q.separator}),e.jsxRuntimeExports.jsxs(e.Button,{className:Q.button,onClick:_=>{_.stopPropagation(),s(!0)},size:"l",children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Plus",fill:"#ff3f19"}),e.jsxRuntimeExports.jsx("span",{children:"Create New Page"})]})]})]})},Js="_zoom_fu0hj_1",ht={zoom:Js},Qs=()=>{const{zoomLevel:t,setZoomLevel:n}=e.usePreviewStore();return e.jsxRuntimeExports.jsxs("label",{htmlFor:"zoom",className:ht.zoom,children:[e.jsxRuntimeExports.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:e.jsxRuntimeExports.jsx(e.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),e.jsxRuntimeExports.jsx("input",{id:"zoom",type:"number",min:25,max:250,value:(t*100).toFixed(0),onChange:s=>{const o=Number(s.target.value);n(o/100)},className:ht.input}),e.jsxRuntimeExports.jsx("span",{children:"%"})]})},eo=()=>e.jsxRuntimeExports.jsxs("div",{className:Ds.settings,children:[e.jsxRuntimeExports.jsx(Ks,{}),e.jsxRuntimeExports.jsx(Qs,{})]}),to="_theme_1e5wq_1",so="_text_1e5wq_13",gt={theme:to,text:so},oo=()=>e.jsxRuntimeExports.jsx("div",{className:gt.theme,children:e.jsxRuntimeExports.jsx("div",{className:gt.text,children:"Live Theme"})}),no=async(t,n,s)=>{const o=localStorage.getItem("shopId")||void 0,a=localStorage.getItem("draftId"),r=`${e.API_URL}/v2/builder/shops/${o}/drafts/${a}/${n}`;return await e.request({url:r,withToken:!0,method:t,body:s})};function Ce(t,n){try{return n.map(o=>{if(!o.value||!o.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(o.value.blockSettings).filter(r=>r&&r.type===t).map(r=>{if(r.value===void 0)throw new Error("item.value is undefined.");return r.value}).flat()}).flat().filter(o=>o).map(o=>t==="ListingIds"?o.listingId:o)}catch(s){return console.error("Error in getValues function:",s),[]}}function ro(t,n,s){return io(t,n)?s.reviews.length*3:0}function io(t,n){return n.map(o=>{if(!o.value||!o.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(o.value.blockSettings).filter(r=>r&&r.type===t).map(r=>{if(r.value===void 0)throw new Error("item.value is undefined.");return r.value}).flat()}).flat().filter(o=>o).length>0}function ao(t,n){if(n){const s=Object.keys(n).find(o=>n[o].path===t);if(s)return n[s]}return null}const lo=({setIsLoading:t,isLoading:n})=>{const{themeSettings:s}=e.useThemeSettingsStore(),{settings:o}=e.useSettingsStore(),[a,r]=j.useState(null),[i,l]=j.useState(!1),{setNotification:x}=e.useNotificationStore(),{header:g,footer:p,announcement:h,blocks:c}=e.useLayersStore(),{pageContext:d}=e.usePagesStore(),{pages:S}=e.usePagesStore(),m=async()=>{if(i)a&&clearTimeout(a);else{t(!0);const v=Object.keys(c).map(u=>{console.log(S,u);const C=ao(u,S);return c[u]&&c[u].data&&(C!=null&&C.path)?{id:C?C.id:u,name:C?C.name:u,path:C.path,layout:{...c[u]},neededProductIds:[...Ce("ProductId",Object.values(c[u].data))],neededCategoryIds:[...Ce("CategoryId",Object.values(c[u].data))],neededAnnouncementIds:[...Ce("AnnouncementId",Object.values(c[u].data))],neededListingIds:[...Ce("ListingIds",Object.values(c[u].data))],neededFaqIds:[...Ce("FaqsIds",Object.values(c[u].data))],neededReviewCount:ro("ReviewCount",Object.values(c[u].data),d),seo:{pageTitle:C&&C.seo&&C.seo.pageTitle?C.seo.pageTitle:"",pageDescription:C&&C.seo&&C.seo.pageDescription?C.seo.pageDescription:""},isPrivate:!!(C&&C.visibility==="private")}:null}).filter(u=>u),{status:_}=await no("post","save",{themeSettings:s,settings:{settings:o,header:g,footer:p,announcement:h},updatedPages:v});x({message:_===200?"Settings saved":"Error",status:_===200?"success":"error"}),t(!1)}l(!0);const f=setTimeout(()=>{l(!1)},2e3);r(f)};return e.jsxRuntimeExports.jsx(e.Button,{onClick:m,disabled:n,children:"Save"})},co=()=>{const{isOpenSelectModal:t}=e.usePagesStore(),[n,s]=j.useState(!1),{showTooltip:o}=e.useTooltipStore();return e.jsxRuntimeExports.jsxs("div",{className:Te.header,style:{zIndex:t?5e4:o?501:50},children:[e.jsxRuntimeExports.jsxs("div",{className:Te.left,children:[e.jsxRuntimeExports.jsx(As,{}),e.jsxRuntimeExports.jsx(Fs,{})]}),e.jsxRuntimeExports.jsx("div",{className:Te.center,children:e.jsxRuntimeExports.jsx(eo,{})}),e.jsxRuntimeExports.jsxs("div",{className:Te.right,children:[e.jsxRuntimeExports.jsx(oo,{}),e.jsxRuntimeExports.jsx(Ls,{}),e.jsxRuntimeExports.jsx(lo,{setIsLoading:s,isLoading:n}),n&&e.jsxRuntimeExports.jsx(e.Loader,{})]})]})},uo="_exit_ovvox_1",po="_text_ovvox_11",xo="_exitLink_ovvox_16",Ye={exit:uo,text:po,exitLink:xo},mo=()=>e.jsxRuntimeExports.jsx("div",{className:Ye.exit,children:e.jsxRuntimeExports.jsxs("a",{href:"https://dash.billgang.com/",className:Ye.exitLink,children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"SignOut",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:Ye.text,children:"Exit"})]})}),ho="_navbar_1podc_1",go="_main_1podc_6",jo="_block_1podc_13",So="_active_1podc_29",Ne={navbar:ho,main:go,block:jo,active:So},fo=()=>{const{activeBlock:t}=e.useNavbarStore(),{setActiveBlock:n}=e.useBlocksStore(),{setCurrentBlock:s}=e.useLayersStore(),{setActiveBlock:o}=e.useThemeSettingsStore(),{setActiveBlock:a}=e.usePreviewStore(),r=e.useNavigate();function i(l){switch(n(null),s(null),o(null),a({id:null,neededScroll:!1}),l.name){case"Layers":r("/admin/builder");break;case"Add":r("/admin/builder/add");break;case"Theme":r("/admin/builder/theme");break;case"Settings":r("/admin/builder/settings");break}}return e.jsxRuntimeExports.jsxs("div",{className:Ne.navbar,children:[e.jsxRuntimeExports.jsx(mo,{}),e.jsxRuntimeExports.jsx("div",{className:Ne.main,children:e.navbarBlocks.map(l=>e.jsxRuntimeExports.jsxs("div",{className:e.clx(Ne.block,{[Ne.active]:t.icon===l.icon}),onClick:()=>i(l),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:l.icon,fill:t.icon===l.icon?"#252525":"#757575"}),e.jsxRuntimeExports.jsx("span",{children:l.name})]},l.icon))})]})},_o="_preview_1e84t_1",vo="_main_1e84t_15",wo="_content_1e84t_25",Co="_loading_1e84t_34",bo="_loader_1e84t_48",Eo="_spin_1e84t_1",Be={preview:_o,main:vo,content:wo,loading:Co,loader:bo,spin:Eo},ko="_header_11zku_2",Ro="_circles_11zku_16",yo="_circle_11zku_16",To="_red_11zku_32",Lo="_green_11zku_36",No="_yellow_11zku_40",Bo="_input_11zku_44",Po="_main_11zku_55",Ao="_text_11zku_63",Io="_copy_11zku_75",re={header:ko,circles:Ro,circle:yo,red:To,green:Lo,yellow:No,input:Bo,main:Po,text:Ao,copy:Io},$o=["red","yellow","green"],Mo=()=>{const{currentDevice:t}=e.useDeviceStore(),n=(o,a)=>o.length>a?o.slice(0,a)+"...":o,{setNotification:s}=e.useNotificationStore();return e.jsxRuntimeExports.jsxs("div",{className:re.header,children:[e.jsxRuntimeExports.jsx("div",{className:re.circles,children:$o.map(o=>e.jsxRuntimeExports.jsx("div",{className:e.clx(re.circle,{[re.red]:o==="red",[re.yellow]:o==="yellow",[re.green]:o==="green"})},o))}),e.jsxRuntimeExports.jsx("div",{className:re.input,children:e.jsxRuntimeExports.jsxs("div",{className:re.main,children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),e.jsxRuntimeExports.jsx("span",{className:re.text,children:t.value==="mobile"?n(window.location.origin,35):t.value==="desktop"?n(window.location.origin,200):n(window.location.origin,100)})]})}),e.jsxRuntimeExports.jsx(e.Button,{type:"Secondary",style:{padding:"8px"},onClick:()=>{navigator.clipboard.writeText(window.location.origin),s({status:"success",message:"Domain copied to clipboard"})},className:re.copy,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},Fo="_content_l6a1a_1",Ho="_main_l6a1a_10",Do="_block_l6a1a_14",Oo="_active_l6a1a_20",Uo="_name_l6a1a_30",Vo="_empty_l6a1a_46",zo="_icon_l6a1a_57",Go="_title_l6a1a_70",qo="_text_l6a1a_76",Wo="_sections_l6a1a_82",Zo="_section_l6a1a_82",Xo="_addSection_l6a1a_107",Yo="_addSectionTop_l6a1a_115",ce={content:Fo,main:Ho,block:Do,active:Oo,name:Uo,empty:Vo,icon:zo,title:Go,text:qo,sections:Wo,section:Zo,addSection:Xo,addSectionTop:Yo},Ko="_sidebar_xhqpt_1",Jo="_content_xhqpt_14",Qo="_button_xhqpt_24",en="_moveButton_xhqpt_40",tn="_border_xhqpt_44",sn="_deleteButton_xhqpt_49",ie={sidebar:Ko,content:Jo,button:Qo,moveButton:en,border:tn,deleteButton:sn},on=()=>{var w;const{activeBlock:t,setActiveBlock:n}=e.usePreviewStore(),{blocks:s,removeBlock:o,moveBlock:a,duplicateBlock:r,setCurrentBlock:i}=e.useLayersStore(),{currentPage:l,pages:x}=e.usePagesStore(),{setTitle:g,setDescription:p,setOnConfirm:h}=e.useConfirmationModalStore(),{setActiveBlock:c}=e.useBlocksStore(),d=(w=x==null?void 0:x[l])==null?void 0:w.path,S=d?s[d]:null,m=(S==null?void 0:S.order)||[],f=m.indexOf(t.id),v=E=>{E.stopPropagation(),f>0&&d&&(a(d,f,f-1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},_=E=>{E.stopPropagation(),f<m.length-1&&d&&(a(d,f,f+1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},u=E=>{E.stopPropagation(),d&&r(d,t.id)},C=()=>{d&&(o(d,t.id),i(null),c(null),n({id:null,neededScroll:!1}))};return e.jsxRuntimeExports.jsx("div",{className:ie.sidebar,children:e.jsxRuntimeExports.jsxs("div",{className:ie.content,children:[e.jsxRuntimeExports.jsx("button",{onClick:v,className:e.clx(ie.button,ie.moveButton),disabled:f===0,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowUp"})}),e.jsxRuntimeExports.jsx("button",{onClick:_,className:e.clx(ie.button,ie.moveButton),disabled:f===m.length-1,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowDown"})}),e.jsxRuntimeExports.jsx("button",{onClick:u,className:e.clx(ie.button,ie.moveButton),children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Copy"})}),e.jsxRuntimeExports.jsx("button",{className:e.clx(ie.button,ie.deleteButton),onClick:E=>{E.stopPropagation(),g("Remove Block"),p(`Are you sure you want to delete ${(S==null?void 0:S.data[t.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),h(C)},children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})},nn=j.memo(({scrollableRef:t})=>{console.log("PreviewContent",t);const{setActiveBlock:n,activeBlock:s,zoomLevel:o}=e.usePreviewStore(),{blocks:a,sourceBlocks:r}=e.useBlocksStore(),{blocks:i,setCurrentBlock:l,currentBlock:x,setPositionBlock:g,announcement:p}=e.useLayersStore(),{settings:h}=e.useSettingsStore(),{currentPage:c,pages:d,pageContext:S}=e.usePagesStore(),{activeBlock:m,setActiveBlock:f}=e.useThemeSettingsStore(),{setError:v}=e.useErrorStore(),{setActiveBlock:_}=e.useBlocksStore(),u=j.useRef(s.id),C=j.useRef({});j.useEffect(()=>{if(s.id&&s.neededScroll&&C.current[s.id]){const b=C.current[s.id];if(b&&t.current){const R=b.offsetTop;t.current.scrollTo({top:R-30,behavior:"smooth"})}}},[s,t]);const w=e.useNavigate();j.useEffect(()=>{u.current=s.id},[s.id]);const E=b=>{if(!b||!b.name)return v({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:d&&d[c].id?[d[c].id]:[]}),e.jsxRuntimeExports.jsx(_e,{error:"Block or block.name is undefined."});if(!a||!a[b.name])return v({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:d&&d[c].id?[d[c].id]:[]}),e.jsxRuntimeExports.jsx(_e,{error:`Block "${b.name}" does not exist in blocks.`});const R=new a[b.name];return b.value&&Object.assign(R,b.value),R.renderBlock(h,S)};return e.jsxRuntimeExports.jsxs("div",{onClick:b=>{b.stopPropagation()},className:ce.content,style:{width:"100%",height:"100%",zoom:`${o}`},ref:t,children:[p&&e.jsxRuntimeExports.jsx(bt,{}),e.jsxRuntimeExports.jsx(Oe,{}),e.jsxRuntimeExports.jsx("div",{className:ce.main,children:d&&d[c]&&i[d[c].path]&&i[d[c].path].data&&i[d[c].path].order.map(b=>e.jsxRuntimeExports.jsxs("div",{ref:R=>C.current[b]=R,onClick:R=>{R.stopPropagation(),_(null),m&&f(null),n({id:b,neededScroll:!0}),setTimeout(()=>{n({id:b,neededScroll:!1})},100),l(null),x?setTimeout(()=>{l(s.id)},100):l(s.id)},onMouseEnter:R=>{R.stopPropagation(),s.neededScroll||n({id:b,neededScroll:!1})},onMouseLeave:R=>{R.stopPropagation(),s.neededScroll||n({id:null,neededScroll:!1})},className:e.clx(ce.block),children:[(s.id===b||x===b)&&e.jsxRuntimeExports.jsx("div",{className:ce.active}),(s.id===b||x===b)&&e.jsxRuntimeExports.jsx("div",{className:ce.name,children:fe(i[d[c].path].data[b].name,r)}),(s.id===b||x===b)&&fe(i[d[c].path].data[b].name,r)!=="unknown name"&&e.jsxRuntimeExports.jsx(on,{}),(s.id===b||x===b)&&fe(i[d[c].path].data[b].name,r)!=="unknown name"&&e.jsxRuntimeExports.jsx("div",{className:ce.addSection,children:e.jsxRuntimeExports.jsx(e.Button,{onClick:R=>{R.stopPropagation(),g(b,!0),l(null),n({id:null,neededScroll:!1}),_(null),w("/admin/builder/add")},children:"Add Section"})}),(s.id===b||x===b)&&fe(i[d[c].path].data[b].name,r)!=="unknown name"&&e.jsxRuntimeExports.jsx("div",{className:e.clx(ce.addSection,ce.addSectionTop),children:e.jsxRuntimeExports.jsx(e.Button,{onClick:R=>{R.stopPropagation(),g(b,!1),l(null),n({id:null,neededScroll:!1}),_(null),w("/admin/builder/add")},children:"Add Section"})}),a&&e.jsxRuntimeExports.jsx(at,{render:E,block:i[d[c].path].data[b]})]},b))}),e.jsxRuntimeExports.jsx(De,{})]})}),rn="_results_1pahy_1",jt={results:rn};function an(t,n){return n?new n[t]().blockSettings.isAddable:!1}function ln(t,n){return t?Object.keys(t||{}).reduce((s,o)=>(an(o,n)&&s.push(o),s),[]):[]}const cn="_product_yggw5_1",un="_name_yggw5_15",St={product:cn,name:un},dn=t=>{const{blockId:n,setSearchValue:s}=t,{sourceBlocks:o,setActiveBlock:a}=e.useBlocksStore(),{hideModal:r,hoverBlockId:i,isModalVisible:l,showPreview:x,hidePreview:g,clearHideTimeout:p,startHideTimeout:h,setHoverBlockTopPosition:c}=e.useSubmodalStore();function d(f){s(""),a(f),r("keyBlock")}function S(f,v){const _=window.innerHeight,u=400,C=10;let w=v.clientY-120;w+u>_&&(w=_-u-C),w<C&&(w=C),i||r("keyBlock"),x(f,"keyBlock"),p(),c(w)}function m(){l?h("keyBlock"):g("keyBlock"),c(null)}return e.jsxRuntimeExports.jsxs("div",{className:St.product,onClick:()=>d(n),onMouseEnter:f=>S(n,f),onMouseLeave:m,children:[Ee[n]?e.jsxRuntimeExports.jsx("img",{src:Ee[n]}):e.jsxRuntimeExports.jsx(e.Icon,{name:"Cards"}),e.jsxRuntimeExports.jsx("span",{className:St.name,children:fe(n,o)}),e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretRight",width:20,height:20})]},n)},Rt=()=>{const{blocks:t,sourceBlocks:n}=e.useBlocksStore(),[s,o]=j.useState(""),[a,r]=j.useState([]),i=j.useMemo(()=>ln(t,n),[t]),l=j.useMemo(()=>new e.Fuse(i,{keys:["name"],threshold:.4}),[i]);return j.useEffect(()=>{if(s.trim()==="")r(i);else{const x=l.search(s);r(x.map(g=>g.item))}},[s,l]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.Input,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:o,value:s,style:{marginBottom:10}}),e.jsxRuntimeExports.jsx("div",{className:jt.results,children:a.length>0?a.map(x=>e.jsxRuntimeExports.jsx(dn,{blockId:x,setSearchValue:o})):e.jsxRuntimeExports.jsx("div",{className:jt.noResults,children:"No sections found"})})]})},pn="_wrapper_1k1cr_1",xn="_submodal_1k1cr_14",it={wrapper:pn,submodal:xn},mn=({children:t,positionTop:n,positionLeft:s})=>{const{keyBlock:o,startHideTimeout:a,clearHideTimeout:r,setMouseOverModal:i}=e.useSubmodalStore();return o?e.jsxRuntimeExports.jsx("div",{className:it.wrapper,style:n?{top:n,left:s||void 0}:{},onMouseEnter:()=>{r(),i(!0)},onMouseLeave:()=>{i(!1),a()},children:t}):null},hn=({children:t})=>{const{hoverBlockId:n,startHideTimeout:s,clearHideTimeout:o,setMouseOverModal:a}=e.useSubmodalStore();return n?e.jsxRuntimeExports.jsx("div",{className:e.clx(it.wrapper,it.submodal),onMouseEnter:()=>{o(),a(!0)},onMouseLeave:()=>{a(!1),s()},children:t}):null},gn="_applyButton_1a9kh_2",jn="_content_1a9kh_7",Sn="_title_1a9kh_14",fn="_label_1a9kh_21",_n="_colorValue_1a9kh_40",vn="_colorMap_1a9kh_48",wn="_indicator_1a9kh_57",Cn="_hueSlider_1a9kh_66",bn="_slider_1a9kh_97",En="_buttons_1a9kh_102",kn="_name_1a9kh_109",Rn="_secondary_1a9kh_114",yn="_input_1a9kh_122",Tn="_modal_1a9kh_160",Ln="_alphaSlider_1a9kh_249",Nn="_alphaBackground_1a9kh_257",Bn="_alphaGradient_1a9kh_268",Pn="_chargeTypes_1a9kh_297",An="_charge_1a9kh_297",In="_chargeActive_1a9kh_326",$n="_gradient_1a9kh_334",Mn="_color_1a9kh_40",Fn="_colorActive_1a9kh_355",Hn="_gradientWrapper_1a9kh_362",Dn="_subtitle_1a9kh_368",On="_colorTypes_1a9kh_375",Un="_colorType_1a9kh_375",Vn="_colorTypeActive_1a9kh_399",zn="_colorsWrapper_1a9kh_404",Gn="_colors_1a9kh_404",T={applyButton:gn,content:jn,title:Sn,label:fn,colorValue:_n,colorMap:vn,indicator:wn,hueSlider:Cn,slider:bn,buttons:En,name:kn,secondary:Rn,input:yn,modal:Tn,alphaSlider:Ln,alphaBackground:Nn,alphaGradient:Bn,chargeTypes:Pn,charge:An,chargeActive:In,gradient:$n,color:Mn,colorActive:Fn,gradientWrapper:Hn,subtitle:Dn,colorTypes:On,colorType:Un,colorTypeActive:Vn,colorsWrapper:zn,colors:Gn},qn=()=>{const{modalPosition:t,color:n,initialColor:s,setShowModal:o,hue:a,saturation:r,brightness:i,alpha:l,dragging:x,setDragging:g,setHue:p,setSaturation:h,setBrightness:c,setAlpha:d,colorChange:S,setColor:m,update:f,isGradient:v,setIsGradient:_,gradientDirection:u,setGradientDirection:C,hue2:w,saturation2:E,brightness2:b,alpha2:R,setHue2:F,setSaturation2:P,setBrightness2:H,setAlpha2:V,activeColorIndex:$,setActiveColorIndex:Y,isGradientActive:ne}=e.useColorPickerStore(),M=(N,y,O)=>{y/=100,O/=100;const L=G=>(G+N/60)%6,A=G=>O*(1-y*Math.max(0,Math.min(L(G),4-L(G),1))),B=Math.round(255*A(5)),D=Math.round(255*A(3)),U=Math.round(255*A(1));return{r:B,g:D,b:U}},J=N=>N.toString(16).padStart(2,"0"),Z=(N,y,O,L)=>{const{r:A,g:B,b:D}=M(N,y,O),U=Math.round(L/100*255);return`#${J(A)}${J(B)}${J(D)}${J(U)}`},I=(N,y,O,L)=>{if(v)if($===1){p(N),h(y),c(O),d(L);const A=Z(N,y,O,L),B=Z(w,E,b,R),U=`linear-gradient(${u==="vertical"?"0deg":"90deg"}, ${A} 0%, ${B} 100%)`;S(U),m(U)}else{F(N),P(y),H(O),V(L);const A=Z(N,y,O,L),B=Z(a,r,i,l),U=`linear-gradient(${u==="vertical"?"0deg":"90deg"}, ${B} 0%, ${A} 100%)`;S(U),m(U)}else{const A=Z(N,y,O,L);S(A),m(A)}},q=(N,y,O)=>{const{width:L,height:A}=O.getBoundingClientRect(),B=Math.max(0,Math.min(N/L*100,100)),D=Math.max(0,Math.min(100-y/A*100,100));v?$===1?(h(B),c(D),I(a,B,D,l)):(P(B),H(D),I(w,B,D,R)):(h(B),c(D),I(a,B,D,l))},ae=N=>{const{offsetX:y,offsetY:O}=N.nativeEvent;g(!0),q(y,O,N.currentTarget)},Ve=N=>{if(x){const y=document.querySelector(`.${T.colorMap}`),{left:O,top:L}=y.getBoundingClientRect(),A=N.clientX-O,B=N.clientY-L;q(A,B,y)}},ye=()=>{g(!1)};j.useEffect(()=>{function N(L){const A=/linear-gradient\((\d+deg),\s*(#[0-9a-fA-F]{8})\s*0%,\s*(#[0-9a-fA-F]{8})\s*100%\)/,B=L.match(A);if(B){const D=B[1],U=B[2],G=B[3];return{angle:D,col1:U,col2:G}}return null}function y(L){const A=parseInt(L.slice(1,3),16),B=parseInt(L.slice(3,5),16),D=parseInt(L.slice(5,7),16),U=parseInt(L.slice(7,9),16)/255*100,{h:G,s:he,b:Ge}=O(A,B,D);return{h:G,s:he,b:Ge,a:U}}function O(L,A,B){L/=255,A/=255,B/=255;const D=Math.max(L,A,B),U=Math.min(L,A,B);let G=0;const he=D-U,Ge=(D===0?0:he/D)*100,Nt=D*100;if(D===U)G=0;else switch(D){case L:G=((A-B)/he+(A<B?6:0))*60;break;case A:G=((B-L)/he+2)*60;break;case B:G=((L-A)/he+4)*60;break}return{h:G,s:Ge,b:Nt}}if(s&&s.startsWith("linear-gradient")){const L=N(s);if(L){const{angle:A,col1:B,col2:D}=L,U=y(B),G=y(D);_(!0),C(A==="0deg"?"vertical":"horizontal"),p(U.h),h(U.s),c(U.b),d(U.a),F(G.h),P(G.s),H(G.b),V(G.a),Y(1)}}else if(s){const A=function(D){let U=D;return U.length===7&&(U=U+"ff"),U}(s),B=y(A);_(!1),p(B.h),h(B.s),c(B.b),d(B.a)}},[s,_,C,p,h,c,d,F,P,H,V,Y]),j.useEffect(()=>{let N,y,O,L;v?$===1?(N=a,y=r,O=i,L=l):(N=w,y=E,O=b,L=R):(N=a,y=r,O=i,L=l),I(N,y,O,L)},[v,u,$,a,r,i,l,w,E,b,R]),j.useEffect(()=>{const N=O=>Ve(O),y=()=>ye();return x?(document.addEventListener("mousemove",N),document.addEventListener("mouseup",y)):(document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",y)),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",y)}},[x,v,u]);function ze(){if(!v)f(n);else{const N=Z(a,r,i,l),y=Z(w,E,b,R),L=`linear-gradient(${u==="vertical"?"0deg":"90deg"}, ${N} 0%, ${y} 100%)`;f(L)}o(!1)}function z(){o(!1),S(s)}const me=v?$===1?a:w:a,lt=v?$===1?r:E:r,ct=v?$===1?i:b:i,Tt=v?$===1?l:R:l,{r:ut,g:dt,b:pt}=M(me,lt,ct),Lt=`linear-gradient(to right, rgba(${ut}, ${dt}, ${pt}, 0), rgba(${ut}, ${dt}, ${pt}, 1))`,xt=Z(a,r,i,l),mt=Z(w,E,b,R);return e.jsxRuntimeExports.jsxs("div",{className:T.modal,onClick:N=>N.stopPropagation(),style:{top:`${t.top}px`,left:`${t.left}px`},children:[e.jsxRuntimeExports.jsx("h2",{className:T.title,children:"Color"}),ne&&e.jsxRuntimeExports.jsxs("div",{className:T.colorTypes,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(T.colorType,{[T.colorTypeActive]:!v}),onClick:()=>_(!1),children:[e.jsxRuntimeExports.jsx("div",{style:{background:"#757575",width:"16px",height:"16px",borderRadius:"50%"}}),"Solid"]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(T.colorType,{[T.colorTypeActive]:v}),onClick:()=>_(!0),children:[e.jsxRuntimeExports.jsx("div",{style:{background:"linear-gradient(to bottom, #757575 0%, #DBDBDB 100%)",width:"16px",height:"16px",borderRadius:"50%"}}),"Linear"]})]}),v&&ne&&e.jsxRuntimeExports.jsxs("div",{className:T.colorsWrapper,children:[e.jsxRuntimeExports.jsx("div",{className:T.colors,style:{background:`linear-gradient(90deg, ${xt} 0%, ${mt} 100%)`}}),e.jsxRuntimeExports.jsx("div",{className:e.clx(T.color,{[T.colorActive]:$===1}),onClick:()=>Y(1),style:{background:xt}}),e.jsxRuntimeExports.jsx("div",{className:e.clx(T.color,{[T.colorActive]:$===2}),onClick:()=>Y(2),style:{background:mt}})]}),e.jsxRuntimeExports.jsx("div",{className:T.colorMap,onMouseDown:ae,style:{background:`
|
|
87
|
+
`,s+="}",s},fs=t=>{const n=document.getElementById("dynamic-styles");if(n)n.innerHTML=t;else{const s=document.createElement("style");s.id="dynamic-styles",s.innerHTML=t,document.head.appendChild(s)}};let Ue=new Set;const _s=t=>{const n=new Map;return Object.entries(t).forEach(([s,o])=>{typeof o=="object"&&Object.entries(o).forEach(([a,r])=>{var i;if(r&&r.font){const l=r.font.replace(/\s+/g,"+");n.has(l)||n.set(l,new Set),(i=n.get(l))==null||i.add(r.weight)}})}),n},vs=t=>{const n=new Map;return Object.entries(t).forEach(([s,o])=>{typeof o=="object"&&Object.keys(o).forEach(a=>{var r;if(a==="font"&&o[a]){const i=o[a].replace(/\s+/g,"+");n.has(i)||n.set(i,new Set),(r=n.get(i))==null||r.add("400")}})}),n},ws=t=>{Ue.forEach(n=>{if(!t.has(n)){const s=document.querySelector(`link[data-font="${n}"]`);s&&s.remove(),Ue.delete(n)}})},Cs=t=>{const n=new Set;t.forEach((s,o)=>{const a=Array.from(s).join(";"),r=`${o}:wght@${a}`;if(n.add(r),!Ue.has(r)){const i=document.createElement("link");i.rel="stylesheet",i.href=`https://fonts.googleapis.com/css2?family=${r}&display=swap`,i.setAttribute("data-font",r),document.head.appendChild(i),Ue.add(r)}}),ws(n)},bs=t=>{if(t.fonts){const n=_s(t.fonts.desktop),s=vs(t.buttons),o=new Map(n);s.forEach((a,r)=>{if(o.has(r)){const i=o.get(r);a.forEach(l=>i==null?void 0:i.add(l))}else o.set(r,new Set(a))}),Cs(o)}};function Es(){try{const{editBlock:t,currentBlock:n,blocks:s,header:o,setHeader:a,footer:r,setFooter:i,announcement:l,setAnnouncement:x}=e.useLayersStore.getState(),{currentPage:g,pages:p}=e.usePagesStore.getState(),{currentInstance:h}=e.useBlocksStore.getState(),{settings:c,setSettings:d}=e.useSettingsStore.getState();if(d(c),n&&h&&p){if(n==="header"&&o)a(o);else if(n==="footer"&&r)i(r);else if(n==="announcement"&&l)x(l);else if(n==="header"||n==="footer"||n==="announcement")throw new Error(`Missing ${n} data.`);const S={blockSettings:{}};if(!h.blockSettings)throw new Error("currentInstance.blockSettings is undefined.");if(Object.keys(h.blockSettings).filter(m=>!["displayName","isAddable"].includes(m)).forEach(m=>{S.blockSettings[m]=h.blockSettings[m]}),!p[g])throw new Error(`Page "${g}" does not exist.`);if(!s[p[g].path].data||!s[p[g].path].data[n])throw new Error(`Layer or block for page "${p[g].path}" and block "${n}" does not exist.`);t(p[g].path,n,{name:s[p[g].path].data[n].name,value:S})}}catch(t){console.error("Error in hotReload function:",t)}}async function ks(t,n,s,o){const a=e.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${e.SL_API_URL}/v1/public/${a}/tickets`,{setNotification:i}=e.useNotificationStore.getState(),l=await e.request({method:"post",url:r,body:{title:t,firstMessage:n,email:o,recaptcha:s},withToken:!1});return l.status===200&&i({message:"Ticket created successfully. We will contact you by mail",status:"success"}),l}const Rs="_tooltip_1ch07_1",ys="_fadeIn_1ch07_1",Ts={tooltip:Rs,fadeIn:ys},ve=t=>{const{text:n}=t,{setShowTooltip:s}=e.useTooltipStore();return j.useEffect(()=>(s(!0),()=>{s(!1)}),[]),e.jsxRuntimeExports.jsx("div",{className:Ts.tooltip,children:n})},Ls=()=>{const{undo:t,redo:n,past:s,future:o}=e.useHistoryStore(),[a,r]=j.useState(!1),[i,l]=j.useState(!1),[x,g]=j.useState(!1),[p,h]=j.useState(!1),[c,d]=j.useState(null),{setNotification:S}=e.useNotificationStore();return j.useEffect(()=>{r(s.length===0)},[s]),j.useEffect(()=>{l(o.length===0)},[o]),e.jsxRuntimeExports.jsxs("div",{className:we.buttons,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(we.button,{[we.disabled]:a}),onMouseEnter:()=>{const m=setTimeout(()=>{h(!0),g(!1)},200);d(m)},onMouseLeave:()=>{c&&clearTimeout(c),h(!1),g(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{a||(t(),S({message:"Changes undone",status:"success"}))},fill:a?"#757575":"#252525"}),p&&e.jsxRuntimeExports.jsx(ve,{text:a?"Nothing to undo":"Click to undo changes"})]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(we.button,{[we.disabled]:i}),onMouseEnter:()=>{const m=setTimeout(()=>{g(!0),h(!1)},200);d(m)},onMouseLeave:()=>{c&&clearTimeout(c),g(!1),h(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{i||(n(),S({message:"Changes redone",status:"success"}))},fill:i?"#757575":"#252525"}),x&&e.jsxRuntimeExports.jsx(ve,{text:i?"Nothing to redo":"Click to redo changes"})]})]})},Ns="_devices_ls6k9_1",Bs="_device_ls6k9_1",Ps="_active_ls6k9_27",rt={devices:Ns,device:Bs,active:Ps},As=()=>e.jsxRuntimeExports.jsx("div",{className:rt.devices,children:Bt.map(t=>e.jsxRuntimeExports.jsx(Is,{device:t}))}),Is=t=>{const{device:n}=t,{currentDevice:s,setCurrentDevice:o}=e.useDeviceStore(),[a,r]=j.useState(!1),[i,l]=j.useState(null);return e.jsxRuntimeExports.jsxs("div",{className:e.clx(rt.device,{[rt.active]:s.value===n.value}),onClick:()=>o(n),onMouseEnter:()=>{const x=setTimeout(()=>{r(!0)},200);l(x)},onMouseLeave:()=>{i&&clearTimeout(i),r(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:n.icon,fill:s.value===n.value?"#252525":"#757575",width:20,height:20}),a&&e.jsxRuntimeExports.jsx(ve,{text:`Switch to ${n.value} view`})]},n.value)},$s="_preview_1x3m8_2",Ms="_active_1x3m8_19",Xe={preview:$s,active:Ms},Fs=()=>{const{onPreview:t}=e.usePreviewStore(),[n,s]=j.useState(!1),[o,a]=j.useState(null);return e.jsxRuntimeExports.jsxs("a",{href:"/",className:e.clx(Xe.preview,{[Xe.active]:t}),target:"_blank",onMouseEnter:()=>{const r=setTimeout(()=>{s(!0)},200);a(r)},onMouseLeave:()=>{o&&clearTimeout(o),s(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowUpRight",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:Xe.text,children:"Preview"}),n&&e.jsxRuntimeExports.jsx(ve,{text:"Open draft theme in new tab"})]})},Hs="_settings_u4cv4_1",Ds={settings:Hs},Os="_pages_167qp_1",Us="_text_167qp_21",Vs="_modal_167qp_27",zs="_open_167qp_46",Gs="_page_167qp_1",qs="_hoverable_167qp_61",Ws="_separator_167qp_65",Zs="_button_167qp_70",Xs="_items_167qp_85",Q={pages:Os,default:"_default_167qp_5",text:Us,modal:Vs,open:zs,page:Gs,hoverable:qs,separator:Ws,button:Zs,items:Xs},oe=t=>t?t.replace(/_/g," ").split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" and "):"";function fe(t,n){if(!n||!n[t])return"unknown name";const s=new n[t];return!s.blockSettings||!s.blockSettings.displayName?"unknown name":s.blockSettings.displayName}const kt=(t,n,s,o,a,r,i)=>{const l=t.currentTarget.getBoundingClientRect(),x=window.innerHeight-l.bottom,g=l.top,p=window.innerWidth-l.right,h=l.left;let c,d;return c=l.bottom+o+window.scrollY,d=l.left,(x<n||x<a)&&(g>=n+i?c=l.top-n-o+window.scrollY:c=window.scrollY+i),c-window.scrollY<i&&(c=window.scrollY+i),(p<s||p<r)&&(h>=s?d=l.right-s:d=(window.innerWidth-s)/2),d<l.right+r&&(d=l.right+r),d<l.right&&d+s>l.left&&c<l.bottom&&c+n>l.top&&(p>=s+r?d=l.right+o+r:x>=n?c=l.bottom+o+window.scrollY:(c=window.scrollY+i,d=(window.innerWidth-s)/2)),{top:c,left:d}},Ys=async t=>{const n=localStorage.getItem("shopId")||void 0,s=localStorage.getItem("draftId"),o=`${e.API_URL}/v2/builder/shops/${n}/drafts/${s}/pages/${encodeURIComponent(t)}`;return await e.request({url:o,withToken:!0,method:"delete"})},Ks=()=>{const{currentPage:t,setCurrentPage:n,setIsOpenModal:s,pages:o,setIsEdit:a,setEditedPage:r,deletePage:i,setIsOpenSelectModal:l}=e.usePagesStore(),{deletePage:x,setCurrentBlock:g}=e.useLayersStore(),[p,h]=j.useState(null),{setTitle:c,setDescription:d,setOnConfirm:S}=e.useConfirmationModalStore(),[m,f]=j.useState(!1),v=j.useRef(null);return e.useOnClickOutside(v,()=>{m&&f(!1)}),j.useEffect(()=>{m?l(!0):setTimeout(()=>{l(!1)},300)},[m]),e.jsxRuntimeExports.jsxs("div",{className:Q.pages,ref:v,children:[e.jsxRuntimeExports.jsxs("div",{className:Q.default,onClick:_=>{_.stopPropagation(),f(u=>!u)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:o&&o[t]&&o[t].icon||"File",fill:"#252525",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:Q.text,children:o&&o[t]&&e.defaultPagePaths.includes(o[t].path)?`${oe(o[t].name)} page`:o&&o[t]&&o[t].name}),e.jsxRuntimeExports.jsx("div",{style:{transform:m?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretDown",width:20,height:20})})]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(Q.modal,{[Q.open]:m}),onClick:_=>_.stopPropagation(),children:[o&&e.jsxRuntimeExports.jsx("div",{className:Q.items,children:Object.keys(o).map(_=>{const u=o[_];return e.jsxRuntimeExports.jsxs("div",{className:e.clx(Q.page,{[Q.hoverable]:p===_}),onMouseEnter:()=>h(_),onMouseLeave:()=>h(null),onClick:()=>{h(null),a(!1),g(null),n(_),f(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:u.icon,fill:"#252525"}),e.jsxRuntimeExports.jsx("span",{className:Q.text,children:e.defaultPagePaths.includes(u.path)?`${oe(u.name)} page`:u.name}),p===_&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Gear",fill:"#757575",onClick:C=>{C.stopPropagation(),a(!0),r(_),s(!0)}}),!e.defaultPagePaths.includes(u.path)&&e.jsxRuntimeExports.jsx(e.Icon,{name:"Trash",fill:"#C12A2A",onClick:C=>{C.stopPropagation(),c("Delete Page"),d(`Are you sure you want to delete ${u.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),console.log(o[t].path,u.path),S(()=>{C.stopPropagation(),o[t].path===u.path&&n(Object.keys(o)[0]),i(_),x(u.name),Ys(u.path)})}})]}),o[t]&&o[t].name===u.name&&e.jsxRuntimeExports.jsx(e.Icon,{name:"Check",fill:"#FF3F19"})]},_)})}),e.jsxRuntimeExports.jsx("div",{className:Q.separator}),e.jsxRuntimeExports.jsxs(e.Button,{className:Q.button,onClick:_=>{_.stopPropagation(),s(!0)},size:"l",children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Plus",fill:"#ff3f19"}),e.jsxRuntimeExports.jsx("span",{children:"Create New Page"})]})]})]})},Js="_zoom_fu0hj_1",ht={zoom:Js},Qs=()=>{const{zoomLevel:t,setZoomLevel:n}=e.usePreviewStore();return e.jsxRuntimeExports.jsxs("label",{htmlFor:"zoom",className:ht.zoom,children:[e.jsxRuntimeExports.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:e.jsxRuntimeExports.jsx(e.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),e.jsxRuntimeExports.jsx("input",{id:"zoom",type:"number",min:25,max:250,value:(t*100).toFixed(0),onChange:s=>{const o=Number(s.target.value);n(o/100)},className:ht.input}),e.jsxRuntimeExports.jsx("span",{children:"%"})]})},eo=()=>e.jsxRuntimeExports.jsxs("div",{className:Ds.settings,children:[e.jsxRuntimeExports.jsx(Ks,{}),e.jsxRuntimeExports.jsx(Qs,{})]}),to="_theme_1e5wq_1",so="_text_1e5wq_13",gt={theme:to,text:so},oo=()=>e.jsxRuntimeExports.jsx("div",{className:gt.theme,children:e.jsxRuntimeExports.jsx("div",{className:gt.text,children:"Live Theme"})}),no=async(t,n,s)=>{const o=localStorage.getItem("shopId")||void 0,a=localStorage.getItem("draftId"),r=`${e.API_URL}/v2/builder/shops/${o}/drafts/${a}/${n}`;return await e.request({url:r,withToken:!0,method:t,body:s})};function Ce(t,n){try{return n.map(o=>{if(!o.value||!o.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(o.value.blockSettings).filter(r=>r&&r.type===t).map(r=>{if(r.value===void 0)throw new Error("item.value is undefined.");return r.value}).flat()}).flat().filter(o=>o).map(o=>t==="ListingIds"?o.listingId:o)}catch(s){return console.error("Error in getValues function:",s),[]}}function ro(t,n,s){return io(t,n)?s.reviews.length*3:0}function io(t,n){return n.map(o=>{if(!o.value||!o.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(o.value.blockSettings).filter(r=>r&&r.type===t).map(r=>{if(r.value===void 0)throw new Error("item.value is undefined.");return r.value}).flat()}).flat().filter(o=>o).length>0}function ao(t,n){if(n){const s=Object.keys(n).find(o=>n[o].path===t);if(s)return n[s]}return null}const lo=({setIsLoading:t,isLoading:n})=>{const{themeSettings:s}=e.useThemeSettingsStore(),{settings:o}=e.useSettingsStore(),[a,r]=j.useState(null),[i,l]=j.useState(!1),{setNotification:x}=e.useNotificationStore(),{header:g,footer:p,announcement:h,blocks:c}=e.useLayersStore(),{pageContext:d}=e.usePagesStore(),{pages:S}=e.usePagesStore(),m=async()=>{if(i)a&&clearTimeout(a);else{t(!0);const v=Object.keys(c).map(u=>{console.log(S,u);const C=ao(u,S);return c[u]&&c[u].data&&(C!=null&&C.path)?{id:C?C.id:u,name:C?C.name:u,path:C.path,layout:{...c[u]},neededProductIds:[...Ce("ProductId",Object.values(c[u].data))],neededCategoryIds:[...Ce("CategoryId",Object.values(c[u].data))],neededAnnouncementIds:[...Ce("AnnouncementId",Object.values(c[u].data))],neededListingIds:[...Ce("ListingIds",Object.values(c[u].data))],neededFaqIds:[...Ce("FaqsIds",Object.values(c[u].data))],neededReviewCount:ro("ReviewCount",Object.values(c[u].data),d),seo:{pageTitle:C&&C.seo&&C.seo.pageTitle?C.seo.pageTitle:"",pageDescription:C&&C.seo&&C.seo.pageDescription?C.seo.pageDescription:""},isPrivate:!!(C&&C.visibility==="private")}:null}).filter(u=>u),{status:_}=await no("post","save",{themeSettings:s,settings:{settings:o,header:g,footer:p,announcement:h},updatedPages:v});x({message:_===200?"Settings saved":"Error",status:_===200?"success":"error"}),t(!1)}l(!0);const f=setTimeout(()=>{l(!1)},2e3);r(f)};return e.jsxRuntimeExports.jsx(e.Button,{onClick:m,disabled:n,children:"Save"})},co=()=>{const{isOpenSelectModal:t}=e.usePagesStore(),[n,s]=j.useState(!1),{showTooltip:o}=e.useTooltipStore();return e.jsxRuntimeExports.jsxs("div",{className:Te.header,style:{zIndex:t?5e4:o?501:50},children:[e.jsxRuntimeExports.jsxs("div",{className:Te.left,children:[e.jsxRuntimeExports.jsx(As,{}),e.jsxRuntimeExports.jsx(Fs,{})]}),e.jsxRuntimeExports.jsx("div",{className:Te.center,children:e.jsxRuntimeExports.jsx(eo,{})}),e.jsxRuntimeExports.jsxs("div",{className:Te.right,children:[e.jsxRuntimeExports.jsx(oo,{}),e.jsxRuntimeExports.jsx(Ls,{}),e.jsxRuntimeExports.jsx(lo,{setIsLoading:s,isLoading:n}),n&&e.jsxRuntimeExports.jsx(e.Loader,{})]})]})},uo="_exit_ovvox_1",po="_text_ovvox_11",xo="_exitLink_ovvox_16",Ye={exit:uo,text:po,exitLink:xo},mo=()=>e.jsxRuntimeExports.jsx("div",{className:Ye.exit,children:e.jsxRuntimeExports.jsxs("a",{href:"https://dash.billgang.com/",className:Ye.exitLink,children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"SignOut",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:Ye.text,children:"Exit"})]})}),ho="_navbar_1podc_1",go="_main_1podc_6",jo="_block_1podc_13",So="_active_1podc_29",Ne={navbar:ho,main:go,block:jo,active:So},fo=()=>{const{activeBlock:t}=e.useNavbarStore(),{setActiveBlock:n}=e.useBlocksStore(),{setCurrentBlock:s}=e.useLayersStore(),{setActiveBlock:o}=e.useThemeSettingsStore(),{setActiveBlock:a}=e.usePreviewStore(),r=e.useNavigate();function i(l){switch(n(null),s(null),o(null),a({id:null,neededScroll:!1}),l.name){case"Layers":r("/admin/builder");break;case"Add":r("/admin/builder/add");break;case"Theme":r("/admin/builder/theme");break;case"Settings":r("/admin/builder/settings");break}}return e.jsxRuntimeExports.jsxs("div",{className:Ne.navbar,children:[e.jsxRuntimeExports.jsx(mo,{}),e.jsxRuntimeExports.jsx("div",{className:Ne.main,children:e.navbarBlocks.map(l=>e.jsxRuntimeExports.jsxs("div",{className:e.clx(Ne.block,{[Ne.active]:t.icon===l.icon}),onClick:()=>i(l),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:l.icon,fill:t.icon===l.icon?"#252525":"#757575"}),e.jsxRuntimeExports.jsx("span",{children:l.name})]},l.icon))})]})},_o="_preview_1e84t_1",vo="_main_1e84t_15",wo="_content_1e84t_25",Co="_loading_1e84t_34",bo="_loader_1e84t_48",Eo="_spin_1e84t_1",Be={preview:_o,main:vo,content:wo,loading:Co,loader:bo,spin:Eo},ko="_header_11zku_2",Ro="_circles_11zku_16",yo="_circle_11zku_16",To="_red_11zku_32",Lo="_green_11zku_36",No="_yellow_11zku_40",Bo="_input_11zku_44",Po="_main_11zku_55",Ao="_text_11zku_63",Io="_copy_11zku_75",re={header:ko,circles:Ro,circle:yo,red:To,green:Lo,yellow:No,input:Bo,main:Po,text:Ao,copy:Io},$o=["red","yellow","green"],Mo=()=>{const{currentDevice:t}=e.useDeviceStore(),n=(o,a)=>o.length>a?o.slice(0,a)+"...":o,{setNotification:s}=e.useNotificationStore();return e.jsxRuntimeExports.jsxs("div",{className:re.header,children:[e.jsxRuntimeExports.jsx("div",{className:re.circles,children:$o.map(o=>e.jsxRuntimeExports.jsx("div",{className:e.clx(re.circle,{[re.red]:o==="red",[re.yellow]:o==="yellow",[re.green]:o==="green"})},o))}),e.jsxRuntimeExports.jsx("div",{className:re.input,children:e.jsxRuntimeExports.jsxs("div",{className:re.main,children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),e.jsxRuntimeExports.jsx("span",{className:re.text,children:t.value==="mobile"?n(window.location.origin,35):t.value==="desktop"?n(window.location.origin,200):n(window.location.origin,100)})]})}),e.jsxRuntimeExports.jsx(e.Button,{type:"Secondary",style:{padding:"8px"},onClick:()=>{navigator.clipboard.writeText(window.location.origin),s({status:"success",message:"Domain copied to clipboard"})},className:re.copy,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},Fo="_content_l6a1a_1",Ho="_main_l6a1a_10",Do="_block_l6a1a_14",Oo="_active_l6a1a_20",Uo="_name_l6a1a_30",Vo="_empty_l6a1a_46",zo="_icon_l6a1a_57",Go="_title_l6a1a_70",qo="_text_l6a1a_76",Wo="_sections_l6a1a_82",Zo="_section_l6a1a_82",Xo="_addSection_l6a1a_107",Yo="_addSectionTop_l6a1a_115",ce={content:Fo,main:Ho,block:Do,active:Oo,name:Uo,empty:Vo,icon:zo,title:Go,text:qo,sections:Wo,section:Zo,addSection:Xo,addSectionTop:Yo},Ko="_sidebar_xhqpt_1",Jo="_content_xhqpt_14",Qo="_button_xhqpt_24",en="_moveButton_xhqpt_40",tn="_border_xhqpt_44",sn="_deleteButton_xhqpt_49",ie={sidebar:Ko,content:Jo,button:Qo,moveButton:en,border:tn,deleteButton:sn},on=()=>{var w;const{activeBlock:t,setActiveBlock:n}=e.usePreviewStore(),{blocks:s,removeBlock:o,moveBlock:a,duplicateBlock:r,setCurrentBlock:i}=e.useLayersStore(),{currentPage:l,pages:x}=e.usePagesStore(),{setTitle:g,setDescription:p,setOnConfirm:h}=e.useConfirmationModalStore(),{setActiveBlock:c}=e.useBlocksStore(),d=(w=x==null?void 0:x[l])==null?void 0:w.path,S=d?s[d]:null,m=(S==null?void 0:S.order)||[],f=m.indexOf(t.id),v=E=>{E.stopPropagation(),f>0&&d&&(a(d,f,f-1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},_=E=>{E.stopPropagation(),f<m.length-1&&d&&(a(d,f,f+1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},u=E=>{E.stopPropagation(),d&&r(d,t.id)},C=()=>{d&&(o(d,t.id),i(null),c(null),n({id:null,neededScroll:!1}))};return e.jsxRuntimeExports.jsx("div",{className:ie.sidebar,children:e.jsxRuntimeExports.jsxs("div",{className:ie.content,children:[e.jsxRuntimeExports.jsx("button",{onClick:v,className:e.clx(ie.button,ie.moveButton),disabled:f===0,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowUp"})}),e.jsxRuntimeExports.jsx("button",{onClick:_,className:e.clx(ie.button,ie.moveButton),disabled:f===m.length-1,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowDown"})}),e.jsxRuntimeExports.jsx("button",{onClick:u,className:e.clx(ie.button,ie.moveButton),children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Copy"})}),e.jsxRuntimeExports.jsx("button",{className:e.clx(ie.button,ie.deleteButton),onClick:E=>{E.stopPropagation(),g("Remove Block"),p(`Are you sure you want to delete ${(S==null?void 0:S.data[t.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),h(C)},children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})},nn=j.memo(({scrollableRef:t})=>{console.log("PreviewContent",t);const{setActiveBlock:n,activeBlock:s,zoomLevel:o}=e.usePreviewStore(),{blocks:a,sourceBlocks:r}=e.useBlocksStore(),{blocks:i,setCurrentBlock:l,currentBlock:x,setPositionBlock:g,announcement:p}=e.useLayersStore(),{settings:h}=e.useSettingsStore(),{currentPage:c,pages:d,pageContext:S}=e.usePagesStore(),{activeBlock:m,setActiveBlock:f}=e.useThemeSettingsStore(),{setError:v}=e.useErrorStore(),{setActiveBlock:_}=e.useBlocksStore(),u=j.useRef(s.id),C=j.useRef({});j.useEffect(()=>{if(s.id&&s.neededScroll&&C.current[s.id]){const b=C.current[s.id];if(b&&t.current){const R=b.offsetTop;t.current.scrollTo({top:R-30,behavior:"smooth"})}}},[s,t]);const w=e.useNavigate();j.useEffect(()=>{u.current=s.id},[s.id]);const E=b=>{if(!b||!b.name)return v({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:d&&d[c].id?[d[c].id]:[]}),e.jsxRuntimeExports.jsx(_e,{error:"Block or block.name is undefined."});if(!a||!a[b.name])return v({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:d&&d[c].id?[d[c].id]:[]}),e.jsxRuntimeExports.jsx(_e,{error:`Block "${b.name}" does not exist in blocks.`});const R=new a[b.name];return b.value&&Object.assign(R,b.value),R.renderBlock(h,S)};return e.jsxRuntimeExports.jsxs("div",{onClick:b=>{b.stopPropagation()},className:ce.content,style:{width:"100%",height:"100%",zoom:`${o}`},ref:t,children:[p&&e.jsxRuntimeExports.jsx(bt,{}),e.jsxRuntimeExports.jsx(Oe,{}),e.jsxRuntimeExports.jsx("div",{className:ce.main,children:d&&d[c]&&i[d[c].path]&&i[d[c].path].data&&i[d[c].path].order.map(b=>e.jsxRuntimeExports.jsxs("div",{ref:R=>C.current[b]=R,onClick:R=>{R.stopPropagation(),_(null),m&&f(null),n({id:b,neededScroll:!0}),setTimeout(()=>{n({id:b,neededScroll:!1})},100),l(null),x?setTimeout(()=>{l(s.id)},100):l(s.id)},onMouseEnter:R=>{R.stopPropagation(),s.neededScroll||n({id:b,neededScroll:!1})},onMouseLeave:R=>{R.stopPropagation(),s.neededScroll||n({id:null,neededScroll:!1})},className:e.clx(ce.block),children:[(s.id===b||x===b)&&e.jsxRuntimeExports.jsx("div",{className:ce.active}),(s.id===b||x===b)&&e.jsxRuntimeExports.jsx("div",{className:ce.name,children:fe(i[d[c].path].data[b].name,r)}),(s.id===b||x===b)&&fe(i[d[c].path].data[b].name,r)!=="unknown name"&&e.jsxRuntimeExports.jsx(on,{}),(s.id===b||x===b)&&fe(i[d[c].path].data[b].name,r)!=="unknown name"&&e.jsxRuntimeExports.jsx("div",{className:ce.addSection,children:e.jsxRuntimeExports.jsx(e.Button,{onClick:R=>{R.stopPropagation(),g(b,!0),l(null),n({id:null,neededScroll:!1}),_(null),w("/admin/builder/add")},children:"Add Section"})}),(s.id===b||x===b)&&fe(i[d[c].path].data[b].name,r)!=="unknown name"&&e.jsxRuntimeExports.jsx("div",{className:e.clx(ce.addSection,ce.addSectionTop),children:e.jsxRuntimeExports.jsx(e.Button,{onClick:R=>{R.stopPropagation(),g(b,!1),l(null),n({id:null,neededScroll:!1}),_(null),w("/admin/builder/add")},children:"Add Section"})}),a&&e.jsxRuntimeExports.jsx(at,{render:E,block:i[d[c].path].data[b]})]},b))}),e.jsxRuntimeExports.jsx(De,{})]})}),rn="_results_1pahy_1",jt={results:rn};function an(t,n){return n?new n[t]().blockSettings.isAddable:!1}function ln(t,n){return t?Object.keys(t||{}).reduce((s,o)=>(an(o,n)&&s.push(o),s),[]):[]}const cn="_product_yggw5_1",un="_name_yggw5_15",St={product:cn,name:un},dn=t=>{const{blockId:n,setSearchValue:s}=t,{sourceBlocks:o,setActiveBlock:a}=e.useBlocksStore(),{hideModal:r,hoverBlockId:i,isModalVisible:l,showPreview:x,hidePreview:g,clearHideTimeout:p,startHideTimeout:h,setHoverBlockTopPosition:c}=e.useSubmodalStore();function d(f){s(""),a(f),r("keyBlock")}function S(f,v){const _=window.innerHeight,u=400,C=10;let w=v.clientY-120;w+u>_&&(w=_-u-C),w<C&&(w=C),i||r("keyBlock"),x(f,"keyBlock"),p(),c(w)}function m(){l?h("keyBlock"):g("keyBlock"),c(null)}return e.jsxRuntimeExports.jsxs("div",{className:St.product,onClick:()=>d(n),onMouseEnter:f=>S(n,f),onMouseLeave:m,children:[Ee[n]?e.jsxRuntimeExports.jsx("img",{src:Ee[n]}):e.jsxRuntimeExports.jsx(e.Icon,{name:"Cards"}),e.jsxRuntimeExports.jsx("span",{className:St.name,children:fe(n,o)}),e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretRight",width:20,height:20})]},n)},Rt=()=>{const{blocks:t,sourceBlocks:n}=e.useBlocksStore(),[s,o]=j.useState(""),[a,r]=j.useState([]),i=j.useMemo(()=>ln(t,n),[t]),l=j.useMemo(()=>new e.Fuse(i,{keys:["name"],threshold:.4}),[i]);return j.useEffect(()=>{if(s.trim()==="")r(i);else{const x=l.search(s);r(x.map(g=>g.item))}},[s,l]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.Input,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:o,value:s,style:{marginBottom:10}}),e.jsxRuntimeExports.jsx("div",{className:jt.results,children:a.length>0?a.map(x=>e.jsxRuntimeExports.jsx(dn,{blockId:x,setSearchValue:o})):e.jsxRuntimeExports.jsx("div",{className:jt.noResults,children:"No sections found"})})]})},pn="_wrapper_1k1cr_1",xn="_submodal_1k1cr_14",it={wrapper:pn,submodal:xn},mn=({children:t,positionTop:n,positionLeft:s})=>{const{keyBlock:o,startHideTimeout:a,clearHideTimeout:r,setMouseOverModal:i}=e.useSubmodalStore();return o?e.jsxRuntimeExports.jsx("div",{className:it.wrapper,style:n?{top:n,left:s||void 0}:{},onMouseEnter:()=>{r(),i(!0)},onMouseLeave:()=>{i(!1),a()},children:t}):null},hn=({children:t})=>{const{hoverBlockId:n,startHideTimeout:s,clearHideTimeout:o,setMouseOverModal:a}=e.useSubmodalStore();return n?e.jsxRuntimeExports.jsx("div",{className:e.clx(it.wrapper,it.submodal),onMouseEnter:()=>{o(),a(!0)},onMouseLeave:()=>{a(!1),s()},children:t}):null},gn="_applyButton_1a9kh_2",jn="_content_1a9kh_7",Sn="_title_1a9kh_14",fn="_label_1a9kh_21",_n="_colorValue_1a9kh_40",vn="_colorMap_1a9kh_48",wn="_indicator_1a9kh_57",Cn="_hueSlider_1a9kh_66",bn="_slider_1a9kh_97",En="_buttons_1a9kh_102",kn="_name_1a9kh_109",Rn="_secondary_1a9kh_114",yn="_input_1a9kh_122",Tn="_modal_1a9kh_160",Ln="_alphaSlider_1a9kh_249",Nn="_alphaBackground_1a9kh_257",Bn="_alphaGradient_1a9kh_268",Pn="_chargeTypes_1a9kh_297",An="_charge_1a9kh_297",In="_chargeActive_1a9kh_326",$n="_gradient_1a9kh_334",Mn="_color_1a9kh_40",Fn="_colorActive_1a9kh_355",Hn="_gradientWrapper_1a9kh_362",Dn="_subtitle_1a9kh_368",On="_colorTypes_1a9kh_375",Un="_colorType_1a9kh_375",Vn="_colorTypeActive_1a9kh_399",zn="_colorsWrapper_1a9kh_404",Gn="_colors_1a9kh_404",L={applyButton:gn,content:jn,title:Sn,label:fn,colorValue:_n,colorMap:vn,indicator:wn,hueSlider:Cn,slider:bn,buttons:En,name:kn,secondary:Rn,input:yn,modal:Tn,alphaSlider:Ln,alphaBackground:Nn,alphaGradient:Bn,chargeTypes:Pn,charge:An,chargeActive:In,gradient:$n,color:Mn,colorActive:Fn,gradientWrapper:Hn,subtitle:Dn,colorTypes:On,colorType:Un,colorTypeActive:Vn,colorsWrapper:zn,colors:Gn},qn=()=>{const{modalPosition:t,color:n,initialColor:s,setShowModal:o,hue:a,saturation:r,brightness:i,alpha:l,dragging:x,setDragging:g,setHue:p,setSaturation:h,setBrightness:c,setAlpha:d,colorChange:S,setColor:m,update:f,isGradient:v,setIsGradient:_,gradientDirection:u,setGradientDirection:C,hue2:w,saturation2:E,brightness2:b,alpha2:R,setHue2:H,setSaturation2:A,setBrightness2:M,setAlpha2:V,activeColorIndex:T,setActiveColorIndex:Y,isGradientActive:ne}=e.useColorPickerStore(),F=(B,y,O)=>{y/=100,O/=100;const N=G=>(G+B/60)%6,I=G=>O*(1-y*Math.max(0,Math.min(N(G),4-N(G),1))),P=Math.round(255*I(5)),D=Math.round(255*I(3)),U=Math.round(255*I(1));return{r:P,g:D,b:U}},J=B=>B.toString(16).padStart(2,"0"),Z=(B,y,O,N)=>{const{r:I,g:P,b:D}=F(B,y,O),U=Math.round(N/100*255);return`#${J(I)}${J(P)}${J(D)}${J(U)}`},$=(B,y,O,N)=>{if(v)if(T===1){p(B),h(y),c(O),d(N);const I=Z(B,y,O,N),P=Z(w,E,b,R),U=`linear-gradient(${u==="vertical"?"0deg":"90deg"}, ${I} 0%, ${P} 100%)`;S(U),m(U)}else{H(B),A(y),M(O),V(N);const I=Z(B,y,O,N),P=Z(a,r,i,l),U=`linear-gradient(${u==="vertical"?"0deg":"90deg"}, ${P} 0%, ${I} 100%)`;S(U),m(U)}else{const I=Z(B,y,O,N);S(I),m(I)}},q=(B,y,O)=>{const{width:N,height:I}=O.getBoundingClientRect(),P=Math.max(0,Math.min(B/N*100,100)),D=Math.max(0,Math.min(100-y/I*100,100));v?T===1?(h(P),c(D),$(a,P,D,l)):(A(P),M(D),$(w,P,D,R)):(h(P),c(D),$(a,P,D,l))},ae=B=>{const{offsetX:y,offsetY:O}=B.nativeEvent;g(!0),q(y,O,B.currentTarget)},Ve=B=>{if(x){const y=document.querySelector(`.${L.colorMap}`),{left:O,top:N}=y.getBoundingClientRect(),I=B.clientX-O,P=B.clientY-N;q(I,P,y)}},ye=()=>{g(!1)};j.useEffect(()=>{function B(N){const I=/linear-gradient\((\d+deg),\s*(#[0-9a-fA-F]{8})\s*0%,\s*(#[0-9a-fA-F]{8})\s*100%\)/,P=N.match(I);if(P){const D=P[1],U=P[2],G=P[3];return{angle:D,col1:U,col2:G}}return null}function y(N){const I=parseInt(N.slice(1,3),16),P=parseInt(N.slice(3,5),16),D=parseInt(N.slice(5,7),16),U=parseInt(N.slice(7,9),16)/255*100,{h:G,s:he,b:Ge}=O(I,P,D);return{h:G,s:he,b:Ge,a:U}}function O(N,I,P){N/=255,I/=255,P/=255;const D=Math.max(N,I,P),U=Math.min(N,I,P);let G=0;const he=D-U,Ge=(D===0?0:he/D)*100,Nt=D*100;if(D===U)G=0;else switch(D){case N:G=((I-P)/he+(I<P?6:0))*60;break;case I:G=((P-N)/he+2)*60;break;case P:G=((N-I)/he+4)*60;break}return{h:G,s:Ge,b:Nt}}if(s&&s.startsWith("linear-gradient")){const N=B(s);if(N){const{angle:I,col1:P,col2:D}=N,U=y(P),G=y(D);_(!0),C(I==="0deg"?"vertical":"horizontal"),p(U.h),h(U.s),c(U.b),d(U.a),H(G.h),A(G.s),M(G.b),V(G.a),Y(1)}}else if(s){const I=function(D){let U=D;return U.length===7&&(U=U+"ff"),U}(s),P=y(I);_(!1),p(P.h),h(P.s),c(P.b),d(P.a)}},[s,_,C,p,h,c,d,H,A,M,V,Y]),j.useEffect(()=>{let B,y,O,N;v?T===1?(B=a,y=r,O=i,N=l):(B=w,y=E,O=b,N=R):(B=a,y=r,O=i,N=l),$(B,y,O,N)},[v,u,T,a,r,i,l,w,E,b,R]),j.useEffect(()=>{const B=O=>Ve(O),y=()=>ye();return x?(document.addEventListener("mousemove",B),document.addEventListener("mouseup",y)):(document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",y)),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",y)}},[x,v,u]);function ze(){if(!v)f(n);else{const B=Z(a,r,i,l),y=Z(w,E,b,R),N=`linear-gradient(${u==="vertical"?"0deg":"90deg"}, ${B} 0%, ${y} 100%)`;f(N)}o(!1)}function z(){o(!1),S(s)}const me=v?T===1?a:w:a,lt=v?T===1?r:E:r,ct=v?T===1?i:b:i,Tt=v?T===1?l:R:l,{r:ut,g:dt,b:pt}=F(me,lt,ct),Lt=`linear-gradient(to right, rgba(${ut}, ${dt}, ${pt}, 0), rgba(${ut}, ${dt}, ${pt}, 1))`,xt=Z(a,r,i,l),mt=Z(w,E,b,R);return e.jsxRuntimeExports.jsxs("div",{className:L.modal,onClick:B=>B.stopPropagation(),style:{top:`${t.top}px`,left:`${t.left}px`},children:[e.jsxRuntimeExports.jsx("h2",{className:L.title,children:"Color"}),ne&&e.jsxRuntimeExports.jsxs("div",{className:L.colorTypes,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(L.colorType,{[L.colorTypeActive]:!v}),onClick:()=>_(!1),children:[e.jsxRuntimeExports.jsx("div",{style:{background:"#757575",width:"16px",height:"16px",borderRadius:"50%"}}),"Solid"]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(L.colorType,{[L.colorTypeActive]:v}),onClick:()=>_(!0),children:[e.jsxRuntimeExports.jsx("div",{style:{background:"linear-gradient(to bottom, #757575 0%, #DBDBDB 100%)",width:"16px",height:"16px",borderRadius:"50%"}}),"Linear"]})]}),v&&ne&&e.jsxRuntimeExports.jsxs("div",{className:L.colorsWrapper,children:[e.jsxRuntimeExports.jsx("div",{className:L.colors,style:{background:`linear-gradient(90deg, ${xt} 0%, ${mt} 100%)`}}),e.jsxRuntimeExports.jsx("div",{className:e.clx(L.color,{[L.colorActive]:T===1}),onClick:()=>Y(1),style:{background:xt}}),e.jsxRuntimeExports.jsx("div",{className:e.clx(L.color,{[L.colorActive]:T===2}),onClick:()=>Y(2),style:{background:mt}})]}),e.jsxRuntimeExports.jsx("div",{className:L.colorMap,onMouseDown:ae,style:{background:`
|
|
88
88
|
linear-gradient(to top, black, transparent),
|
|
89
89
|
linear-gradient(to right, hsl(${me}, 100%, 100%), hsl(${me}, 100%, 50%))
|
|
90
|
-
`},children:e.jsxRuntimeExports.jsx("div",{className:T.indicator,style:{position:"absolute",left:`${lt}%`,top:`${100-ct}%`,transform:"translate(-50%, -50%)"}})}),e.jsxRuntimeExports.jsx("div",{className:T.hueSlider,style:{bottom:v?"175px":"100px"},children:e.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"360",value:me,onChange:N=>{const y=Number(N.target.value);v?$===1?I(y,r,i,l):I(y,E,b,R):(p(y),I(y,r,i,l))},className:T.slider})}),e.jsxRuntimeExports.jsxs("div",{className:T.alphaSlider,style:{bottom:v?"150px":"75px"},children:[e.jsxRuntimeExports.jsx("div",{className:T.alphaBackground}),e.jsxRuntimeExports.jsx("div",{className:T.alphaGradient,style:{background:Lt}}),e.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"100",value:Tt,onChange:N=>{const y=Number(N.target.value);v?$===1?I(a,r,i,y):I(w,E,b,y):(d(y),I(a,r,i,y))},className:T.slider})]}),v&&ne&&e.jsxRuntimeExports.jsxs("div",{className:T.gradientWrapper,children:[e.jsxRuntimeExports.jsx("h3",{className:T.subtitle,children:"Rotation"}),e.jsxRuntimeExports.jsx("div",{className:T.gradient,children:e.jsxRuntimeExports.jsxs("div",{className:T.chargeTypes,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(T.charge,{[T.chargeActive]:u==="horizontal"}),onClick:()=>C("horizontal"),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowsHorizontal",width:20,height:20}),"Horizontal"]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(T.charge,{[T.chargeActive]:u==="vertical"}),onClick:()=>C("vertical"),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowsVertical",width:20,height:20}),"Vertical"]})]})})]}),e.jsxRuntimeExports.jsxs("div",{className:T.buttons,children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:z,className:e.clx(T.applyButton,T.cancelButton),type:"Secondary",children:"Cancel"}),e.jsxRuntimeExports.jsx(e.Button,{onClick:ze,className:T.applyButton,children:"Apply"})]})]})},Wn=()=>{const{onPreview:t,zoomLevel:n}=e.usePreviewStore(),{keyBlock:s,hoverBlockId:o,isModalVisible:a,hoverBlockTopPosition:r}=e.useSubmodalStore(),{settings:i}=e.useSettingsStore(),{sourceBlocks:l}=e.useBlocksStore(),{pageContext:x}=e.usePagesStore(),{showModal:g}=e.useColorPickerStore(),{currentDevice:p}=e.useDeviceStore(),{isLoadingThemeSettings:h}=e.useThemeSettingsStore(),{isLoadingLayers:c}=e.useLayersStore(),d=u=>u?!l||!l[u]?e.jsxRuntimeExports.jsx(_e,{error:`Block "${u}" does not exist in blocks.`}):new l[u]().renderPreview(i,x):e.jsxRuntimeExports.jsx(_e,{error:"Block or block.name is undefined."});function S(){if(p.value==="desktop")return n>=1?"100%":`${(n*100).toFixed(2)}%`;{const u=p.value==="tablet"?768:425;return n>=1?`${u}px`:`${(u*n).toFixed(2)}px`}}function m(){switch(p.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:f}=e.usePagesStore(),v=j.useRef(null),_=u=>{v.current&&(v.current.scrollTop+=u.deltaY)};return e.jsxRuntimeExports.jsxs("div",{className:Be.preview,style:{zIndex:g&&!f?5e3:500},onWheel:u=>{u.stopPropagation(),console.log("onWheel"),_(u)},children:[a&&e.jsxRuntimeExports.jsx(hn,{children:e.jsxRuntimeExports.jsx(Rt,{})}),e.jsxRuntimeExports.jsxs(mn,{positionTop:r,positionLeft:!o&&s?void 0:250,children:[!h&&!c&&e.jsxRuntimeExports.jsx(at,{render:d,block:s}),h&&e.jsxRuntimeExports.jsx(e.Loader,{})]}),g&&e.jsxRuntimeExports.jsx(qn,{}),t&&e.jsxRuntimeExports.jsxs("div",{className:Be.main,style:{width:m()},children:[e.jsxRuntimeExports.jsx(Mo,{}),e.jsxRuntimeExports.jsx("div",{style:{borderLeft:S()==="100%"?"none":"var(--default-border)",borderRight:S()==="100%"?"none":"var(--default-border)",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 160px)",overflowY:"scroll",overflowX:"hidden"},onScroll:u=>{u.stopPropagation()},onWheel:u=>{u.stopPropagation()},children:!h&&!c?e.jsxRuntimeExports.jsx("div",{className:Be.content,style:{width:S()},children:e.jsxRuntimeExports.jsx(nn,{scrollableRef:v})}):e.jsxRuntimeExports.jsx("div",{className:Be.loading,children:e.jsxRuntimeExports.jsx(e.Loader,{})})})]})]})},Zn="_sidebar_1xtkj_1",Xn="_title_1xtkj_11",Yn="_active_1xtkj_19",ft={sidebar:Zn,title:Xn,active:Yn},Kn="_layers_1jhzw_1",Jn="_wrapper_1jhzw_9",Qn="_draggingWrapper_1jhzw_17",er="_block_1jhzw_21",tr="_dragging_1jhzw_17",sr="_active_1jhzw_56",or="_add_1jhzw_63",nr="_addTop_1jhzw_79",rr="_visible_1jhzw_95",ir="_button_1jhzw_99",ar="_empty_1jhzw_114",lr="_title_1jhzw_126",cr="_icon_1jhzw_133",ur="_blockIcon_1jhzw_137",dr="_text_1jhzw_147",pr="_highlight_1jhzw_153",xr="_nameBlock_1jhzw_158",mr="_loader_1jhzw_162",hr="_actions_1jhzw_171",gr="_deleteButton_1jhzw_179",W={layers:Kn,wrapper:Jn,draggingWrapper:Qn,block:er,dragging:tr,active:sr,add:or,addTop:nr,visible:rr,button:ir,empty:ar,title:lr,icon:cr,blockIcon:ur,text:dr,highlight:pr,nameBlock:xr,loader:mr,actions:hr,deleteButton:gr},jr="_block_sj4cc_1",Sr="_title_sj4cc_17",fr="_actions_sj4cc_21",_r="_deleteButton_sj4cc_28",ue={block:jr,title:Sr,actions:fr,deleteButton:_r},Ke={header:"Header",footer:"Footer",announcement:"Announcement"},Je=({id:t})=>{const{setCurrentBlock:n}=e.useLayersStore(),{activeBlock:s}=e.usePreviewStore(),[o,a]=j.useState(!1);function r(i){n(i)}return e.jsxRuntimeExports.jsxs("div",{className:e.clx(ue.block,{[ue.active]:s.id===t,[ue.header]:t==="header",[ue.footer]:t==="footer",[ue.announcement]:t==="announcement"}),onClick:()=>r(t),onMouseOver:()=>a(!0),onMouseLeave:()=>a(!1),children:[Ee[Ke[t]]?e.jsxRuntimeExports.jsx("img",{src:Ee[Ke[t]],width:20,height:20}):e.jsxRuntimeExports.jsx(e.Icon,{name:"Cards",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:ue.title,children:Ke[t]}),e.jsxRuntimeExports.jsx("div",{className:ue.actions,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"#757575"})})]})},vr=({id:t,name:n,onClick:s,isDragging:o,icon:a})=>{const{activeBlock:r,setActiveBlock:i}=e.usePreviewStore(),{showPreview:l,hidePreview:x,showModal:g,hideModal:p,clearHideTimeout:h,startHideTimeout:c,hoverBlockId:d,isModalVisible:S}=e.useSubmodalStore(),{setPositionBlock:m}=e.useLayersStore(),[f,v]=j.useState(!1),[_,u]=j.useState(!1),[C,w]=j.useState(!1),[E,b]=j.useState(!1),[R,F]=j.useState(null),{attributes:P,listeners:H,setNodeRef:V,transform:$,transition:Y}=e.useSortable({id:t}),ne={transform:e.CSS.Transform.toString($),transition:Y},{setTitle:M,setDescription:J,setOnConfirm:Z}=e.useConfirmationModalStore(),{pages:I,currentPage:q}=e.usePagesStore(),{removeBlock:ae}=e.useLayersStore(),Ve=z=>{z.stopPropagation(),i({id:t,neededScroll:!0}),S&&p(),l(t),h()},ye=(z,me=!0)=>{z.stopPropagation(),x(),g(t),h(),m(t,me)},ze=z=>{z.stopPropagation(),i({id:null,neededScroll:!1}),S?c():x()};return j.useEffect(()=>{w(!1),v(!1),u(!1),b(!1)},[o]),j.useEffect(()=>{S||(u(!1),v(!1))},[S]),e.jsxRuntimeExports.jsxs("div",{ref:V,style:ne,className:e.clx(W.wrapper,{[W.draggingWrapper]:o&&r.id===t}),onClick:z=>{z.stopPropagation(),s(t)},onMouseEnter:Ve,onMouseLeave:ze,...P,...H,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(W.block,{[W.dragging]:o&&r.id===t,[W.active]:!o&&r.id===t}),children:[a?e.jsxRuntimeExports.jsx("img",{src:a,width:20,height:20}):e.jsxRuntimeExports.jsx(e.Icon,{name:"Cards",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:W.nameBlock,children:n}),d===t&&!o&&e.jsxRuntimeExports.jsx("div",{className:e.clx(W.addTop,{[W.visible]:_}),onMouseEnter:()=>{u(!0)},onMouseLeave:()=>{u(!1)},children:e.jsxRuntimeExports.jsxs("button",{className:W.button,onClick:z=>ye(z,!1),onMouseEnter:()=>{const z=setTimeout(()=>{o||b(!0)},200);F(z)},onMouseLeave:()=>{R&&clearTimeout(R),b(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Plus",fill:"#fff"}),E&&e.jsxRuntimeExports.jsx(ve,{text:"Click to add a section"})]})}),d===t&&!o&&e.jsxRuntimeExports.jsx("div",{className:e.clx(W.add,{[W.visible]:f}),onMouseEnter:()=>{v(!0)},onMouseLeave:()=>{v(!1)},children:e.jsxRuntimeExports.jsxs("button",{className:W.button,onClick:z=>ye(z),onMouseEnter:()=>{const z=setTimeout(()=>{o||w(!0)},200);F(z)},onMouseLeave:()=>{R&&clearTimeout(R),w(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Plus",fill:"#fff"}),C&&e.jsxRuntimeExports.jsx(ve,{text:"Click to add a section"})]})})]}),d===t&&!o&&e.jsxRuntimeExports.jsxs("div",{className:W.actions,children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),e.jsxRuntimeExports.jsx("div",{className:W.deleteButton,onClick:z=>{z.stopPropagation(),M("Remove Block"),J(`Are you sure you want to delete ${n||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),Z(()=>{I&&ae(I[q].path,t)})},children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},wr=()=>{const{blocks:t,setCurrentBlock:n,moveBlock:s,isLoadingLayers:o,announcement:a}=e.useLayersStore(),{currentPage:r,pages:i}=e.usePagesStore(),{setMouseOverModal:l,setHoverBlockId:x}=e.useSubmodalStore(),{sourceBlocks:g}=e.useBlocksStore();function p(f){n(f),l(!1),x(null)}const h=e.useSensors(e.useSensor(e.PointerSensor,{activationConstraint:{distance:5}})),[c,d]=j.useState(!1),S=()=>{d(!0)},m=f=>{d(!1);const{active:v,over:_}=f;if(_&&v.id!==_.id&&i&&i[r]){const u=i[r].path,C=t[u].order,w=C.indexOf(v.id),E=C.indexOf(_.id);w!==-1&&E!==-1&&s(u,w,E)}};return e.jsxRuntimeExports.jsx("div",{className:W.layers,children:o?e.jsxRuntimeExports.jsx("div",{className:W.loader,children:e.jsxRuntimeExports.jsx(e.Loader,{})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[a&&e.jsxRuntimeExports.jsx(Je,{id:"announcement"}),e.jsxRuntimeExports.jsx(Je,{id:"header"}),e.jsxRuntimeExports.jsx(e.DndContext,{sensors:h,onDragEnd:m,onDragStart:S,children:i&&i[r]&&t[i[r].path]&&e.jsxRuntimeExports.jsx(e.SortableContext,{items:t[i[r].path].order,strategy:e.verticalListSortingStrategy,children:t[i[r].path].order.map((f,v)=>e.jsxRuntimeExports.jsx(vr,{id:f,name:fe(t[i[r].path].data[f].name,g),index:v,onClick:p,isDragging:c,icon:Ee[t[i[r].path].data[f].name]},f))})}),e.jsxRuntimeExports.jsx(Je,{id:"footer"})]})})},Cr=({isHeader:t})=>{const{header:n,footer:s}=e.useLayersStore(),{pageContext:o}=e.usePagesStore();return t?n==null?void 0:n.renderSettings(o):s==null?void 0:s.renderSettings(o)},br=()=>{const{announcement:t}=e.useLayersStore(),{pageContext:n}=e.usePagesStore();return t==null?void 0:t.renderSettings(n)},Er="_loader_eyvkk_1",kr={loader:Er},Rr=()=>{const{isLoadingSettings:t}=e.useSettingsStore();return t?e.jsxRuntimeExports.jsx("div",{className:kr.loader,children:e.jsxRuntimeExports.jsx(e.Loader,{})}):e.jsxRuntimeExports.jsx(yr,{})},yr=()=>{const{settings:t}=e.useSettingsStore(),{setError:n}=e.useErrorStore();try{return t==null?void 0:t.renderSettings()}catch(s){throw console.error("Error rendering settings:",s),n({message:"Error rendering settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),s}},Tr="_theme_a1one_1",Lr="_block_a1one_8",Nr="_name_a1one_23",Br="_loader_a1one_27",Pe={theme:Tr,block:Lr,name:Nr,loader:Br},Pr=()=>{const t=e.useNavigate(),{isLoadingThemeSettings:n}=e.useThemeSettingsStore();function s(o){switch(o==null?void 0:o.name){case"Colors":t("/admin/builder/theme/colors");break;case"Fonts":t("/admin/builder/theme/fonts");break;case"Borders":t("/admin/builder/theme/borders");break;case"Buttons":t("/admin/builder/theme/buttons");break;case"Inputs":t("/admin/builder/theme/inputs");break}}return e.jsxRuntimeExports.jsx("div",{className:Pe.theme,children:n?e.jsxRuntimeExports.jsx("div",{className:Pe.loader,children:e.jsxRuntimeExports.jsx(e.Loader,{})}):Se.map(o=>e.jsxRuntimeExports.jsxs("div",{onClick:()=>s(o),className:e.clx(Pe.block),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:o.icon}),e.jsxRuntimeExports.jsx("span",{className:Pe.name,children:o.name}),e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretRight"})]},o.icon))})},Ar="_back_7e826_1",Ir="_render_7e826_9",$r="_open_7e826_24",Mr="_close_7e826_51",Fr="_clicked_7e826_55",Hr="_title_7e826_59",Dr="_button_7e826_67",Or="_loading_7e826_72",Ur="_settings_7e826_76",Vr="_deleteButton_7e826_82",zr="_backIcon_7e826_95",je={back:Ar,render:Ir,open:$r,close:Mr,clicked:Fr,title:Hr,button:Dr,loading:Or,settings:Ur,deleteButton:Vr,backIcon:zr},Gr=({block:t})=>{const{pageContext:n}=e.usePagesStore(),{setError:s}=e.useErrorStore();try{return t.renderSettings(n)}catch(o){throw console.error("Error rendering settings:",o),s({message:"Error rendering block settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),o}},qr="_wrapper_15ju8_1",Wr="_header_15ju8_8",Zr="_title_15ju8_15",Xr="_colorWrapper_15ju8_21",Yr="_name_15ju8_35",Kr="_color_15ju8_21",Jr="_value_15ju8_47",Qr="_length_15ju8_51",K={wrapper:qr,header:Wr,title:Zr,colorWrapper:Xr,name:Yr,color:Kr,value:Jr,length:Qr},Qe=t=>{const{colors:n}=t,{themeSettings:s}=e.useThemeSettingsStore(),[o,a]=j.useState(!0);j.useEffect(()=>{n.length<=3&&a(!0)},[]);function r(i){const l=i.replace("--",""),[x,g]=l.split("-"),p=`${g.charAt(0).toUpperCase()+g.slice(1)} ${x.charAt(0).toUpperCase()+x.slice(1)}`,[h,c]=l.split("-");return{name:p,field:h,variable:c}}return e.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[e.jsxRuntimeExports.jsxs("div",{className:K.header,children:[e.jsxRuntimeExports.jsx("div",{className:K.title,children:"Section Colors"}),!o&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(K.value,K.length),onClick:()=>a(!0),children:["+",n.length]})]}),o&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:K.colors,children:n.map(i=>{const l=r(i),{variable:x,name:g,field:p}=l;return e.jsxRuntimeExports.jsx(ei,{color:s.colors[p][x],name:g})})}),n.length>3&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(K.value,K.length),onClick:()=>a(!1),children:["Hide ",n.length," colors"]})]})]})},ei=t=>{const{name:n,color:s}=t,{setActiveLabel:o,setModalPosition:a,setInitialColor:r,setShowModal:i,setUpdate:l,setColor:x,setColorChange:g,colorChange:p,setIsGradientActive:h}=e.useColorPickerStore(),{updateColor:c}=e.useThemeSettingsStore(),d=(f,v)=>_=>{c(f,v,_)};j.useEffect(()=>{const f=()=>{i(!1),o(null),r(s),l(()=>{}),x(s),g(()=>{})};return document.body.addEventListener("click",f),()=>{document.body.removeEventListener("click",f)}},[]);const S=f=>{const v=n.split("/")[0],_=v.split(" ")[0].toLowerCase(),u=v.split(" ")[1].toLowerCase();f.stopPropagation(),i(!0),g(p),l(E=>d(u,_)(E)),r(s),x(s),h(u==="surface");const{top:C,left:w}=kt(f,550,288,10,20,230,80);a({top:u==="surface"?C:C+125,left:w-200})};function m(f){return f.length>15?f.slice(0,15)+"...":f}return e.jsxRuntimeExports.jsxs("div",{className:K.colorWrapper,onClick:S,children:[e.jsxRuntimeExports.jsx("div",{className:K.color,style:{background:s}}),e.jsxRuntimeExports.jsx("div",{className:K.name,children:n}),e.jsxRuntimeExports.jsx("div",{className:K.value,children:m(s)})]})},ti="_back_1sznl_1",si="_title_1sznl_9",oi="_deleteButton_1sznl_17",ni="_backIcon_1sznl_30",Ae={back:ti,title:si,deleteButton:oi,backIcon:ni},ri=({onClick:t,setIsClicked:n,getDisplayName:s})=>{var c,d;const{activeBlock:o}=e.useBlocksStore(),{setTitle:a,setDescription:r,setOnConfirm:i}=e.useConfirmationModalStore(),{blocks:l,currentBlock:x,removeBlock:g}=e.useLayersStore(),{currentPage:p,pages:h}=e.usePagesStore();return e.jsxRuntimeExports.jsxs("div",{className:Ae.back,children:[e.jsxRuntimeExports.jsx("div",{className:Ae.backIcon,onClick:()=>t(),children:e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),e.jsxRuntimeExports.jsx("h3",{className:Ae.title,children:o&&s(o)||h&&h[p]&&l[h[p].path]&&x&&s((c=l[h[p].path].data[x])==null?void 0:c.name)||x&&oe(x)||"Loading"}),x&&h&&!["header","footer","announcement"].includes(x)&&l[h[p].path].data[x]&&s((d=l[h[p].path].data[x])==null?void 0:d.name)!=="unknown name"&&e.jsxRuntimeExports.jsx("button",{onClick:S=>{var m;S.stopPropagation(),a("Remove Block"),r(`Are you sure you want to delete ${s((m=l[h[p].path].data[x])==null?void 0:m.name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),i(()=>{n(!0),g(h[p].path,x),t(!0)})},className:Ae.deleteButton,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},ii=()=>{const t=e.useNavigate(),[n,s]=j.useState(!1),{sourceBlocks:o,activeBlock:a,setActiveBlock:r,currentInstance:i,setCurrentInstance:l}=e.useBlocksStore(),{setActiveBlock:x}=e.usePreviewStore(),{blocks:g,addBlock:p,editBlock:h,currentBlock:c,setCurrentBlock:d,setHeader:S,setFooter:m,setAnnouncement:f,header:v,footer:_,announcement:u,isLoadingLayers:C}=e.useLayersStore(),{currentPage:w,pages:E}=e.usePagesStore();function b(P=!1){if(E&&i&&!P){const H={blockSettings:{}};Object.keys(i.blockSettings).filter(V=>!["displayName","isAddable"].includes(V)).map(V=>{H.blockSettings[V]=i.blockSettings[V]}),h(E[w].path,c,{name:g[E[w].path].data[c].name,value:H})}r(null),d(null),x({id:null,neededScroll:!1}),setTimeout(()=>{s(!1)},150),l(null)}function R(){var V;if(!E||!E[w]||!c)return null;const P=g[E[w].path].data[c];return!P||!o[P.name]?null:new o[P.name]((V=P.value)==null?void 0:V.blockSettings)}j.useEffect(()=>{if(a||c&&!["header","footer","announcement"].includes(c)){const P=R();l(P)}else l(null)},[a,c]),j.useEffect(()=>{if(a&&E&&!c){const P={blockSettings:{},blockColors:{}},H=new o[a];l(H),Object.keys(H.blockSettings).filter($=>!["displayName","isAddable"].includes($)).map($=>{P.blockSettings[$]=H.blockSettings[$]}),Object.keys(H.blockColors).filter($=>!["displayName","isAddable"].includes($)).map($=>{P.blockColors[$]=H.blockColors[$]});const V=p(E[w].path,{name:a,value:P});x({id:V,neededScroll:!0}),d(V),t("/admin/builder")}},[a]),j.useEffect(()=>{c==="header"&&S(v)},[c,v]),j.useEffect(()=>{c==="footer"&&m(_)},[c,_]),j.useEffect(()=>{c==="announcement"&&f(u)},[c,u]);function F(P){if(!o)return"unknown name";if(!o[P])return c==="header"?v==null?void 0:v.blockSettings.displayName:c==="footer"?_==null?void 0:_.blockSettings.displayName:c==="announcement"?u==null?void 0:u.blockSettings.displayName:"unknown name";const H=new o[P];return!H.blockSettings||!H.blockSettings.displayName?"unknown name":H.blockSettings.displayName}return e.jsxRuntimeExports.jsxs("div",{className:e.clx(je.render,{[je.open]:c,[je.close]:!c,[je.clicked]:n}),onClick:P=>P.stopPropagation(),style:{opacity:C?0:1},children:[e.jsxRuntimeExports.jsx(ri,{onClick:b,setIsClicked:s,getDisplayName:F}),e.jsxRuntimeExports.jsxs("div",{className:je.settings,children:[i&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Gr,{block:i}),e.jsxRuntimeExports.jsx(Qe,{colors:i.blockColors})]}),c&&["header","footer"].includes(c)&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Cr,{isHeader:c==="header"}),e.jsxRuntimeExports.jsx(Qe,{colors:c==="header"?v.blockColors:_.blockColors})]}),c==="announcement"&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(br,{}),e.jsxRuntimeExports.jsx(Qe,{colors:u.blockColors})]}),!a&&!c&&e.jsxRuntimeExports.jsx("div",{className:je.loading,children:"Loading"})]})]})},ai="_header_9rrfr_1",li="_title_9rrfr_9",ci="_backIcon_9rrfr_15",et={header:ai,title:li,backIcon:ci},ke=({onClick:t,title:n})=>e.jsxRuntimeExports.jsxs("div",{className:et.header,children:[e.jsxRuntimeExports.jsx("div",{className:et.backIcon,onClick:t,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),e.jsxRuntimeExports.jsx("span",{className:et.title,children:n})]}),ui="_options_ymds7_1",di={options:ui},pi="_wrapper_kzokw_1",xi="_open_kzokw_16",mi="_close_kzokw_20",tt={wrapper:pi,open:xi,close:mi},Re=t=>{const{isOpen:n,isClose:s,children:o}=t;return e.jsxRuntimeExports.jsx("div",{className:e.clx(tt.wrapper,{[tt.open]:n,[tt.close]:s}),children:o})},hi=()=>{var g,p;const{activeBlock:t,themeSettings:n,updateBorder:s,setActiveBlock:o}=e.useThemeSettingsStore();function a(h,c){s(c,h)}const r=e.useNavigate();function i(){o(null),r("/admin/builder/theme")}const l=j.useMemo(()=>n.borders,[n]),x=(t==null?void 0:t.name)==="Borders";return e.jsxRuntimeExports.jsxs(Re,{isOpen:x,isClose:!x,children:[e.jsxRuntimeExports.jsx(ke,{onClick:i,title:"Borders Style"}),e.jsxRuntimeExports.jsxs("div",{className:di.options,children:[e.jsxRuntimeExports.jsx(e.Select,{label:"Border Radius (px)",options:Object.keys(qe),value:((g=Object.entries(qe).find(([h,c])=>c===l.radius))==null?void 0:g[0])||"None",onChange:h=>a(qe[h],"radius")}),e.jsxRuntimeExports.jsx(e.Select,{label:"Border Thickness (px)",options:Object.keys(We),value:((p=Object.entries(We).find(([h,c])=>c===l.thickness))==null?void 0:p[0])||"None",onChange:h=>a(We[h],"thickness")})]})]})},gi="_options_jo38w_1",ji="_alignments_jo38w_9",Si="_blocks_jo38w_15",fi="_alignment_jo38w_9",_i="_active_jo38w_34",vi="_chargeTypes_jo38w_41",wi="_charge_jo38w_41",Ci="_chargeActive_jo38w_69",bi="_shadowsHeader_jo38w_77",Ei="_sliderContainer_jo38w_83",ki="_shadowInputs_jo38w_91",Ri="_label_jo38w_102",yi="_shadowInputsRow_jo38w_111",Ti="_shadowInputsOpen_jo38w_119",X={options:gi,alignments:ji,blocks:Si,alignment:fi,active:_i,chargeTypes:vi,charge:wi,chargeActive:Ci,shadowsHeader:bi,sliderContainer:Ei,shadowInputs:ki,label:Ri,shadowInputsRow:yi,shadowInputsOpen:Ti},xe=t=>{const{initialColor:n,onChange:s,title:o,labelStyle:a="primary",isGradientActive:r=!0}=t,[i,l]=j.useState(n);j.useEffect(()=>{l(n)},[n]);const{setActiveLabel:x,setModalPosition:g,setInitialColor:p,setShowModal:h,setUpdate:c,setColor:d,setColorChange:S,setIsGradientActive:m,colorChange:f}=e.useColorPickerStore();j.useEffect(()=>{const _=()=>{h(!1),x(null),p(n),c(()=>{}),d(n),S(()=>{})};return document.body.addEventListener("click",_),()=>{document.body.removeEventListener("click",_)}},[]);const v=_=>{_.stopPropagation(),h(!0),S(l),c(s),p(n),d(i),m(r);const{top:u,left:C}=kt(_,600,288,10,20,230,80);g({top:u,left:C})};return e.jsxRuntimeExports.jsxs("div",{className:T.content,children:[e.jsxRuntimeExports.jsx("span",{className:e.clx(T.name,{[T.secondary]:a==="secondary"}),children:o}),e.jsxRuntimeExports.jsxs("label",{className:T.label,onClick:_=>_.stopPropagation(),children:[e.jsxRuntimeExports.jsx("div",{className:T.colorValue,style:{background:i},onClick:v}),e.jsxRuntimeExports.jsx("input",{type:"text",value:i,onChange:_=>{const u=_.target.value;s(u),d(u),l(u),f(u)},className:T.input})]})]})},Li=["left","center","right"],Ni=()=>{const{activeBlock:t,themeSettings:n,updateButton:s,setActiveBlock:o}=e.useThemeSettingsStore(),{fonts:a}=e.useFontsStore(),[r,i]=j.useState("primary");function l(m,f){s(r,f,m)}const[x,g]=j.useState(!1),p=n.buttons[r],h=e.useNavigate();function c(){o(null),h("/admin/builder/theme")}const d=(t==null?void 0:t.name)==="Buttons";function S(m,f){l({...p.boxShadow,[m]:f},"boxShadow")}return e.jsxRuntimeExports.jsxs(Re,{isOpen:d,isClose:!d,children:[e.jsxRuntimeExports.jsx(ke,{onClick:c,title:"Buttons Style"}),e.jsxRuntimeExports.jsx("div",{className:X.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(m=>e.jsxRuntimeExports.jsx("div",{className:e.clx(X.charge,{[X.chargeActive]:r===m}),onClick:()=>i(m),children:m.charAt(0).toUpperCase()+m.slice(1)},m))}),p&&e.jsxRuntimeExports.jsxs("div",{className:X.options,children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Height (px)",value:String(p.height),onChange:m=>l(Number(m),"height"),type:"number",min:0}),e.jsxRuntimeExports.jsx(e.Select,{label:"Font Size (px)",value:String(p.size),onChange:m=>l(Number(m),"size"),options:Fe}),e.jsxRuntimeExports.jsx(e.Input,{label:"Border Radius (px)",value:String(p.radius),onChange:m=>l(Number(m),"radius"),type:"number",min:0}),e.jsxRuntimeExports.jsx(e.Select,{label:"Font",value:p.font,onChange:m=>l(m,"font"),options:[...a.filter(m=>m!==p.font)]}),e.jsxRuntimeExports.jsx(xe,{initialColor:p.background,onChange:m=>l(m,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),e.jsxRuntimeExports.jsxs("div",{className:X.sliderContainer,children:[e.jsxRuntimeExports.jsx("h4",{className:X.label,children:"Shadow"}),e.jsxRuntimeExports.jsx(e.Button,{type:"Secondary",onClick:()=>g(!x),style:{padding:5},children:e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretUp",style:{rotate:x?"0deg":"-180deg",transition:"0.3s rotate ease"}})})]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(X.shadowInputs,{[X.shadowInputsOpen]:x}),children:[e.jsxRuntimeExports.jsxs("div",{className:X.shadowInputsRow,children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Left (px)",value:String(p.boxShadow.left),onChange:m=>S("left",Number(m)),type:"number"}),e.jsxRuntimeExports.jsx(e.Input,{label:"Top (px)",value:String(p.boxShadow.top),onChange:m=>S("top",Number(m)),type:"number"}),e.jsxRuntimeExports.jsx(e.Input,{label:"Blur (px)",value:String(p.boxShadow.blur),onChange:m=>S("blur",Number(m)),type:"number"}),e.jsxRuntimeExports.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:e.jsxRuntimeExports.jsx(e.Input,{label:"Spread (px)",value:String(p.boxShadow.spread),onChange:m=>S("spread",Number(m)),type:"number"})})]}),e.jsxRuntimeExports.jsx(xe,{initialColor:p.boxShadow.color,onChange:m=>S("color",m),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),e.jsxRuntimeExports.jsxs("div",{className:X.alignments,children:[e.jsxRuntimeExports.jsx("h4",{className:X.label,children:"Alignment Type"}),e.jsxRuntimeExports.jsx("div",{className:X.blocks,children:Li.map(m=>e.jsxRuntimeExports.jsx("div",{className:e.clx(X.alignment,{[X.active]:p.alignment===m}),onClick:()=>{l(m,"alignment")},children:e.jsxRuntimeExports.jsx(e.Icon,{name:m==="center"?"AlignCenterHorizontal":m==="left"?"AlignLeft":"AlignRight",fill:p.alignment===m?"#252525":"#757575"})},m))})]}),e.jsxRuntimeExports.jsx(e.Switch,{label:"Enable Hover",onChange:m=>l(m,"hover"),current:p.hover})]})]})},Bi="_category_hxy9u_1",Pi="_categoryTitle_hxy9u_19",st={category:Bi,categoryTitle:Pi},Ai=()=>{const{themeSettings:t,setActiveColorCategory:n}=e.useThemeSettingsStore();function s(o){console.log(o),n(o)}return console.log(Object.keys(t.colors)),e.jsxRuntimeExports.jsx("div",{className:st.wrapper,children:Object.keys(t.colors).map(o=>o==="icon"?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsxs("div",{className:st.category,onClick:()=>s(o),children:[e.jsxRuntimeExports.jsxs("h2",{className:st.categoryTitle,children:[o==="text"?"Text & Icon":oe(o)," Colors"]}),e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretRight",width:24,height:24})]},o))})},Ii="_wrapper_ikvjo_1",$i="_open_ikvjo_16",Mi="_close_ikvjo_20",Fi="_header_ikvjo_24",Hi="_title_ikvjo_32",Di="_options_ikvjo_38",Oi="_clicked_ikvjo_45",Ui="_backIcon_ikvjo_49",Vi="_charge_ikvjo_59",zi="_chargeActive_ikvjo_78",Gi={wrapper:Ii,open:$i,close:Mi,header:Fi,title:Hi,options:Di,clicked:Oi,backIcon:Ui,charge:Vi,chargeActive:zi},qi=()=>{const{activeBlock:t,setActiveFont:n,activeFont:s,themeSettings:o,updateFont:a}=e.useThemeSettingsStore(),{fonts:r}=e.useFontsStore(),[i,l]=j.useState(null);function x(){n(null)}function g(d,S){i&&s&&a("desktop",i,s,S,d)}const p=j.useMemo(()=>s?o.fonts.desktop.heading[s]?(l("heading"),o.fonts.desktop.heading[s]):o.fonts.desktop.paragraph[s]?(l("paragraph"),o.fonts.desktop.paragraph[s]):(l(null),null):null,[s,o]),h=!!((t==null?void 0:t.name)==="Fonts"&&s),c=(t==null?void 0:t.name)!=="Fonts"||!s;return e.jsxRuntimeExports.jsxs(Re,{isOpen:h,isClose:c,children:[e.jsxRuntimeExports.jsx(ke,{onClick:x,title:"Font Style"}),s&&p&&e.jsxRuntimeExports.jsxs("div",{className:Gi.options,children:[e.jsxRuntimeExports.jsx(e.Select,{label:"Font",value:p.font,onChange:d=>g(d,"font"),options:[...r.filter(d=>d!==p.font)]}),e.jsxRuntimeExports.jsx(e.Select,{label:"Size",value:String(p.size),onChange:d=>g(d,"size"),options:Fe}),e.jsxRuntimeExports.jsx(e.Select,{label:"Weight",value:String(p.weight),onChange:d=>g(d,"weight"),options:Pt})]})]})},Wi="_wrapper_mkmxa_1",Zi="_category_mkmxa_5",Xi="_categoryTitle_mkmxa_11",Yi="_font_mkmxa_17",Ki="_content_mkmxa_32",Ji="_icon_mkmxa_39",Qi="_paragraph_mkmxa_50",ea="_deleteIcon_mkmxa_54",ta="_iconButton_mkmxa_61",le={wrapper:Wi,category:Zi,categoryTitle:Xi,font:Yi,content:Ki,icon:Ji,paragraph:Qi,deleteIcon:ea,iconButton:ta},sa=t=>{const{font:n,size:s,id:o,category:a}=t,{setActiveFont:r}=e.useThemeSettingsStore();return e.jsxRuntimeExports.jsxs("div",{className:le.font,onClick:()=>r(o),children:[e.jsxRuntimeExports.jsx("div",{className:e.clx(le.icon,{[le.paragraph]:a==="paragraph"}),children:e.jsxRuntimeExports.jsx(e.Icon,{name:a==="paragraph"?"TextB":"TextH"})}),e.jsxRuntimeExports.jsxs("div",{className:le.content,children:[e.jsxRuntimeExports.jsx("h2",{className:le.categoryTitle,children:oe(o)}),e.jsxRuntimeExports.jsx("span",{className:le.value,children:`${n}, ${s}px`})]})]})},oa=()=>{const{themeSettings:t,setActiveFont:n,activeBlock:s}=e.useThemeSettingsStore();j.useEffect(()=>(o(),()=>{o()}),[]);function o(){n(null)}if(s!=null&&s.name)return e.jsxRuntimeExports.jsx("div",{className:le.wrapper,children:Object.entries(t.fonts.desktop).map(([a,r])=>e.jsxRuntimeExports.jsxs("div",{className:le.category,children:[e.jsxRuntimeExports.jsx("h2",{className:le.categoryTitle,children:oe(a)}),Object.entries(r).map(([i,l])=>e.jsxRuntimeExports.jsx(sa,{id:i,category:a,...l},i))]},a))})},na="_wrapper_16ym0_2",ra="_category_16ym0_6",ia="_categoryTitle_16ym0_12",aa="_color_16ym0_18",la="_name_16ym0_24",ca="_content_16ym0_29",ua="_label_16ym0_36",da="_input_16ym0_48",pa="_title_16ym0_74",xa="_field_16ym0_82",ma="_alignments_16ym0_92",ha="_lineField_16ym0_98",ga="_style_16ym0_106",ja="_header_16ym0_113",se={wrapper:na,category:ra,categoryTitle:ia,color:aa,name:la,content:ca,label:ua,input:da,title:pa,field:xa,alignments:ma,lineField:ha,style:ga,header:ja},Sa="_blocks_emecf_1",fa="_block_emecf_1",_a="_active_emecf_21",ot={blocks:Sa,block:fa,active:_a},_t=t=>{const{items:n,selectedItem:s,onSelect:o,getIconName:a}=t;return e.jsxRuntimeExports.jsx("div",{className:ot.blocks,children:n.map(r=>e.jsxRuntimeExports.jsx("div",{className:e.clx(ot.block,{[ot.active]:s===r}),onClick:()=>o(r),children:e.jsxRuntimeExports.jsx(e.Icon,{name:a(r),fill:s===r?"#252525":"#757575"})},String(r)))})},va=["left","center","right"],wa=["solid","dashed"],Ie=t=>{const{title:n,children:s,rightAddon:o}=t;return e.jsxRuntimeExports.jsxs("div",{className:se.field,children:[e.jsxRuntimeExports.jsxs("div",{className:se.header,children:[e.jsxRuntimeExports.jsx("h4",{className:se.categoryTitle,children:n}),o]}),s]})},Ca=()=>{const{themeSettings:t,updateInput:n}=e.useThemeSettingsStore(),s=j.useMemo(()=>t.inputs,[t]),o=(r,i,l)=>{n(r,i,l)},a=r=>i=>{n(r,i,"color")};return e.jsxRuntimeExports.jsxs("div",{className:se.wrapper,children:[e.jsxRuntimeExports.jsxs(Ie,{title:"General",children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Height (px)",value:String(s.general.height),onChange:r=>o("general",r,"height"),type:"number",min:0}),e.jsxRuntimeExports.jsx(e.Select,{label:"Font Size (px)",onChange:r=>o("general",r,"size"),value:String(s.general.size),options:Fe}),e.jsxRuntimeExports.jsx(xe,{initialColor:oe(s.general.color),onChange:a("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),e.jsxRuntimeExports.jsx(Ie,{title:"Field Fill",rightAddon:e.jsxRuntimeExports.jsx("div",{className:se.switch,children:e.jsxRuntimeExports.jsx(e.Switch,{onChange:r=>o("field",r,"active"),current:s.field.active})}),children:e.jsxRuntimeExports.jsx(xe,{initialColor:s.field.color,onChange:a("field"),title:"Color",labelStyle:"secondary"})}),e.jsxRuntimeExports.jsxs(Ie,{title:"Border",rightAddon:e.jsxRuntimeExports.jsx("div",{className:se.switch,children:e.jsxRuntimeExports.jsx(e.Switch,{onChange:r=>o("border",r,"active"),current:s.border.active})}),children:[e.jsxRuntimeExports.jsxs("div",{className:se.lineField,children:[e.jsxRuntimeExports.jsxs("div",{className:se.style,children:[e.jsxRuntimeExports.jsx("span",{className:se.title,children:"Style"}),e.jsxRuntimeExports.jsx(_t,{items:wa,selectedItem:s.border.style,onSelect:r=>o("border",r,"style"),getIconName:r=>r==="solid"?"Minus":"Selection"})]}),e.jsxRuntimeExports.jsx(e.Input,{label:"Radius (px)",value:String(s.border.radius),onChange:r=>o("border",r,"radius"),type:"number",min:0})]}),e.jsxRuntimeExports.jsx(e.Input,{label:"Thickness (px)",value:String(s.border.thickness),onChange:r=>o("border",r,"thickness"),type:"number",min:0}),e.jsxRuntimeExports.jsx(xe,{initialColor:oe(s.border.color),onChange:a("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),e.jsxRuntimeExports.jsxs(Ie,{title:"Label",children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Line Height (px)",value:String(s.label.height),onChange:r=>o("label",r,"height"),type:"number",min:0}),e.jsxRuntimeExports.jsx(e.Select,{label:"Font Size (px)",onChange:r=>o("label",r,"size"),value:String(s.label.size),options:Fe}),e.jsxRuntimeExports.jsx(xe,{initialColor:oe(s.label.color),onChange:a("label"),title:"Color",labelStyle:"secondary",isGradientActive:!1}),e.jsxRuntimeExports.jsxs("div",{className:se.alignments,children:[e.jsxRuntimeExports.jsx("h4",{className:se.title,children:"Alignment Type"}),e.jsxRuntimeExports.jsx(_t,{items:va,selectedItem:s.label.alignment,onSelect:r=>o("label",r,"alignment"),getIconName:r=>r==="center"?"AlignCenterHorizontal":r==="left"?"AlignLeft":"AlignRight"})]})]})]})},ba="_wrapper_1yw63_2",Ea="_category_1yw63_7",ka="_categoryTitle_1yw63_13",Ra="_color_1yw63_24",ya="_content_1yw63_33",Ta="_preview_1yw63_42",La="_container_1yw63_52",Na="_buttonWrapper_1yw63_62",Ba="_button_1yw63_62",Pa="_buttonBorder_1yw63_80",Aa="_buttonBackground_1yw63_83",Ia="_text_1yw63_87",$a="_textText_1yw63_93",Ma="_icon_1yw63_97",Fa="_iconIcon_1yw63_100",Ha="_annotation_1yw63_104",Da="_annotationText_1yw63_111",Oa="_label_1yw63_116",Ua="_circle_1yw63_127",Va="_line_1yw63_140",za="_circle1_1yw63_154",Ga="_circle2_1yw63_159",qa="_annotationIcon_1yw63_164",Wa="_annotationBorder_1yw63_192",Za="_line1_1yw63_203",Xa="_line2_1yw63_210",Ya="_circle3_1yw63_227",Ka="_circle4_1yw63_232",Ja="_annotationSurface_1yw63_237",k={wrapper:ba,category:Ea,categoryTitle:ka,color:Ra,content:ya,preview:Ta,container:La,buttonWrapper:Na,button:Ba,buttonBorder:Pa,buttonBackground:Aa,text:Ia,textText:$a,icon:Ma,iconIcon:Fa,annotation:Ha,annotationText:Da,label:Oa,circle:Ua,line:Va,circle1:za,circle2:Ga,annotationIcon:qa,annotationBorder:Wa,line1:Za,line2:Xa,circle3:Ya,circle4:Ka,annotationSurface:Ja},Qa=()=>{const{activeColorCategory:t}=e.useThemeSettingsStore();return e.jsxRuntimeExports.jsx("div",{className:k.container,children:e.jsxRuntimeExports.jsxs("div",{className:k.buttonWrapper,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.button,{[k.buttonBorder]:t==="border",[k.buttonBackground]:t==="surface"}),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Smiley",className:e.clx(k.icon,{[k.iconIcon]:t==="text"}),width:22,height:22,fill:"#757575"}),e.jsxRuntimeExports.jsx("span",{className:e.clx(k.text,{[k.textText]:t==="text"}),children:"Button Example"})]}),t==="text"&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.annotation,k.annotationText),children:[e.jsxRuntimeExports.jsx("div",{className:k.label,children:"Text Color"}),e.jsxRuntimeExports.jsx("div",{className:k.line}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle2)})]}),t==="text"&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.annotation,k.annotationIcon),children:[e.jsxRuntimeExports.jsx("div",{className:k.label,children:"Icon Color"}),e.jsxRuntimeExports.jsx("div",{className:k.line}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle2)})]}),t==="border"&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.annotation,k.annotationBorder),children:[e.jsxRuntimeExports.jsx("div",{className:k.label,children:"Border Color"}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.line,k.line1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.line,k.line2)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle2)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle3)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle4)})]}),t==="surface"&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.annotation,k.annotationSurface),children:[e.jsxRuntimeExports.jsx("div",{className:k.label,children:"Surface Color"}),e.jsxRuntimeExports.jsx("div",{className:k.line}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle2)})]})]})})},el=()=>{const{activeBlock:t,setActiveColorCategory:n,activeColorCategory:s,themeSettings:o,updateColor:a}=e.useThemeSettingsStore();function r(){n(null)}function i(g,p,h){a(g,p,h)}const l=!!((t==null?void 0:t.name)==="Colors"&&s),x=(t==null?void 0:t.name)!=="Colors"||!s;return e.jsxRuntimeExports.jsxs(Re,{isOpen:l,isClose:x,children:[e.jsxRuntimeExports.jsx(ke,{onClick:r,title:s==="text"?"Text & Icon Colors":`${oe(s)} Colors`}),s&&e.jsxRuntimeExports.jsxs("div",{className:k.wrapper,children:[e.jsxRuntimeExports.jsx(Qa,{}),Object.entries(o.colors[s]).map(([g,p])=>e.jsxRuntimeExports.jsx("div",{className:k.color,children:e.jsxRuntimeExports.jsxs("div",{className:k.content,children:[e.jsxRuntimeExports.jsx("div",{className:k.preview,style:{background:p}}),e.jsxRuntimeExports.jsx(xe,{title:oe(g),initialColor:p,onChange:h=>i(s,g,h),isGradientActive:s==="surface"})]})},g))]})]})},tl="_loader_1p5lr_1",sl={loader:tl},ol=()=>{const{activeBlock:t,themeSettings:n,isLoadingThemeSettings:s}=e.useThemeSettingsStore();return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:s?e.jsxRuntimeExports.jsx("div",{className:sl.loader,children:e.jsxRuntimeExports.jsx(e.Loader,{})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(t==null?void 0:t.name)==="Fonts"&&n.fonts&&e.jsxRuntimeExports.jsx(oa,{}),(t==null?void 0:t.name)==="Fonts"&&n.fonts&&e.jsxRuntimeExports.jsx(qi,{}),(t==null?void 0:t.name)==="Colors"&&n.colors&&e.jsxRuntimeExports.jsx(Ai,{}),(t==null?void 0:t.name)==="Colors"&&n.colors&&e.jsxRuntimeExports.jsx(el,{}),(t==null?void 0:t.name)==="Inputs"&&n.inputs&&e.jsxRuntimeExports.jsx(Ca,{}),(t==null?void 0:t.name)==="Borders"&&n.borders&&e.jsxRuntimeExports.jsx(hi,{}),(t==null?void 0:t.name)==="Buttons"&&n.buttons&&e.jsxRuntimeExports.jsx(Ni,{})]})})},nl=()=>{const{activeBlock:t,setActiveBlock:n}=e.useThemeSettingsStore(),{activeBlock:s}=e.useNavbarStore(),o=e.useNavigate();function a(){n(null),o("/admin/builder/theme")}const r=!!t,i=!t||s.name!=="Theme";return e.jsxRuntimeExports.jsxs(Re,{isOpen:r,isClose:i,children:[e.jsxRuntimeExports.jsx(ke,{onClick:a,title:(t==null?void 0:t.name)||""}),e.jsxRuntimeExports.jsx(ol,{})]})},rl=()=>{const{activeBlock:t}=e.useNavbarStore(),{showTooltip:n}=e.useTooltipStore();function s(){switch(t.name){case"Layers":return"Layers";case"Add":return"Add Sections";case"Theme":return"Theme Settings";case"Settings":return"Settings"}}return e.jsxRuntimeExports.jsxs("div",{className:ft.sidebar,style:{zIndex:n?50:"auto"},children:[e.jsxRuntimeExports.jsx("h3",{className:ft.title,children:s()}),t.name==="Layers"&&e.jsxRuntimeExports.jsx(wr,{}),t.name==="Add"&&e.jsxRuntimeExports.jsx(Rt,{}),e.jsxRuntimeExports.jsx(ii,{}),e.jsxRuntimeExports.jsx(nl,{}),t.name==="Theme"&&e.jsxRuntimeExports.jsx(Pr,{}),t.name==="Settings"&&e.jsxRuntimeExports.jsx(Rr,{})]})},il="_wrapper_no6if_1",al="_header_no6if_12",ll="_content_no6if_23",cl="_buttons_no6if_44",ul="_label_no6if_51",dl="_description_no6if_52",pl="_preview_no6if_60",xl="_block_no6if_66",ml="_slug_no6if_75",hl="_title_no6if_81",gl="_closeIcon_no6if_87",ee={wrapper:il,header:al,content:ll,buttons:cl,label:ul,description:dl,preview:pl,block:xl,slug:ml,title:hl,closeIcon:gl},jl="_wrapper_ba9vp_2",Sl="_label_ba9vp_10",fl="_options_ba9vp_18",_l="_radioLabel_ba9vp_24",vl="_radio_ba9vp_24",wl="_custom_ba9vp_39",Cl="_option_ba9vp_18",de={wrapper:jl,label:Sl,options:fl,radioLabel:_l,radio:vl,custom:wl,option:Cl},bl=t=>{const{defaultValue:n,options:s,onChange:o,label:a}=t,[r,i]=j.useState(n),l=x=>{const g=x.target.value;i(g),o(g)};return e.jsxRuntimeExports.jsxs("div",{className:de.wrapper,children:[e.jsxRuntimeExports.jsx("span",{className:de.label,children:a}),e.jsxRuntimeExports.jsx("div",{className:de.options,children:s.map(x=>e.jsxRuntimeExports.jsxs("label",{className:de.radioLabel,children:[e.jsxRuntimeExports.jsx("input",{type:"radio",value:x.value,checked:r===x.value,onChange:l,className:de.radio}),e.jsxRuntimeExports.jsx("span",{className:de.custom}),e.jsxRuntimeExports.jsx("span",{className:de.option,children:x.label})]},x.value))})]})},El=()=>{var F,P,H,V,$,Y,ne;const{setIsOpenModal:t,pages:n,createPage:s,updatePage:o,isEdit:a,setIsEdit:r,editedPage:i,setEditedPage:l,pageContext:x}=e.usePagesStore(),{setIsOpen:g}=e.useModalStore(),{createPage:p,updatePage:h}=e.useLayersStore(),[c,d]=j.useState(i?n&&((F=n[i])==null?void 0:F.path):""),[S,m]=j.useState(i?n&&((P=n[i])==null?void 0:P.name):""),[f,v]=j.useState(i?n&&((H=n[i])==null?void 0:H.seo)&&(($=(V=n[i])==null?void 0:V.seo)==null?void 0:$.pageDescription)||"":`${x.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`),[_,u]=j.useState(i&&n&&(Y=n[i])!=null&&Y.isPrivate?"private":"public");function C(){d(""),m(""),v(""),u("public"),r(!1),l(null)}function w(){g(!1),setTimeout(()=>{C(),t(!1),g(!0)},300)}function E(M){return M[0]==="/"?M:"/"+M}function b(){s({path:E(c),name:S||c||"",icon:"File",seo:{pageTitle:S||"",pageDescription:f||""},visibility:_||"public"}),p(E(c)),w()}function R(){n&&(h(n[i].path||"",c||""),o(i,{path:E(c),name:S||c,icon:n[i].icon||"File",seo:{pageTitle:S||"",pageDescription:f||""},visibility:_||"public"})),w()}return e.jsxRuntimeExports.jsxs("div",{className:ee.wrapper,onClick:M=>M.stopPropagation(),children:[e.jsxRuntimeExports.jsxs("div",{className:ee.header,children:[e.jsxRuntimeExports.jsx("h2",{children:a?"Edit Page":"Create New Page"}),e.jsxRuntimeExports.jsx("div",{className:ee.closeIcon,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:w})})]}),e.jsxRuntimeExports.jsxs("div",{className:ee.content,children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Page Slug",onChange:M=>d(M),value:c,placeholder:"path-to-page",disabled:!!(i&&n&&((ne=n[i])!=null&&ne.name)&&e.defaultPagePaths.includes(n[i].path)),required:!0,regex:"^.+$"}),e.jsxRuntimeExports.jsx(e.Input,{label:"Page Title",onChange:M=>{m(M)},value:S.charAt(0).toUpperCase()+S.slice(1),placeholder:"Contact us"}),e.jsxRuntimeExports.jsx(e.Textarea,{label:"Description",onChange:M=>v(M),value:f,placeholder:`${x.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`,maxLength:150}),e.jsxRuntimeExports.jsx(bl,{label:"Visibility",defaultValue:_,options:[{value:"public",label:"Public"},{value:"private",label:"Private"}],onChange:M=>u(M)}),e.jsxRuntimeExports.jsxs("div",{className:ee.preview,children:[e.jsxRuntimeExports.jsx("span",{className:ee.label,children:"Preview"}),e.jsxRuntimeExports.jsxs("div",{className:ee.block,children:[e.jsxRuntimeExports.jsx("span",{className:ee.slug,children:c||"yoursite.url"}),e.jsxRuntimeExports.jsx("span",{className:ee.title,children:S||"My Blank Page"}),e.jsxRuntimeExports.jsx("span",{className:ee.description,children:f||"It is My Description"})]})]})]}),e.jsxRuntimeExports.jsxs("div",{className:ee.buttons,children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:w,type:"Secondary",children:"Cancel"}),e.jsxRuntimeExports.jsx(e.Button,{onClick:a?R:b,disabled:c.length===0,children:a?"Update":"Create"})]})]})},kl="_layout_3kge3_1",Rl="_main_3kge3_10",yl="_content_3kge3_18",Tl="_notification_3kge3_26",$e={layout:kl,main:Rl,content:yl,notification:Tl},Ll="_modal_1h74q_1",Nl="_title_1h74q_14",Bl="_buttons_1h74q_20",Me={modal:Ll,title:Nl,buttons:Bl},yt=()=>{const{title:t,description:n,onConfirm:s,setTitle:o,setDescription:a,setOnConfirm:r}=e.useConfirmationModalStore(),{setIsOpen:i}=e.useModalStore();function l(){i(!1),setTimeout(()=>{o(null),a(null),r(null),i(!0)},300)}return t&&n&&s&&e.jsxRuntimeExports.jsxs("div",{className:Me.modal,onClick:x=>x.stopPropagation(),children:[e.jsxRuntimeExports.jsx("div",{className:Me.title,children:t}),e.jsxRuntimeExports.jsx("div",{className:Me.description,children:n}),e.jsxRuntimeExports.jsxs("div",{className:Me.buttons,children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:l,children:"Cancel"}),e.jsxRuntimeExports.jsx(e.Button,{onClick:()=>{s(),l()},type:"Secondary",children:"Confirm"})]})]})},Pl=()=>{const{isOpenModal:t,setIsOpenModal:n}=e.usePagesStore(),{openModal:s,setOpenModal:o}=e.useChooseImageStore(),{notification:a,setNotification:r}=e.useNotificationStore(),{title:i,description:l,setTitle:x,setDescription:g,setOnConfirm:p}=e.useConfirmationModalStore(),[h,c]=j.useState(null);return j.useEffect(()=>{if(a){h&&clearTimeout(h);const d=setTimeout(()=>{r(null)},3e3);c(d)}},[a]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:$e.layout,children:[e.jsxRuntimeExports.jsx(fo,{}),e.jsxRuntimeExports.jsxs("main",{className:$e.main,children:[e.jsxRuntimeExports.jsx(co,{}),e.jsxRuntimeExports.jsxs("div",{className:$e.content,children:[e.jsxRuntimeExports.jsx(rl,{}),e.jsxRuntimeExports.jsx(Wn,{})]})]})]}),i&&l&&e.jsxRuntimeExports.jsx(e.Modal,{close:()=>{x(null),g(null),p(null)},children:e.jsxRuntimeExports.jsx(yt,{})}),t&&e.jsxRuntimeExports.jsx(e.Modal,{close:n,children:e.jsxRuntimeExports.jsx(El,{})}),s&&e.jsxRuntimeExports.jsx(e.Modal,{close:o,children:e.jsxRuntimeExports.jsx(e.ChooseImageModal,{})}),a&&e.jsxRuntimeExports.jsx("div",{className:$e.notification,children:e.jsxRuntimeExports.jsx(e.Tip,{message:a.message,type:a.status})})]})},Al=t=>{const{blocks:n,settings:s,header:o,footer:a,announcement:r}=t,{setBlocks:i,setSourceBlocks:l}=e.useBlocksStore(),{fonts:x,setFonts:g}=e.useFontsStore(),{setSettings:p}=e.useSettingsStore(),{setPageContext:h}=e.usePagesStore(),{setThemeSettings:c,setIsLoadingThemeSettings:d}=e.useThemeSettingsStore(),{setIsLoadingSettings:S}=e.useSettingsStore(),{setNotification:m}=e.useNotificationStore(),{setHeader:f,setFooter:v,setAnnouncement:_,setBlocks:u,blocks:C,createPage:w,setIsLoadingLayers:E}=e.useLayersStore(),{setPages:b,setCurrentPage:R}=e.usePagesStore();return j.useEffect(()=>{d(!0),E(!0),S(!0);const F={};Object.keys(n).forEach(H=>{F[H]=n[H]}),l(F),i(F),f(o),v(a),_(r),(async()=>{const{data:H}=await ss();let V={listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null};const $=await Qt();Object.keys($).map(I=>{const q=I;V[q]=$[q].value.data}),h(V);const{themeSettings:Y,layers:ne,settings:M}=H;if(M){const I=s;if(M.settings&&(Object.keys(M.settings).map(q=>{I[q]=M.settings[q]}),p(I)),M.header){const q=o;Object.keys(M.header).map(ae=>{q[ae]=M.header[ae]}),f(q)}if(M.footer){const q=a;Object.keys(M.footer).map(ae=>{q[ae]=M.footer[ae]}),v(q)}}else p(s);Y&&c(Y),u(ne);const J=await ts();console.log("Pages",J);const Z={};if(J.status>=400&&m({message:"Error fetching pages",status:"error"}),J.data.length>0?(J.data.forEach(I=>{C[I.path]||w(I.path),Z[I.id||I.path]={...I,icon:e.pages[I.path]?e.pages[I.path].icon:"File",name:I.name?I.name:e.pages[I.path].name}}),b(Z),R(Object.keys(Z)[0])):(b(e.pages),R(Object.keys(e.pages)[0])),x.length===0){const I=await es();g([...I.map(q=>q.family)])}d(!1),E(!1),S(!1)})()},[]),e.jsxRuntimeExports.jsx(Pl,{})};function Il(){const t=new URL(window.location.href);window.history.replaceState(null,"",t.pathname+t.hash)}function $l(){const t=new URLSearchParams(document.location.search),n=t.get("shopId")||localStorage.getItem("shopId"),s=t.get("sellerAccessToken")||localStorage.getItem("sellerAccessToken"),o=t.get("draftId")||localStorage.getItem("draftId");return Il(),s&&localStorage.setItem("sellerAccessToken",s),n&&localStorage.setItem("shopId",n),o&&localStorage.setItem("draftId",o),!!(s&&n&&o)}const Ml=t=>{const{blocks:n,settings:s,header:o,footer:a,announcement:r}=t,[i,l]=j.useState(!0),x=e.useNavigate();return j.useEffect(()=>{l(!0),$l()?l(!1):x("/")},[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i?e.jsxRuntimeExports.jsx(e.Loader,{}):e.jsxRuntimeExports.jsx(Al,{blocks:n,settings:s,header:o,footer:a,announcement:r})})},Fl="_wrapper_1yd2j_1",Hl="_error_1yd2j_11",Dl="_title_1yd2j_21",Ol="_buttons_1yd2j_29",be={wrapper:Fl,error:Hl,title:Dl,buttons:Ol},vt=async t=>{const n=localStorage.getItem("shopId")||void 0,s=localStorage.getItem("draftId"),o=`${e.API_URL}/v2/builder/shops/${n}/drafts/${s}/reset`;return await e.request({url:o,withToken:!0,method:"post",body:t})},Ul=()=>{const{error:t,setError:n}=e.useErrorStore(),{pages:s}=e.usePagesStore(),{setIsOpen:o}=e.useModalStore(),{title:a,description:r,setOnConfirm:i,setTitle:l,setDescription:x}=e.useConfirmationModalStore(),{setBlocks:g}=e.useLayersStore();async function p(){await vt({resetSettings:(t==null?void 0:t.failedSettings)??!1,resetThemeSettings:(t==null?void 0:t.failedThemeSettings)??!1,resetPageIds:(t==null?void 0:t.failedPageIds)??[]}),n(null),g({}),window.location.reload()}async function h(){const c=[];s&&Object.keys(s).map(d=>s[d].id).filter(d=>d!==void 0).map(d=>c.push(d)),await vt({resetSettings:!0,resetThemeSettings:!0,resetPageIds:c}),n(null)}return e.jsxRuntimeExports.jsxs("div",{className:be.wrapper,children:[e.jsxRuntimeExports.jsxs("div",{className:be.error,children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:be.title,children:"Oops! Something went wrong"}),e.jsxRuntimeExports.jsx("span",{className:be.message,children:(t==null?void 0:t.message)||""})]}),e.jsxRuntimeExports.jsxs("div",{className:be.buttons,children:[e.jsxRuntimeExports.jsx(e.Button,{type:"Primary",onClick:p,children:"Reset Settings"}),e.jsxRuntimeExports.jsx(e.Button,{type:"Secondary",onClick:c=>{c.stopPropagation(),l("Reset All Settings"),x("Are you sure you want to reset all settings? This is irreversible."),i(async()=>{await h()})},children:"Reset All Settings"})]})]}),a&&r&&e.jsxRuntimeExports.jsx(e.Modal,{close:()=>{o(!1),setTimeout(()=>{l(null),x(null),i(null),o(!0)},300)},children:e.jsxRuntimeExports.jsx(yt,{})})]})},Vl=t=>{const{children:n}=t,{pathname:s}=e.useLocation(),{setActiveBlock:o}=e.useNavbarStore(),{setActiveBlock:a}=e.useThemeSettingsStore(),{setActiveBlock:r}=e.usePreviewStore();return j.useEffect(()=>{switch(r({id:null,neededScroll:!1}),s){case"/admin/builder":o(e.navbarBlocks[0]);break;case"/admin/builder/add":o(e.navbarBlocks[1]);break;case"/admin/builder/theme":o(e.navbarBlocks[2]);break;case"/admin/builder/settings":o(e.navbarBlocks[3]);break;case"/admin/builder/theme/colors":o(e.navbarBlocks[2]),a(Se[0]);break;case"/admin/builder/theme/fonts":o(e.navbarBlocks[2]),a(Se[1]);break;case"/admin/builder/theme/borders":o(e.navbarBlocks[2]),a(Se[2]);break;case"/admin/builder/theme/buttons":o(e.navbarBlocks[2]),a(Se[3]);break;case"/admin/builder/theme/inputs":o(e.navbarBlocks[2]),a(Se[4]);break}},[s]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:n})},zl="_lock_1mxa7_1",Gl="_wrapper_1mxa7_12",ql="_content_1mxa7_22",Wl="_info_1mxa7_31",Zl="_buttons_1mxa7_38",Xl="_button_1mxa7_38",Yl="_input_1mxa7_50",Kl="_error_1mxa7_57",te={lock:zl,wrapper:Gl,content:ql,info:Wl,buttons:Zl,button:Xl,input:Yl,error:Kl},Jl=()=>{const[t,n]=j.useState(!1),[s,o]=j.useState(!1),[a,r]=j.useState(""),{general:i,setGeneral:l}=e.useGeneralStore(),{setThemeSettings:x}=e.useThemeSettingsStore(),g=e.useNavigate();j.useEffect(()=>{i&&i.info.passwordProtected&&g("/")},[i]),j.useEffect(()=>{(async()=>{if(n(!0),!i){const c=localStorage.getItem("shopPassword")||"",d=await He(c);d.isPasswordValid&&g("/"),l(d);const{theme:S}=(await Ct()).data;x(S)}n(!1)})()},[]);async function p(){n(!0),(await He(a)).isPasswordValid?(localStorage.setItem("shopPassword",a),g("/")):o(!0),n(!1)}return e.jsxRuntimeExports.jsxs("div",{className:te.wrapper,children:[!t&&e.jsxRuntimeExports.jsxs("div",{className:te.content,children:[e.jsxRuntimeExports.jsx("div",{className:te.lock,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Lock",fill:"var(--text-secondary)",width:64,height:64})}),e.jsxRuntimeExports.jsxs("div",{className:te.info,children:[e.jsxRuntimeExports.jsx("h2",{id:"h2",className:te.title,children:"The store is password protected"}),e.jsxRuntimeExports.jsx("p",{id:"p",className:te.description,children:"If you do not have a password, we recommend you to contact the technical support of the store or write to the mail"})]}),e.jsxRuntimeExports.jsxs("div",{className:te.input,children:[e.jsxRuntimeExports.jsx(e.Input$1,{type:"password",onChange:h=>{o(!1),r(h)},value:a,placeholder:"Password",required:!0}),e.jsxRuntimeExports.jsx("span",{className:te.error,children:s&&"Incorrect password"})]}),e.jsxRuntimeExports.jsxs("div",{className:te.buttons,children:[e.jsxRuntimeExports.jsx(e.Button$1,{type:"Secondary",className:te.button,children:"Contact Support"}),e.jsxRuntimeExports.jsx(e.Button$1,{type:"Primary",className:te.button,disabled:s,onClick:p,children:"Submit"})]})]}),t&&e.jsxRuntimeExports.jsx(e.Loader,{})]})},Ql=({children:t})=>{const[n,s]=j.useState(!0),{setThemeSettings:o,themeSettings:a}=e.useThemeSettingsStore(),{settings:r,setSettings:i}=e.useSettingsStore(),{setHeader:l,setFooter:x,setAnnouncement:g,header:p,footer:h,announcement:c}=e.useLayersStore(),{general:d,setGeneral:S}=e.useGeneralStore(),{pageContext:m,setPageContext:f}=e.usePagesStore(),v=e.useLocation(),_=e.useNavigate();return j.useEffect(()=>{s(!0);const u=async()=>{if(!d){const w=await He();w.isPasswordValid||_("/validation"),S(w)}},C=async()=>{const{settings:w,theme:E}=(await Ct()).data,b=v.pathname.startsWith("/admin/builder")?null:await Et(encodeURIComponent("/products"));if(b){const{data:R}=b;f({...m,listings:R.listings})}if(w&&r){const R=r;if(w.settings?(Object.keys(w.settings).map(F=>{R[F]=w.settings[F]}),i(R)):i(r),w.header&&p){const F=p;Object.keys(w.header).map(P=>{F[P]=w.header[P]}),l(F)}if(w.footer&&h){const F=h;Object.keys(w.footer).map(P=>{F[P]=w.footer[P]}),x(F)}if(w.announcement&&c){const F=c;Object.keys(w.announcement).map(P=>{F[P]=w.announcement[P]}),g(F)}}else i(r);o(a),o(E||a),s(!1)};u(),C()},[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:n?e.jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsxRuntimeExports.jsx(e.Loader,{})}):t})},ec=()=>(j.useEffect(()=>{setTimeout(()=>{window.location.reload()},500)},[]),e.jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsxRuntimeExports.jsx(e.Loader,{})})),tc="_wrapper_rccv2_1",sc="_content_rccv2_11",oc="_title_rccv2_21",nt={wrapper:tc,content:sc,title:oc},pe=()=>{const t=e.useNavigate();return e.jsxRuntimeExports.jsx("div",{className:nt.wrapper,children:e.jsxRuntimeExports.jsxs("div",{className:nt.content,children:[e.jsxRuntimeExports.jsx("h1",{className:nt.title,children:"Something went wrong"}),e.jsxRuntimeExports.jsx(e.Button,{type:"Primary",onClick:()=>t("/"),children:"Go to Home"})]})})},nc=t=>{const{blocks:n,settings:s,header:o,footer:a,announcement:r}=t,[i,l]=j.useState(null),{setBlocks:x,setSourceBlocks:g}=e.useBlocksStore(),{setSettings:p}=e.useSettingsStore(),{setHeader:h,setFooter:c,setAnnouncement:d}=e.useLayersStore(),{themeSettings:S}=e.useThemeSettingsStore(),{settings:m}=e.useSettingsStore(),f=window.location.hostname.includes("localhost")?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,v=localStorage.getItem("shopPassword"),_=localStorage.getItem("shopId")||"";return j.useEffect(()=>{if(!i){const u={};Object.keys(n).map(w=>{u[w]=n[w]}),g(u),x(u),h(o),c(a),p(s),d(r);const C=e.createBrowserRouter([{element:e.jsxRuntimeExports.jsx(e.hI,{shopDomain:f,shopId:_,shopPassword:v||void 0,routes:{Checkout:"/checkout",TopUp:"/top-up",Charge:"/charges",Order:"/orders",Subscription:"/subscriptions"},children:e.jsxRuntimeExports.jsx(Ql,{children:e.jsxRuntimeExports.jsx(e.Outlet,{})})}),errorElement:e.jsxRuntimeExports.jsx(ec,{}),children:[{path:"/admin/builder/*",element:e.jsxRuntimeExports.jsx(Vl,{children:e.jsxRuntimeExports.jsx(Ml,{blocks:n,settings:s,header:o,footer:a,announcement:r})}),errorElement:e.jsxRuntimeExports.jsx(Ul,{})},{path:"/checkout",element:e.jsxRuntimeExports.jsx(e.gI,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/top-up",element:e.jsxRuntimeExports.jsx(e.CI,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/charges/:id",element:e.jsxRuntimeExports.jsx(e._I,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/orders/:id/:accessToken?",element:e.jsxRuntimeExports.jsx(e.yI,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/subscriptions/:id/:accessToken?",element:e.jsxRuntimeExports.jsx(e.xI,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/customer-dash",element:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden"},children:[e.jsxRuntimeExports.jsx(Oe,{}),e.jsxRuntimeExports.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:e.jsxRuntimeExports.jsx(e.vI,{})}),e.jsxRuntimeExports.jsx(De,{})]}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/validation",element:e.jsxRuntimeExports.jsx(Jl,{})},{path:"/ticket/:id/:accessToken",element:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden"},children:[e.jsxRuntimeExports.jsx(Oe,{}),e.jsxRuntimeExports.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:e.jsxRuntimeExports.jsx(e.Z2,{children:e.jsxRuntimeExports.jsx(e.bI,{})})}),e.jsxRuntimeExports.jsx(De,{})]})},{path:"*",element:e.jsxRuntimeExports.jsx(js,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})}]}]);l(C)}},[i]),j.useEffect(()=>{const u=Ss(S,m);bs(S),fs(u)},[S,m]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i&&e.jsxRuntimeExports.jsx(e.RouterProvider,{router:i})})};exports.ReCaptchaProvider=e.Z2;exports.splitTextIntoSpans=e.splitTextIntoSpans;exports.useReCaptcha=e.bi;exports.App=nc;exports.ColorVariables=wt;exports.createTicket=ks;exports.hotReload=Es;exports.iconNames=At;
|
|
90
|
+
`},children:e.jsxRuntimeExports.jsx("div",{className:L.indicator,style:{position:"absolute",left:`${lt}%`,top:`${100-ct}%`,transform:"translate(-50%, -50%)"}})}),e.jsxRuntimeExports.jsx("div",{className:L.hueSlider,style:{bottom:v?"175px":"100px"},children:e.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"360",value:me,onChange:B=>{const y=Number(B.target.value);v?T===1?$(y,r,i,l):$(y,E,b,R):(p(y),$(y,r,i,l))},className:L.slider})}),e.jsxRuntimeExports.jsxs("div",{className:L.alphaSlider,style:{bottom:v?"150px":"75px"},children:[e.jsxRuntimeExports.jsx("div",{className:L.alphaBackground}),e.jsxRuntimeExports.jsx("div",{className:L.alphaGradient,style:{background:Lt}}),e.jsxRuntimeExports.jsx("input",{type:"range",min:"0",max:"100",value:Tt,onChange:B=>{const y=Number(B.target.value);v?T===1?$(a,r,i,y):$(w,E,b,y):(d(y),$(a,r,i,y))},className:L.slider})]}),v&&ne&&e.jsxRuntimeExports.jsxs("div",{className:L.gradientWrapper,children:[e.jsxRuntimeExports.jsx("h3",{className:L.subtitle,children:"Rotation"}),e.jsxRuntimeExports.jsx("div",{className:L.gradient,children:e.jsxRuntimeExports.jsxs("div",{className:L.chargeTypes,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(L.charge,{[L.chargeActive]:u==="horizontal"}),onClick:()=>C("horizontal"),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowsHorizontal",width:20,height:20}),"Horizontal"]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(L.charge,{[L.chargeActive]:u==="vertical"}),onClick:()=>C("vertical"),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"ArrowsVertical",width:20,height:20}),"Vertical"]})]})})]}),e.jsxRuntimeExports.jsxs("div",{className:L.buttons,children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:z,className:e.clx(L.applyButton,L.cancelButton),type:"Secondary",children:"Cancel"}),e.jsxRuntimeExports.jsx(e.Button,{onClick:ze,className:L.applyButton,children:"Apply"})]})]})},Wn=()=>{const{onPreview:t,zoomLevel:n}=e.usePreviewStore(),{keyBlock:s,hoverBlockId:o,isModalVisible:a,hoverBlockTopPosition:r}=e.useSubmodalStore(),{settings:i}=e.useSettingsStore(),{sourceBlocks:l}=e.useBlocksStore(),{pageContext:x}=e.usePagesStore(),{showModal:g}=e.useColorPickerStore(),{currentDevice:p}=e.useDeviceStore(),{isLoadingThemeSettings:h}=e.useThemeSettingsStore(),{isLoadingLayers:c}=e.useLayersStore(),d=u=>u?!l||!l[u]?e.jsxRuntimeExports.jsx(_e,{error:`Block "${u}" does not exist in blocks.`}):new l[u]().renderPreview(i,x):e.jsxRuntimeExports.jsx(_e,{error:"Block or block.name is undefined."});function S(){if(p.value==="desktop")return n>=1?"100%":`${(n*100).toFixed(2)}%`;{const u=p.value==="tablet"?768:425;return n>=1?`${u}px`:`${(u*n).toFixed(2)}px`}}function m(){switch(p.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:f}=e.usePagesStore(),v=j.useRef(null),_=u=>{v.current&&(v.current.scrollTop+=u.deltaY)};return e.jsxRuntimeExports.jsxs("div",{className:Be.preview,style:{zIndex:g&&!f?5e3:500},onWheel:u=>{u.stopPropagation(),console.log("onWheel"),_(u)},children:[a&&e.jsxRuntimeExports.jsx(hn,{children:e.jsxRuntimeExports.jsx(Rt,{})}),e.jsxRuntimeExports.jsxs(mn,{positionTop:r,positionLeft:!o&&s?void 0:250,children:[!h&&!c&&e.jsxRuntimeExports.jsx(at,{render:d,block:s}),h&&e.jsxRuntimeExports.jsx(e.Loader,{})]}),g&&e.jsxRuntimeExports.jsx(qn,{}),t&&e.jsxRuntimeExports.jsxs("div",{className:Be.main,style:{width:m()},children:[e.jsxRuntimeExports.jsx(Mo,{}),e.jsxRuntimeExports.jsx("div",{style:{borderLeft:S()==="100%"?"none":"var(--default-border)",borderRight:S()==="100%"?"none":"var(--default-border)",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 160px)",overflowY:"scroll",overflowX:"hidden"},onScroll:u=>{u.stopPropagation()},onWheel:u=>{u.stopPropagation()},children:!h&&!c?e.jsxRuntimeExports.jsx("div",{className:Be.content,style:{width:S()},children:e.jsxRuntimeExports.jsx(nn,{scrollableRef:v})}):e.jsxRuntimeExports.jsx("div",{className:Be.loading,children:e.jsxRuntimeExports.jsx(e.Loader,{})})})]})]})},Zn="_sidebar_1xtkj_1",Xn="_title_1xtkj_11",Yn="_active_1xtkj_19",ft={sidebar:Zn,title:Xn,active:Yn},Kn="_layers_1jhzw_1",Jn="_wrapper_1jhzw_9",Qn="_draggingWrapper_1jhzw_17",er="_block_1jhzw_21",tr="_dragging_1jhzw_17",sr="_active_1jhzw_56",or="_add_1jhzw_63",nr="_addTop_1jhzw_79",rr="_visible_1jhzw_95",ir="_button_1jhzw_99",ar="_empty_1jhzw_114",lr="_title_1jhzw_126",cr="_icon_1jhzw_133",ur="_blockIcon_1jhzw_137",dr="_text_1jhzw_147",pr="_highlight_1jhzw_153",xr="_nameBlock_1jhzw_158",mr="_loader_1jhzw_162",hr="_actions_1jhzw_171",gr="_deleteButton_1jhzw_179",W={layers:Kn,wrapper:Jn,draggingWrapper:Qn,block:er,dragging:tr,active:sr,add:or,addTop:nr,visible:rr,button:ir,empty:ar,title:lr,icon:cr,blockIcon:ur,text:dr,highlight:pr,nameBlock:xr,loader:mr,actions:hr,deleteButton:gr},jr="_block_sj4cc_1",Sr="_title_sj4cc_17",fr="_actions_sj4cc_21",_r="_deleteButton_sj4cc_28",ue={block:jr,title:Sr,actions:fr,deleteButton:_r},Ke={header:"Header",footer:"Footer",announcement:"Announcement"},Je=({id:t})=>{const{setCurrentBlock:n}=e.useLayersStore(),{activeBlock:s}=e.usePreviewStore(),[o,a]=j.useState(!1);function r(i){n(i)}return e.jsxRuntimeExports.jsxs("div",{className:e.clx(ue.block,{[ue.active]:s.id===t,[ue.header]:t==="header",[ue.footer]:t==="footer",[ue.announcement]:t==="announcement"}),onClick:()=>r(t),onMouseOver:()=>a(!0),onMouseLeave:()=>a(!1),children:[Ee[Ke[t]]?e.jsxRuntimeExports.jsx("img",{src:Ee[Ke[t]],width:20,height:20}):e.jsxRuntimeExports.jsx(e.Icon,{name:"Cards",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:ue.title,children:Ke[t]}),e.jsxRuntimeExports.jsx("div",{className:ue.actions,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"#757575"})})]})},vr=({id:t,name:n,onClick:s,isDragging:o,icon:a})=>{const{activeBlock:r,setActiveBlock:i}=e.usePreviewStore(),{showPreview:l,hidePreview:x,showModal:g,hideModal:p,clearHideTimeout:h,startHideTimeout:c,hoverBlockId:d,isModalVisible:S}=e.useSubmodalStore(),{setPositionBlock:m}=e.useLayersStore(),[f,v]=j.useState(!1),[_,u]=j.useState(!1),[C,w]=j.useState(!1),[E,b]=j.useState(!1),[R,H]=j.useState(null),{attributes:A,listeners:M,setNodeRef:V,transform:T,transition:Y}=e.useSortable({id:t}),ne={transform:e.CSS.Transform.toString(T),transition:Y},{setTitle:F,setDescription:J,setOnConfirm:Z}=e.useConfirmationModalStore(),{pages:$,currentPage:q}=e.usePagesStore(),{removeBlock:ae}=e.useLayersStore(),Ve=z=>{z.stopPropagation(),i({id:t,neededScroll:!0}),S&&p(),l(t),h()},ye=(z,me=!0)=>{z.stopPropagation(),x(),g(t),h(),m(t,me)},ze=z=>{z.stopPropagation(),i({id:null,neededScroll:!1}),S?c():x()};return j.useEffect(()=>{w(!1),v(!1),u(!1),b(!1)},[o]),j.useEffect(()=>{S||(u(!1),v(!1))},[S]),e.jsxRuntimeExports.jsxs("div",{ref:V,style:ne,className:e.clx(W.wrapper,{[W.draggingWrapper]:o&&r.id===t}),onClick:z=>{z.stopPropagation(),s(t)},onMouseEnter:Ve,onMouseLeave:ze,...A,...M,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(W.block,{[W.dragging]:o&&r.id===t,[W.active]:!o&&r.id===t}),children:[a?e.jsxRuntimeExports.jsx("img",{src:a,width:20,height:20}):e.jsxRuntimeExports.jsx(e.Icon,{name:"Cards",width:20,height:20}),e.jsxRuntimeExports.jsx("span",{className:W.nameBlock,children:n}),d===t&&!o&&e.jsxRuntimeExports.jsx("div",{className:e.clx(W.addTop,{[W.visible]:_}),onMouseEnter:()=>{u(!0)},onMouseLeave:()=>{u(!1)},children:e.jsxRuntimeExports.jsxs("button",{className:W.button,onClick:z=>ye(z,!1),onMouseEnter:()=>{const z=setTimeout(()=>{o||b(!0)},200);H(z)},onMouseLeave:()=>{R&&clearTimeout(R),b(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Plus",fill:"#fff"}),E&&e.jsxRuntimeExports.jsx(ve,{text:"Click to add a section"})]})}),d===t&&!o&&e.jsxRuntimeExports.jsx("div",{className:e.clx(W.add,{[W.visible]:f}),onMouseEnter:()=>{v(!0)},onMouseLeave:()=>{v(!1)},children:e.jsxRuntimeExports.jsxs("button",{className:W.button,onClick:z=>ye(z),onMouseEnter:()=>{const z=setTimeout(()=>{o||w(!0)},200);H(z)},onMouseLeave:()=>{R&&clearTimeout(R),w(!1)},children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Plus",fill:"#fff"}),C&&e.jsxRuntimeExports.jsx(ve,{text:"Click to add a section"})]})})]}),d===t&&!o&&e.jsxRuntimeExports.jsxs("div",{className:W.actions,children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),e.jsxRuntimeExports.jsx("div",{className:W.deleteButton,onClick:z=>{z.stopPropagation(),F("Remove Block"),J(`Are you sure you want to delete ${n||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),Z(()=>{$&&ae($[q].path,t)})},children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},wr=()=>{const{blocks:t,setCurrentBlock:n,moveBlock:s,isLoadingLayers:o,announcement:a}=e.useLayersStore(),{currentPage:r,pages:i}=e.usePagesStore(),{setMouseOverModal:l,setHoverBlockId:x}=e.useSubmodalStore(),{sourceBlocks:g}=e.useBlocksStore();function p(f){n(f),l(!1),x(null)}const h=e.useSensors(e.useSensor(e.PointerSensor,{activationConstraint:{distance:5}})),[c,d]=j.useState(!1),S=()=>{d(!0)},m=f=>{d(!1);const{active:v,over:_}=f;if(_&&v.id!==_.id&&i&&i[r]){const u=i[r].path,C=t[u].order,w=C.indexOf(v.id),E=C.indexOf(_.id);w!==-1&&E!==-1&&s(u,w,E)}};return e.jsxRuntimeExports.jsx("div",{className:W.layers,children:o?e.jsxRuntimeExports.jsx("div",{className:W.loader,children:e.jsxRuntimeExports.jsx(e.Loader,{})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[a&&e.jsxRuntimeExports.jsx(Je,{id:"announcement"}),e.jsxRuntimeExports.jsx(Je,{id:"header"}),e.jsxRuntimeExports.jsx(e.DndContext,{sensors:h,onDragEnd:m,onDragStart:S,children:i&&i[r]&&t[i[r].path]&&e.jsxRuntimeExports.jsx(e.SortableContext,{items:t[i[r].path].order,strategy:e.verticalListSortingStrategy,children:t[i[r].path].order.map((f,v)=>e.jsxRuntimeExports.jsx(vr,{id:f,name:fe(t[i[r].path].data[f].name,g),index:v,onClick:p,isDragging:c,icon:Ee[t[i[r].path].data[f].name]},f))})}),e.jsxRuntimeExports.jsx(Je,{id:"footer"})]})})},Cr=({isHeader:t})=>{const{header:n,footer:s}=e.useLayersStore(),{pageContext:o}=e.usePagesStore();return t?n==null?void 0:n.renderSettings(o):s==null?void 0:s.renderSettings(o)},br=()=>{const{announcement:t}=e.useLayersStore(),{pageContext:n}=e.usePagesStore();return t==null?void 0:t.renderSettings(n)},Er="_loader_eyvkk_1",kr={loader:Er},Rr=()=>{const{isLoadingSettings:t}=e.useSettingsStore();return t?e.jsxRuntimeExports.jsx("div",{className:kr.loader,children:e.jsxRuntimeExports.jsx(e.Loader,{})}):e.jsxRuntimeExports.jsx(yr,{})},yr=()=>{const{settings:t}=e.useSettingsStore(),{setError:n}=e.useErrorStore();try{return t==null?void 0:t.renderSettings()}catch(s){throw console.error("Error rendering settings:",s),n({message:"Error rendering settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),s}},Tr="_theme_a1one_1",Lr="_block_a1one_8",Nr="_name_a1one_23",Br="_loader_a1one_27",Pe={theme:Tr,block:Lr,name:Nr,loader:Br},Pr=()=>{const t=e.useNavigate(),{isLoadingThemeSettings:n}=e.useThemeSettingsStore();function s(o){switch(o==null?void 0:o.name){case"Colors":t("/admin/builder/theme/colors");break;case"Fonts":t("/admin/builder/theme/fonts");break;case"Borders":t("/admin/builder/theme/borders");break;case"Buttons":t("/admin/builder/theme/buttons");break;case"Inputs":t("/admin/builder/theme/inputs");break}}return e.jsxRuntimeExports.jsx("div",{className:Pe.theme,children:n?e.jsxRuntimeExports.jsx("div",{className:Pe.loader,children:e.jsxRuntimeExports.jsx(e.Loader,{})}):Se.map(o=>e.jsxRuntimeExports.jsxs("div",{onClick:()=>s(o),className:e.clx(Pe.block),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:o.icon}),e.jsxRuntimeExports.jsx("span",{className:Pe.name,children:o.name}),e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretRight"})]},o.icon))})},Ar="_back_7e826_1",Ir="_render_7e826_9",$r="_open_7e826_24",Mr="_close_7e826_51",Fr="_clicked_7e826_55",Hr="_title_7e826_59",Dr="_button_7e826_67",Or="_loading_7e826_72",Ur="_settings_7e826_76",Vr="_deleteButton_7e826_82",zr="_backIcon_7e826_95",je={back:Ar,render:Ir,open:$r,close:Mr,clicked:Fr,title:Hr,button:Dr,loading:Or,settings:Ur,deleteButton:Vr,backIcon:zr},Gr=({block:t})=>{const{pageContext:n}=e.usePagesStore(),{setError:s}=e.useErrorStore();try{return t.renderSettings(n)}catch(o){throw console.error("Error rendering settings:",o),s({message:"Error rendering block settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),o}},qr="_wrapper_15ju8_1",Wr="_header_15ju8_8",Zr="_title_15ju8_15",Xr="_colorWrapper_15ju8_21",Yr="_name_15ju8_35",Kr="_color_15ju8_21",Jr="_value_15ju8_47",Qr="_length_15ju8_51",K={wrapper:qr,header:Wr,title:Zr,colorWrapper:Xr,name:Yr,color:Kr,value:Jr,length:Qr},Qe=t=>{const{colors:n}=t,{themeSettings:s}=e.useThemeSettingsStore(),[o,a]=j.useState(!0);j.useEffect(()=>{n.length<=3&&a(!0)},[]);function r(i){const l=i.replace("--",""),[x,g]=l.split("-"),p=`${g.charAt(0).toUpperCase()+g.slice(1)} ${x.charAt(0).toUpperCase()+x.slice(1)}`,[h,c]=l.split("-");return{name:p,field:h,variable:c}}return e.jsxRuntimeExports.jsxs("div",{className:K.wrapper,children:[e.jsxRuntimeExports.jsxs("div",{className:K.header,children:[e.jsxRuntimeExports.jsx("div",{className:K.title,children:"Section Colors"}),!o&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(K.value,K.length),onClick:()=>a(!0),children:["+",n.length]})]}),o&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:K.colors,children:n.map(i=>{const l=r(i),{variable:x,name:g,field:p}=l;return e.jsxRuntimeExports.jsx(ei,{color:s.colors[p][x],name:g})})}),n.length>3&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(K.value,K.length),onClick:()=>a(!1),children:["Hide ",n.length," colors"]})]})]})},ei=t=>{const{name:n,color:s}=t,{setActiveLabel:o,setModalPosition:a,setInitialColor:r,setShowModal:i,setUpdate:l,setColor:x,setColorChange:g,colorChange:p,setIsGradientActive:h}=e.useColorPickerStore(),{updateColor:c}=e.useThemeSettingsStore(),d=(f,v)=>_=>{c(f,v,_)};j.useEffect(()=>{const f=()=>{i(!1),o(null),r(s),l(()=>{}),x(s),g(()=>{})};return document.body.addEventListener("click",f),()=>{document.body.removeEventListener("click",f)}},[]);const S=f=>{const v=n.split("/")[0],_=v.split(" ")[0].toLowerCase(),u=v.split(" ")[1].toLowerCase();f.stopPropagation(),i(!0),g(p),l(E=>d(u,_)(E)),r(s),x(s),h(u==="surface");const{top:C,left:w}=kt(f,550,288,10,20,230,80);a({top:u==="surface"?C:C+125,left:w-200})};function m(f){return f.length>15?f.slice(0,15)+"...":f}return e.jsxRuntimeExports.jsxs("div",{className:K.colorWrapper,onClick:S,children:[e.jsxRuntimeExports.jsx("div",{className:K.color,style:{background:s}}),e.jsxRuntimeExports.jsx("div",{className:K.name,children:n}),e.jsxRuntimeExports.jsx("div",{className:K.value,children:m(s)})]})},ti="_back_1sznl_1",si="_title_1sznl_9",oi="_deleteButton_1sznl_17",ni="_backIcon_1sznl_30",Ae={back:ti,title:si,deleteButton:oi,backIcon:ni},ri=({onClick:t,setIsClicked:n,getDisplayName:s})=>{var c,d;const{activeBlock:o}=e.useBlocksStore(),{setTitle:a,setDescription:r,setOnConfirm:i}=e.useConfirmationModalStore(),{blocks:l,currentBlock:x,removeBlock:g}=e.useLayersStore(),{currentPage:p,pages:h}=e.usePagesStore();return e.jsxRuntimeExports.jsxs("div",{className:Ae.back,children:[e.jsxRuntimeExports.jsx("div",{className:Ae.backIcon,onClick:()=>t(),children:e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),e.jsxRuntimeExports.jsx("h3",{className:Ae.title,children:o&&s(o)||h&&h[p]&&l[h[p].path]&&x&&s((c=l[h[p].path].data[x])==null?void 0:c.name)||x&&oe(x)||"Loading"}),x&&h&&!["header","footer","announcement"].includes(x)&&l[h[p].path].data[x]&&s((d=l[h[p].path].data[x])==null?void 0:d.name)!=="unknown name"&&e.jsxRuntimeExports.jsx("button",{onClick:S=>{var m;S.stopPropagation(),a("Remove Block"),r(`Are you sure you want to delete ${s((m=l[h[p].path].data[x])==null?void 0:m.name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),i(()=>{n(!0),g(h[p].path,x),t(!0)})},className:Ae.deleteButton,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},ii=()=>{const t=e.useNavigate(),[n,s]=j.useState(!1),{sourceBlocks:o,activeBlock:a,setActiveBlock:r,currentInstance:i,setCurrentInstance:l}=e.useBlocksStore(),{setActiveBlock:x}=e.usePreviewStore(),{blocks:g,addBlock:p,editBlock:h,currentBlock:c,setCurrentBlock:d,setHeader:S,setFooter:m,setAnnouncement:f,header:v,footer:_,announcement:u,isLoadingLayers:C}=e.useLayersStore(),{currentPage:w,pages:E}=e.usePagesStore();function b(A=!1){if(E&&i&&!A){const M={blockSettings:{}};Object.keys(i.blockSettings).filter(V=>!["displayName","isAddable"].includes(V)).map(V=>{M.blockSettings[V]=i.blockSettings[V]}),h(E[w].path,c,{name:g[E[w].path].data[c].name,value:M})}r(null),d(null),x({id:null,neededScroll:!1}),setTimeout(()=>{s(!1)},150),l(null)}function R(){var V;if(!E||!E[w]||!c)return null;const A=g[E[w].path].data[c];return!A||!o[A.name]?null:new o[A.name]((V=A.value)==null?void 0:V.blockSettings)}j.useEffect(()=>{if(a||c&&!["header","footer","announcement"].includes(c)){const A=R();l(A)}else l(null)},[a,c]),j.useEffect(()=>{if(a&&E&&!c){const A={blockSettings:{},blockColors:{}},M=new o[a];l(M),Object.keys(M.blockSettings).filter(T=>!["displayName","isAddable"].includes(T)).map(T=>{A.blockSettings[T]=M.blockSettings[T]}),Object.keys(M.blockColors).filter(T=>!["displayName","isAddable"].includes(T)).map(T=>{A.blockColors[T]=M.blockColors[T]});const V=p(E[w].path,{name:a,value:A});x({id:V,neededScroll:!0}),d(V),t("/admin/builder")}},[a]),j.useEffect(()=>{c==="header"&&S(v)},[c,v]),j.useEffect(()=>{c==="footer"&&m(_)},[c,_]),j.useEffect(()=>{c==="announcement"&&f(u)},[c,u]);function H(A){if(!o)return"unknown name";if(!o[A])return c==="header"?v==null?void 0:v.blockSettings.displayName:c==="footer"?_==null?void 0:_.blockSettings.displayName:c==="announcement"?u==null?void 0:u.blockSettings.displayName:"unknown name";const M=new o[A];return!M.blockSettings||!M.blockSettings.displayName?"unknown name":M.blockSettings.displayName}return e.jsxRuntimeExports.jsxs("div",{className:e.clx(je.render,{[je.open]:c,[je.close]:!c,[je.clicked]:n}),onClick:A=>A.stopPropagation(),style:{opacity:C?0:1},children:[e.jsxRuntimeExports.jsx(ri,{onClick:b,setIsClicked:s,getDisplayName:H}),e.jsxRuntimeExports.jsxs("div",{className:je.settings,children:[i&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Gr,{block:i}),e.jsxRuntimeExports.jsx(Qe,{colors:i.blockColors})]}),c&&["header","footer"].includes(c)&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(Cr,{isHeader:c==="header"}),e.jsxRuntimeExports.jsx(Qe,{colors:c==="header"?v.blockColors:_.blockColors})]}),c==="announcement"&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(br,{}),e.jsxRuntimeExports.jsx(Qe,{colors:u.blockColors})]}),!a&&!c&&e.jsxRuntimeExports.jsx("div",{className:je.loading,children:"Loading"})]})]})},ai="_header_9rrfr_1",li="_title_9rrfr_9",ci="_backIcon_9rrfr_15",et={header:ai,title:li,backIcon:ci},ke=({onClick:t,title:n})=>e.jsxRuntimeExports.jsxs("div",{className:et.header,children:[e.jsxRuntimeExports.jsx("div",{className:et.backIcon,onClick:t,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),e.jsxRuntimeExports.jsx("span",{className:et.title,children:n})]}),ui="_options_ymds7_1",di={options:ui},pi="_wrapper_kzokw_1",xi="_open_kzokw_16",mi="_close_kzokw_20",tt={wrapper:pi,open:xi,close:mi},Re=t=>{const{isOpen:n,isClose:s,children:o}=t;return e.jsxRuntimeExports.jsx("div",{className:e.clx(tt.wrapper,{[tt.open]:n,[tt.close]:s}),children:o})},hi=()=>{var g,p;const{activeBlock:t,themeSettings:n,updateBorder:s,setActiveBlock:o}=e.useThemeSettingsStore();function a(h,c){s(c,h)}const r=e.useNavigate();function i(){o(null),r("/admin/builder/theme")}const l=j.useMemo(()=>n.borders,[n]),x=(t==null?void 0:t.name)==="Borders";return e.jsxRuntimeExports.jsxs(Re,{isOpen:x,isClose:!x,children:[e.jsxRuntimeExports.jsx(ke,{onClick:i,title:"Borders Style"}),e.jsxRuntimeExports.jsxs("div",{className:di.options,children:[e.jsxRuntimeExports.jsx(e.Select,{label:"Border Radius (px)",options:Object.keys(qe),value:((g=Object.entries(qe).find(([h,c])=>c===l.radius))==null?void 0:g[0])||"None",onChange:h=>a(qe[h],"radius")}),e.jsxRuntimeExports.jsx(e.Select,{label:"Border Thickness (px)",options:Object.keys(We),value:((p=Object.entries(We).find(([h,c])=>c===l.thickness))==null?void 0:p[0])||"None",onChange:h=>a(We[h],"thickness")})]})]})},gi="_options_jo38w_1",ji="_alignments_jo38w_9",Si="_blocks_jo38w_15",fi="_alignment_jo38w_9",_i="_active_jo38w_34",vi="_chargeTypes_jo38w_41",wi="_charge_jo38w_41",Ci="_chargeActive_jo38w_69",bi="_shadowsHeader_jo38w_77",Ei="_sliderContainer_jo38w_83",ki="_shadowInputs_jo38w_91",Ri="_label_jo38w_102",yi="_shadowInputsRow_jo38w_111",Ti="_shadowInputsOpen_jo38w_119",X={options:gi,alignments:ji,blocks:Si,alignment:fi,active:_i,chargeTypes:vi,charge:wi,chargeActive:Ci,shadowsHeader:bi,sliderContainer:Ei,shadowInputs:ki,label:Ri,shadowInputsRow:yi,shadowInputsOpen:Ti},xe=t=>{const{initialColor:n,onChange:s,title:o,labelStyle:a="primary",isGradientActive:r=!0}=t,[i,l]=j.useState(n);j.useEffect(()=>{l(n)},[n]);const{setActiveLabel:x,setModalPosition:g,setInitialColor:p,setShowModal:h,setUpdate:c,setColor:d,setColorChange:S,setIsGradientActive:m,colorChange:f}=e.useColorPickerStore();j.useEffect(()=>{const _=()=>{h(!1),x(null),p(n),c(()=>{}),d(n),S(()=>{})};return document.body.addEventListener("click",_),()=>{document.body.removeEventListener("click",_)}},[]);const v=_=>{_.stopPropagation(),h(!0),S(l),c(s),p(n),d(i),m(r);const{top:u,left:C}=kt(_,600,288,10,20,230,80);g({top:u,left:C})};return e.jsxRuntimeExports.jsxs("div",{className:L.content,children:[e.jsxRuntimeExports.jsx("span",{className:e.clx(L.name,{[L.secondary]:a==="secondary"}),children:o}),e.jsxRuntimeExports.jsxs("label",{className:L.label,onClick:_=>_.stopPropagation(),children:[e.jsxRuntimeExports.jsx("div",{className:L.colorValue,style:{background:i},onClick:v}),e.jsxRuntimeExports.jsx("input",{type:"text",value:i,onChange:_=>{const u=_.target.value;s(u),d(u),l(u),f(u)},className:L.input})]})]})},Li=["left","center","right"],Ni=()=>{const{activeBlock:t,themeSettings:n,updateButton:s,setActiveBlock:o}=e.useThemeSettingsStore(),{fonts:a}=e.useFontsStore(),[r,i]=j.useState("primary");function l(m,f){s(r,f,m)}const[x,g]=j.useState(!1),p=n.buttons[r],h=e.useNavigate();function c(){o(null),h("/admin/builder/theme")}const d=(t==null?void 0:t.name)==="Buttons";function S(m,f){l({...p.boxShadow,[m]:f},"boxShadow")}return e.jsxRuntimeExports.jsxs(Re,{isOpen:d,isClose:!d,children:[e.jsxRuntimeExports.jsx(ke,{onClick:c,title:"Buttons Style"}),e.jsxRuntimeExports.jsx("div",{className:X.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(m=>e.jsxRuntimeExports.jsx("div",{className:e.clx(X.charge,{[X.chargeActive]:r===m}),onClick:()=>i(m),children:m.charAt(0).toUpperCase()+m.slice(1)},m))}),p&&e.jsxRuntimeExports.jsxs("div",{className:X.options,children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Height (px)",value:String(p.height),onChange:m=>l(Number(m),"height"),type:"number",min:0}),e.jsxRuntimeExports.jsx(e.Select,{label:"Font Size (px)",value:String(p.size),onChange:m=>l(Number(m),"size"),options:Fe}),e.jsxRuntimeExports.jsx(e.Input,{label:"Border Radius (px)",value:String(p.radius),onChange:m=>l(Number(m),"radius"),type:"number",min:0}),e.jsxRuntimeExports.jsx(e.Select,{label:"Font",value:p.font,onChange:m=>l(m,"font"),options:[...a.filter(m=>m!==p.font)]}),e.jsxRuntimeExports.jsx(xe,{initialColor:p.background,onChange:m=>l(m,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),e.jsxRuntimeExports.jsxs("div",{className:X.sliderContainer,children:[e.jsxRuntimeExports.jsx("h4",{className:X.label,children:"Shadow"}),e.jsxRuntimeExports.jsx(e.Button,{type:"Secondary",onClick:()=>g(!x),style:{padding:5},children:e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretUp",style:{rotate:x?"0deg":"-180deg",transition:"0.3s rotate ease"}})})]}),e.jsxRuntimeExports.jsxs("div",{className:e.clx(X.shadowInputs,{[X.shadowInputsOpen]:x}),children:[e.jsxRuntimeExports.jsxs("div",{className:X.shadowInputsRow,children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Left (px)",value:String(p.boxShadow.left),onChange:m=>S("left",Number(m)),type:"number"}),e.jsxRuntimeExports.jsx(e.Input,{label:"Top (px)",value:String(p.boxShadow.top),onChange:m=>S("top",Number(m)),type:"number"}),e.jsxRuntimeExports.jsx(e.Input,{label:"Blur (px)",value:String(p.boxShadow.blur),onChange:m=>S("blur",Number(m)),type:"number"}),e.jsxRuntimeExports.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:e.jsxRuntimeExports.jsx(e.Input,{label:"Spread (px)",value:String(p.boxShadow.spread),onChange:m=>S("spread",Number(m)),type:"number"})})]}),e.jsxRuntimeExports.jsx(xe,{initialColor:p.boxShadow.color,onChange:m=>S("color",m),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),e.jsxRuntimeExports.jsxs("div",{className:X.alignments,children:[e.jsxRuntimeExports.jsx("h4",{className:X.label,children:"Alignment Type"}),e.jsxRuntimeExports.jsx("div",{className:X.blocks,children:Li.map(m=>e.jsxRuntimeExports.jsx("div",{className:e.clx(X.alignment,{[X.active]:p.alignment===m}),onClick:()=>{l(m,"alignment")},children:e.jsxRuntimeExports.jsx(e.Icon,{name:m==="center"?"AlignCenterHorizontal":m==="left"?"AlignLeft":"AlignRight",fill:p.alignment===m?"#252525":"#757575"})},m))})]}),e.jsxRuntimeExports.jsx(e.Switch,{label:"Enable Hover",onChange:m=>l(m,"hover"),current:p.hover})]})]})},Bi="_category_hxy9u_1",Pi="_categoryTitle_hxy9u_19",st={category:Bi,categoryTitle:Pi},Ai=()=>{const{themeSettings:t,setActiveColorCategory:n}=e.useThemeSettingsStore();function s(o){console.log(o),n(o)}return console.log(Object.keys(t.colors)),e.jsxRuntimeExports.jsx("div",{className:st.wrapper,children:Object.keys(t.colors).map(o=>o==="icon"?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsxs("div",{className:st.category,onClick:()=>s(o),children:[e.jsxRuntimeExports.jsxs("h2",{className:st.categoryTitle,children:[o==="text"?"Text & Icon":oe(o)," Colors"]}),e.jsxRuntimeExports.jsx(e.Icon,{name:"CaretRight",width:24,height:24})]},o))})},Ii="_wrapper_ikvjo_1",$i="_open_ikvjo_16",Mi="_close_ikvjo_20",Fi="_header_ikvjo_24",Hi="_title_ikvjo_32",Di="_options_ikvjo_38",Oi="_clicked_ikvjo_45",Ui="_backIcon_ikvjo_49",Vi="_charge_ikvjo_59",zi="_chargeActive_ikvjo_78",Gi={wrapper:Ii,open:$i,close:Mi,header:Fi,title:Hi,options:Di,clicked:Oi,backIcon:Ui,charge:Vi,chargeActive:zi},qi=()=>{const{activeBlock:t,setActiveFont:n,activeFont:s,themeSettings:o,updateFont:a}=e.useThemeSettingsStore(),{fonts:r}=e.useFontsStore(),[i,l]=j.useState(null);function x(){n(null)}function g(d,S){i&&s&&a("desktop",i,s,S,d)}const p=j.useMemo(()=>s?o.fonts.desktop.heading[s]?(l("heading"),o.fonts.desktop.heading[s]):o.fonts.desktop.paragraph[s]?(l("paragraph"),o.fonts.desktop.paragraph[s]):(l(null),null):null,[s,o]),h=!!((t==null?void 0:t.name)==="Fonts"&&s),c=(t==null?void 0:t.name)!=="Fonts"||!s;return e.jsxRuntimeExports.jsxs(Re,{isOpen:h,isClose:c,children:[e.jsxRuntimeExports.jsx(ke,{onClick:x,title:"Font Style"}),s&&p&&e.jsxRuntimeExports.jsxs("div",{className:Gi.options,children:[e.jsxRuntimeExports.jsx(e.Select,{label:"Font",value:p.font,onChange:d=>g(d,"font"),options:[...r.filter(d=>d!==p.font)]}),e.jsxRuntimeExports.jsx(e.Select,{label:"Size",value:String(p.size),onChange:d=>g(d,"size"),options:Fe}),e.jsxRuntimeExports.jsx(e.Select,{label:"Weight",value:String(p.weight),onChange:d=>g(d,"weight"),options:Pt})]})]})},Wi="_wrapper_mkmxa_1",Zi="_category_mkmxa_5",Xi="_categoryTitle_mkmxa_11",Yi="_font_mkmxa_17",Ki="_content_mkmxa_32",Ji="_icon_mkmxa_39",Qi="_paragraph_mkmxa_50",ea="_deleteIcon_mkmxa_54",ta="_iconButton_mkmxa_61",le={wrapper:Wi,category:Zi,categoryTitle:Xi,font:Yi,content:Ki,icon:Ji,paragraph:Qi,deleteIcon:ea,iconButton:ta},sa=t=>{const{font:n,size:s,id:o,category:a}=t,{setActiveFont:r}=e.useThemeSettingsStore();return e.jsxRuntimeExports.jsxs("div",{className:le.font,onClick:()=>r(o),children:[e.jsxRuntimeExports.jsx("div",{className:e.clx(le.icon,{[le.paragraph]:a==="paragraph"}),children:e.jsxRuntimeExports.jsx(e.Icon,{name:a==="paragraph"?"TextB":"TextH"})}),e.jsxRuntimeExports.jsxs("div",{className:le.content,children:[e.jsxRuntimeExports.jsx("h2",{className:le.categoryTitle,children:oe(o)}),e.jsxRuntimeExports.jsx("span",{className:le.value,children:`${n}, ${s}px`})]})]})},oa=()=>{const{themeSettings:t,setActiveFont:n,activeBlock:s}=e.useThemeSettingsStore();j.useEffect(()=>(o(),()=>{o()}),[]);function o(){n(null)}if(s!=null&&s.name)return e.jsxRuntimeExports.jsx("div",{className:le.wrapper,children:Object.entries(t.fonts.desktop).map(([a,r])=>e.jsxRuntimeExports.jsxs("div",{className:le.category,children:[e.jsxRuntimeExports.jsx("h2",{className:le.categoryTitle,children:oe(a)}),Object.entries(r).map(([i,l])=>e.jsxRuntimeExports.jsx(sa,{id:i,category:a,...l},i))]},a))})},na="_wrapper_16ym0_2",ra="_category_16ym0_6",ia="_categoryTitle_16ym0_12",aa="_color_16ym0_18",la="_name_16ym0_24",ca="_content_16ym0_29",ua="_label_16ym0_36",da="_input_16ym0_48",pa="_title_16ym0_74",xa="_field_16ym0_82",ma="_alignments_16ym0_92",ha="_lineField_16ym0_98",ga="_style_16ym0_106",ja="_header_16ym0_113",se={wrapper:na,category:ra,categoryTitle:ia,color:aa,name:la,content:ca,label:ua,input:da,title:pa,field:xa,alignments:ma,lineField:ha,style:ga,header:ja},Sa="_blocks_emecf_1",fa="_block_emecf_1",_a="_active_emecf_21",ot={blocks:Sa,block:fa,active:_a},_t=t=>{const{items:n,selectedItem:s,onSelect:o,getIconName:a}=t;return e.jsxRuntimeExports.jsx("div",{className:ot.blocks,children:n.map(r=>e.jsxRuntimeExports.jsx("div",{className:e.clx(ot.block,{[ot.active]:s===r}),onClick:()=>o(r),children:e.jsxRuntimeExports.jsx(e.Icon,{name:a(r),fill:s===r?"#252525":"#757575"})},String(r)))})},va=["left","center","right"],wa=["solid","dashed"],Ie=t=>{const{title:n,children:s,rightAddon:o}=t;return e.jsxRuntimeExports.jsxs("div",{className:se.field,children:[e.jsxRuntimeExports.jsxs("div",{className:se.header,children:[e.jsxRuntimeExports.jsx("h4",{className:se.categoryTitle,children:n}),o]}),s]})},Ca=()=>{const{themeSettings:t,updateInput:n}=e.useThemeSettingsStore(),s=j.useMemo(()=>t.inputs,[t]),o=(r,i,l)=>{n(r,i,l)},a=r=>i=>{n(r,i,"color")};return e.jsxRuntimeExports.jsxs("div",{className:se.wrapper,children:[e.jsxRuntimeExports.jsxs(Ie,{title:"General",children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Height (px)",value:String(s.general.height),onChange:r=>o("general",r,"height"),type:"number",min:0}),e.jsxRuntimeExports.jsx(e.Select,{label:"Font Size (px)",onChange:r=>o("general",r,"size"),value:String(s.general.size),options:Fe}),e.jsxRuntimeExports.jsx(xe,{initialColor:oe(s.general.color),onChange:a("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),e.jsxRuntimeExports.jsx(Ie,{title:"Field Fill",rightAddon:e.jsxRuntimeExports.jsx("div",{className:se.switch,children:e.jsxRuntimeExports.jsx(e.Switch,{onChange:r=>o("field",r,"active"),current:s.field.active})}),children:e.jsxRuntimeExports.jsx(xe,{initialColor:s.field.color,onChange:a("field"),title:"Color",labelStyle:"secondary"})}),e.jsxRuntimeExports.jsxs(Ie,{title:"Border",rightAddon:e.jsxRuntimeExports.jsx("div",{className:se.switch,children:e.jsxRuntimeExports.jsx(e.Switch,{onChange:r=>o("border",r,"active"),current:s.border.active})}),children:[e.jsxRuntimeExports.jsxs("div",{className:se.lineField,children:[e.jsxRuntimeExports.jsxs("div",{className:se.style,children:[e.jsxRuntimeExports.jsx("span",{className:se.title,children:"Style"}),e.jsxRuntimeExports.jsx(_t,{items:wa,selectedItem:s.border.style,onSelect:r=>o("border",r,"style"),getIconName:r=>r==="solid"?"Minus":"Selection"})]}),e.jsxRuntimeExports.jsx(e.Input,{label:"Radius (px)",value:String(s.border.radius),onChange:r=>o("border",r,"radius"),type:"number",min:0})]}),e.jsxRuntimeExports.jsx(e.Input,{label:"Thickness (px)",value:String(s.border.thickness),onChange:r=>o("border",r,"thickness"),type:"number",min:0}),e.jsxRuntimeExports.jsx(xe,{initialColor:oe(s.border.color),onChange:a("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),e.jsxRuntimeExports.jsxs(Ie,{title:"Label",children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Line Height (px)",value:String(s.label.height),onChange:r=>o("label",r,"height"),type:"number",min:0}),e.jsxRuntimeExports.jsx(e.Select,{label:"Font Size (px)",onChange:r=>o("label",r,"size"),value:String(s.label.size),options:Fe}),e.jsxRuntimeExports.jsx(xe,{initialColor:oe(s.label.color),onChange:a("label"),title:"Color",labelStyle:"secondary",isGradientActive:!1}),e.jsxRuntimeExports.jsxs("div",{className:se.alignments,children:[e.jsxRuntimeExports.jsx("h4",{className:se.title,children:"Alignment Type"}),e.jsxRuntimeExports.jsx(_t,{items:va,selectedItem:s.label.alignment,onSelect:r=>o("label",r,"alignment"),getIconName:r=>r==="center"?"AlignCenterHorizontal":r==="left"?"AlignLeft":"AlignRight"})]})]})]})},ba="_wrapper_1yw63_2",Ea="_category_1yw63_7",ka="_categoryTitle_1yw63_13",Ra="_color_1yw63_24",ya="_content_1yw63_33",Ta="_preview_1yw63_42",La="_container_1yw63_52",Na="_buttonWrapper_1yw63_62",Ba="_button_1yw63_62",Pa="_buttonBorder_1yw63_80",Aa="_buttonBackground_1yw63_83",Ia="_text_1yw63_87",$a="_textText_1yw63_93",Ma="_icon_1yw63_97",Fa="_iconIcon_1yw63_100",Ha="_annotation_1yw63_104",Da="_annotationText_1yw63_111",Oa="_label_1yw63_116",Ua="_circle_1yw63_127",Va="_line_1yw63_140",za="_circle1_1yw63_154",Ga="_circle2_1yw63_159",qa="_annotationIcon_1yw63_164",Wa="_annotationBorder_1yw63_192",Za="_line1_1yw63_203",Xa="_line2_1yw63_210",Ya="_circle3_1yw63_227",Ka="_circle4_1yw63_232",Ja="_annotationSurface_1yw63_237",k={wrapper:ba,category:Ea,categoryTitle:ka,color:Ra,content:ya,preview:Ta,container:La,buttonWrapper:Na,button:Ba,buttonBorder:Pa,buttonBackground:Aa,text:Ia,textText:$a,icon:Ma,iconIcon:Fa,annotation:Ha,annotationText:Da,label:Oa,circle:Ua,line:Va,circle1:za,circle2:Ga,annotationIcon:qa,annotationBorder:Wa,line1:Za,line2:Xa,circle3:Ya,circle4:Ka,annotationSurface:Ja},Qa=()=>{const{activeColorCategory:t}=e.useThemeSettingsStore();return e.jsxRuntimeExports.jsx("div",{className:k.container,children:e.jsxRuntimeExports.jsxs("div",{className:k.buttonWrapper,children:[e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.button,{[k.buttonBorder]:t==="border",[k.buttonBackground]:t==="surface"}),children:[e.jsxRuntimeExports.jsx(e.Icon,{name:"Smiley",className:e.clx(k.icon,{[k.iconIcon]:t==="text"}),width:22,height:22,fill:"#757575"}),e.jsxRuntimeExports.jsx("span",{className:e.clx(k.text,{[k.textText]:t==="text"}),children:"Button Example"})]}),t==="text"&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.annotation,k.annotationText),children:[e.jsxRuntimeExports.jsx("div",{className:k.label,children:"Text Color"}),e.jsxRuntimeExports.jsx("div",{className:k.line}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle2)})]}),t==="text"&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.annotation,k.annotationIcon),children:[e.jsxRuntimeExports.jsx("div",{className:k.label,children:"Icon Color"}),e.jsxRuntimeExports.jsx("div",{className:k.line}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle2)})]}),t==="border"&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.annotation,k.annotationBorder),children:[e.jsxRuntimeExports.jsx("div",{className:k.label,children:"Border Color"}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.line,k.line1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.line,k.line2)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle2)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle3)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle4)})]}),t==="surface"&&e.jsxRuntimeExports.jsxs("div",{className:e.clx(k.annotation,k.annotationSurface),children:[e.jsxRuntimeExports.jsx("div",{className:k.label,children:"Surface Color"}),e.jsxRuntimeExports.jsx("div",{className:k.line}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle1)}),e.jsxRuntimeExports.jsx("div",{className:e.clx(k.circle,k.circle2)})]})]})})},el=()=>{const{activeBlock:t,setActiveColorCategory:n,activeColorCategory:s,themeSettings:o,updateColor:a}=e.useThemeSettingsStore();function r(){n(null)}function i(g,p,h){a(g,p,h)}const l=!!((t==null?void 0:t.name)==="Colors"&&s),x=(t==null?void 0:t.name)!=="Colors"||!s;return e.jsxRuntimeExports.jsxs(Re,{isOpen:l,isClose:x,children:[e.jsxRuntimeExports.jsx(ke,{onClick:r,title:s==="text"?"Text & Icon Colors":`${oe(s)} Colors`}),s&&e.jsxRuntimeExports.jsxs("div",{className:k.wrapper,children:[e.jsxRuntimeExports.jsx(Qa,{}),Object.entries(o.colors[s]).map(([g,p])=>e.jsxRuntimeExports.jsx("div",{className:k.color,children:e.jsxRuntimeExports.jsxs("div",{className:k.content,children:[e.jsxRuntimeExports.jsx("div",{className:k.preview,style:{background:p}}),e.jsxRuntimeExports.jsx(xe,{title:oe(g),initialColor:p,onChange:h=>i(s,g,h),isGradientActive:s==="surface"})]})},g))]})]})},tl="_loader_1p5lr_1",sl={loader:tl},ol=()=>{const{activeBlock:t,themeSettings:n,isLoadingThemeSettings:s}=e.useThemeSettingsStore();return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:s?e.jsxRuntimeExports.jsx("div",{className:sl.loader,children:e.jsxRuntimeExports.jsx(e.Loader,{})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(t==null?void 0:t.name)==="Fonts"&&n.fonts&&e.jsxRuntimeExports.jsx(oa,{}),(t==null?void 0:t.name)==="Fonts"&&n.fonts&&e.jsxRuntimeExports.jsx(qi,{}),(t==null?void 0:t.name)==="Colors"&&n.colors&&e.jsxRuntimeExports.jsx(Ai,{}),(t==null?void 0:t.name)==="Colors"&&n.colors&&e.jsxRuntimeExports.jsx(el,{}),(t==null?void 0:t.name)==="Inputs"&&n.inputs&&e.jsxRuntimeExports.jsx(Ca,{}),(t==null?void 0:t.name)==="Borders"&&n.borders&&e.jsxRuntimeExports.jsx(hi,{}),(t==null?void 0:t.name)==="Buttons"&&n.buttons&&e.jsxRuntimeExports.jsx(Ni,{})]})})},nl=()=>{const{activeBlock:t,setActiveBlock:n}=e.useThemeSettingsStore(),{activeBlock:s}=e.useNavbarStore(),o=e.useNavigate();function a(){n(null),o("/admin/builder/theme")}const r=!!t,i=!t||s.name!=="Theme";return e.jsxRuntimeExports.jsxs(Re,{isOpen:r,isClose:i,children:[e.jsxRuntimeExports.jsx(ke,{onClick:a,title:(t==null?void 0:t.name)||""}),e.jsxRuntimeExports.jsx(ol,{})]})},rl=()=>{const{activeBlock:t}=e.useNavbarStore(),{showTooltip:n}=e.useTooltipStore();function s(){switch(t.name){case"Layers":return"Layers";case"Add":return"Add Sections";case"Theme":return"Theme Settings";case"Settings":return"Settings"}}return e.jsxRuntimeExports.jsxs("div",{className:ft.sidebar,style:{zIndex:n?50:"auto"},children:[e.jsxRuntimeExports.jsx("h3",{className:ft.title,children:s()}),t.name==="Layers"&&e.jsxRuntimeExports.jsx(wr,{}),t.name==="Add"&&e.jsxRuntimeExports.jsx(Rt,{}),e.jsxRuntimeExports.jsx(ii,{}),e.jsxRuntimeExports.jsx(nl,{}),t.name==="Theme"&&e.jsxRuntimeExports.jsx(Pr,{}),t.name==="Settings"&&e.jsxRuntimeExports.jsx(Rr,{})]})},il="_wrapper_no6if_1",al="_header_no6if_12",ll="_content_no6if_23",cl="_buttons_no6if_44",ul="_label_no6if_51",dl="_description_no6if_52",pl="_preview_no6if_60",xl="_block_no6if_66",ml="_slug_no6if_75",hl="_title_no6if_81",gl="_closeIcon_no6if_87",ee={wrapper:il,header:al,content:ll,buttons:cl,label:ul,description:dl,preview:pl,block:xl,slug:ml,title:hl,closeIcon:gl},jl="_wrapper_ba9vp_2",Sl="_label_ba9vp_10",fl="_options_ba9vp_18",_l="_radioLabel_ba9vp_24",vl="_radio_ba9vp_24",wl="_custom_ba9vp_39",Cl="_option_ba9vp_18",de={wrapper:jl,label:Sl,options:fl,radioLabel:_l,radio:vl,custom:wl,option:Cl},bl=t=>{const{defaultValue:n,options:s,onChange:o,label:a}=t,[r,i]=j.useState(n),l=x=>{const g=x.target.value;i(g),o(g)};return e.jsxRuntimeExports.jsxs("div",{className:de.wrapper,children:[e.jsxRuntimeExports.jsx("span",{className:de.label,children:a}),e.jsxRuntimeExports.jsx("div",{className:de.options,children:s.map(x=>e.jsxRuntimeExports.jsxs("label",{className:de.radioLabel,children:[e.jsxRuntimeExports.jsx("input",{type:"radio",value:x.value,checked:r===x.value,onChange:l,className:de.radio}),e.jsxRuntimeExports.jsx("span",{className:de.custom}),e.jsxRuntimeExports.jsx("span",{className:de.option,children:x.label})]},x.value))})]})},El=()=>{var H,A,M,V,T,Y,ne;const{setIsOpenModal:t,pages:n,createPage:s,updatePage:o,isEdit:a,setIsEdit:r,editedPage:i,setEditedPage:l,pageContext:x}=e.usePagesStore(),{setIsOpen:g}=e.useModalStore(),{createPage:p,updatePage:h}=e.useLayersStore(),[c,d]=j.useState(i?n&&((H=n[i])==null?void 0:H.path):""),[S,m]=j.useState(i?n&&((A=n[i])==null?void 0:A.name):""),[f,v]=j.useState(i?n&&((M=n[i])==null?void 0:M.seo)&&((T=(V=n[i])==null?void 0:V.seo)==null?void 0:T.pageDescription)||"":`${x.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`),[_,u]=j.useState(i&&n&&(Y=n[i])!=null&&Y.isPrivate?"private":"public");function C(){d(""),m(""),v(""),u("public"),r(!1),l(null)}function w(){g(!1),setTimeout(()=>{C(),t(!1),g(!0)},300)}function E(F){return F[0]==="/"?F:"/"+F}function b(){s({path:E(c),name:S||c||"",icon:"File",seo:{pageTitle:S||"",pageDescription:f||""},visibility:_||"public"}),p(E(c)),w()}function R(){n&&(h(n[i].path||"",c||""),o(i,{path:E(c),name:S||c,icon:n[i].icon||"File",seo:{pageTitle:S||"",pageDescription:f||""},visibility:_||"public"})),w()}return e.jsxRuntimeExports.jsxs("div",{className:ee.wrapper,onClick:F=>F.stopPropagation(),children:[e.jsxRuntimeExports.jsxs("div",{className:ee.header,children:[e.jsxRuntimeExports.jsx("h2",{children:a?"Edit Page":"Create New Page"}),e.jsxRuntimeExports.jsx("div",{className:ee.closeIcon,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:w})})]}),e.jsxRuntimeExports.jsxs("div",{className:ee.content,children:[e.jsxRuntimeExports.jsx(e.Input,{label:"Page Slug",onChange:F=>d(F),value:c,placeholder:"path-to-page",disabled:!!(i&&n&&((ne=n[i])!=null&&ne.name)&&e.defaultPagePaths.includes(n[i].path)),required:!0,regex:"^.+$"}),e.jsxRuntimeExports.jsx(e.Input,{label:"Page Title",onChange:F=>{m(F)},value:S.charAt(0).toUpperCase()+S.slice(1),placeholder:"Contact us"}),e.jsxRuntimeExports.jsx(e.Textarea,{label:"Description",onChange:F=>v(F),value:f,placeholder:`${x.general.info.name} is powered by the Billgang.com platform which allows them to sell their digital products online for free.`,maxLength:150}),e.jsxRuntimeExports.jsx(bl,{label:"Visibility",defaultValue:_,options:[{value:"public",label:"Public"},{value:"private",label:"Private"}],onChange:F=>u(F)}),e.jsxRuntimeExports.jsxs("div",{className:ee.preview,children:[e.jsxRuntimeExports.jsx("span",{className:ee.label,children:"Preview"}),e.jsxRuntimeExports.jsxs("div",{className:ee.block,children:[e.jsxRuntimeExports.jsx("span",{className:ee.slug,children:c||"yoursite.url"}),e.jsxRuntimeExports.jsx("span",{className:ee.title,children:S||"My Blank Page"}),e.jsxRuntimeExports.jsx("span",{className:ee.description,children:f||"It is My Description"})]})]})]}),e.jsxRuntimeExports.jsxs("div",{className:ee.buttons,children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:w,type:"Secondary",children:"Cancel"}),e.jsxRuntimeExports.jsx(e.Button,{onClick:a?R:b,disabled:c.length===0,children:a?"Update":"Create"})]})]})},kl="_layout_3kge3_1",Rl="_main_3kge3_10",yl="_content_3kge3_18",Tl="_notification_3kge3_26",$e={layout:kl,main:Rl,content:yl,notification:Tl},Ll="_modal_1h74q_1",Nl="_title_1h74q_14",Bl="_buttons_1h74q_20",Me={modal:Ll,title:Nl,buttons:Bl},yt=()=>{const{title:t,description:n,onConfirm:s,setTitle:o,setDescription:a,setOnConfirm:r}=e.useConfirmationModalStore(),{setIsOpen:i}=e.useModalStore();function l(){i(!1),setTimeout(()=>{o(null),a(null),r(null),i(!0)},300)}return t&&n&&s&&e.jsxRuntimeExports.jsxs("div",{className:Me.modal,onClick:x=>x.stopPropagation(),children:[e.jsxRuntimeExports.jsx("div",{className:Me.title,children:t}),e.jsxRuntimeExports.jsx("div",{className:Me.description,children:n}),e.jsxRuntimeExports.jsxs("div",{className:Me.buttons,children:[e.jsxRuntimeExports.jsx(e.Button,{onClick:l,children:"Cancel"}),e.jsxRuntimeExports.jsx(e.Button,{onClick:()=>{s(),l()},type:"Secondary",children:"Confirm"})]})]})},Pl=()=>{const{isOpenModal:t,setIsOpenModal:n}=e.usePagesStore(),{openModal:s,setOpenModal:o}=e.useChooseImageStore(),{notification:a,setNotification:r}=e.useNotificationStore(),{title:i,description:l,setTitle:x,setDescription:g,setOnConfirm:p}=e.useConfirmationModalStore(),[h,c]=j.useState(null);return j.useEffect(()=>{if(a){h&&clearTimeout(h);const d=setTimeout(()=>{r(null)},3e3);c(d)}},[a]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:$e.layout,children:[e.jsxRuntimeExports.jsx(fo,{}),e.jsxRuntimeExports.jsxs("main",{className:$e.main,children:[e.jsxRuntimeExports.jsx(co,{}),e.jsxRuntimeExports.jsxs("div",{className:$e.content,children:[e.jsxRuntimeExports.jsx(rl,{}),e.jsxRuntimeExports.jsx(Wn,{})]})]})]}),i&&l&&e.jsxRuntimeExports.jsx(e.Modal,{close:()=>{x(null),g(null),p(null)},children:e.jsxRuntimeExports.jsx(yt,{})}),t&&e.jsxRuntimeExports.jsx(e.Modal,{close:n,children:e.jsxRuntimeExports.jsx(El,{})}),s&&e.jsxRuntimeExports.jsx(e.Modal,{close:o,children:e.jsxRuntimeExports.jsx(e.ChooseImageModal,{})}),a&&e.jsxRuntimeExports.jsx("div",{className:$e.notification,children:e.jsxRuntimeExports.jsx(e.Tip,{message:a.message,type:a.status})})]})},Al=t=>{const{blocks:n,settings:s,header:o,footer:a,announcement:r}=t,{setBlocks:i,setSourceBlocks:l}=e.useBlocksStore(),{fonts:x,setFonts:g}=e.useFontsStore(),{setSettings:p}=e.useSettingsStore(),{setPageContext:h}=e.usePagesStore(),{setThemeSettings:c,setIsLoadingThemeSettings:d}=e.useThemeSettingsStore(),{setIsLoadingSettings:S}=e.useSettingsStore(),{setNotification:m}=e.useNotificationStore(),{setHeader:f,setFooter:v,setAnnouncement:_,setBlocks:u,blocks:C,createPage:w,setIsLoadingLayers:E}=e.useLayersStore(),{setPages:b,setCurrentPage:R}=e.usePagesStore();return j.useEffect(()=>{d(!0),E(!0),S(!0);const H={};Object.keys(n).forEach(M=>{H[M]=n[M]}),l(H),i(H),f(o),v(a),_(r),(async()=>{let M={listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null};const V=await Qt();Object.keys(V).map($=>{const q=$;M[q]=V[q].value.data}),h(M);const{data:T}=await ss();console.log("✅ Проверка структуры dataAll:",JSON.stringify(T,null,2)),(!(T!=null&&T.themeSettings)||!(T!=null&&T.layers)||!(T!=null&&T.settings))&&console.warn("⚠️ Некорректная структура API-ответа!",T);const{themeSettings:Y,layers:ne,settings:F}=T||{};if(F){const $=s;if(F.settings&&(Object.keys(F.settings).map(q=>{$[q]=F.settings[q]}),p($)),F.header){const q=o;Object.keys(F.header).map(ae=>{q[ae]=F.header[ae]}),f(q)}if(F.footer){const q=a;Object.keys(F.footer).map(ae=>{q[ae]=F.footer[ae]}),v(q)}}else p(s);Y&&c(Y);const J=await ts();console.log("Pages",J);const Z={};if(J.status>=400&&m({message:"Error fetching pages",status:"error"}),J.data.length>0?(J.data.forEach($=>{C[$.path]||w($.path),Z[$.id||$.path]={...$,icon:e.pages[$.path]?e.pages[$.path].icon:"File",name:$.name?$.name:e.pages[$.path].name}}),b(Z),R(Object.keys(Z)[0])):(b(e.pages),R(Object.keys(e.pages)[0])),x.length===0){const $=await es();g([...$.map(q=>q.family)])}u(ne),d(!1),E(!1),S(!1)})()},[]),e.jsxRuntimeExports.jsx(Pl,{})};function Il(){const t=new URL(window.location.href);window.history.replaceState(null,"",t.pathname+t.hash)}function $l(){const t=new URLSearchParams(document.location.search),n=t.get("shopId")||localStorage.getItem("shopId"),s=t.get("sellerAccessToken")||localStorage.getItem("sellerAccessToken"),o=t.get("draftId")||localStorage.getItem("draftId");return Il(),s&&localStorage.setItem("sellerAccessToken",s),n&&localStorage.setItem("shopId",n),o&&localStorage.setItem("draftId",o),!!(s&&n&&o)}const Ml=t=>{const{blocks:n,settings:s,header:o,footer:a,announcement:r}=t,[i,l]=j.useState(!0),x=e.useNavigate();return j.useEffect(()=>{l(!0),$l()?l(!1):x("/")},[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i?e.jsxRuntimeExports.jsx(e.Loader,{}):e.jsxRuntimeExports.jsx(Al,{blocks:n,settings:s,header:o,footer:a,announcement:r})})},Fl="_wrapper_1yd2j_1",Hl="_error_1yd2j_11",Dl="_title_1yd2j_21",Ol="_buttons_1yd2j_29",be={wrapper:Fl,error:Hl,title:Dl,buttons:Ol},vt=async t=>{const n=localStorage.getItem("shopId")||void 0,s=localStorage.getItem("draftId"),o=`${e.API_URL}/v2/builder/shops/${n}/drafts/${s}/reset`;return await e.request({url:o,withToken:!0,method:"post",body:t})},Ul=()=>{const{error:t,setError:n}=e.useErrorStore(),{pages:s}=e.usePagesStore(),{setIsOpen:o}=e.useModalStore(),{title:a,description:r,setOnConfirm:i,setTitle:l,setDescription:x}=e.useConfirmationModalStore(),{setBlocks:g}=e.useLayersStore();async function p(){await vt({resetSettings:(t==null?void 0:t.failedSettings)??!1,resetThemeSettings:(t==null?void 0:t.failedThemeSettings)??!1,resetPageIds:(t==null?void 0:t.failedPageIds)??[]}),n(null),g({}),window.location.reload()}async function h(){const c=[];s&&Object.keys(s).map(d=>s[d].id).filter(d=>d!==void 0).map(d=>c.push(d)),await vt({resetSettings:!0,resetThemeSettings:!0,resetPageIds:c}),n(null)}return e.jsxRuntimeExports.jsxs("div",{className:be.wrapper,children:[e.jsxRuntimeExports.jsxs("div",{className:be.error,children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:be.title,children:"Oops! Something went wrong"}),e.jsxRuntimeExports.jsx("span",{className:be.message,children:(t==null?void 0:t.message)||""})]}),e.jsxRuntimeExports.jsxs("div",{className:be.buttons,children:[e.jsxRuntimeExports.jsx(e.Button,{type:"Primary",onClick:p,children:"Reset Settings"}),e.jsxRuntimeExports.jsx(e.Button,{type:"Secondary",onClick:c=>{c.stopPropagation(),l("Reset All Settings"),x("Are you sure you want to reset all settings? This is irreversible."),i(async()=>{await h()})},children:"Reset All Settings"})]})]}),a&&r&&e.jsxRuntimeExports.jsx(e.Modal,{close:()=>{o(!1),setTimeout(()=>{l(null),x(null),i(null),o(!0)},300)},children:e.jsxRuntimeExports.jsx(yt,{})})]})},Vl=t=>{const{children:n}=t,{pathname:s}=e.useLocation(),{setActiveBlock:o}=e.useNavbarStore(),{setActiveBlock:a}=e.useThemeSettingsStore(),{setActiveBlock:r}=e.usePreviewStore();return j.useEffect(()=>{switch(r({id:null,neededScroll:!1}),s){case"/admin/builder":o(e.navbarBlocks[0]);break;case"/admin/builder/add":o(e.navbarBlocks[1]);break;case"/admin/builder/theme":o(e.navbarBlocks[2]);break;case"/admin/builder/settings":o(e.navbarBlocks[3]);break;case"/admin/builder/theme/colors":o(e.navbarBlocks[2]),a(Se[0]);break;case"/admin/builder/theme/fonts":o(e.navbarBlocks[2]),a(Se[1]);break;case"/admin/builder/theme/borders":o(e.navbarBlocks[2]),a(Se[2]);break;case"/admin/builder/theme/buttons":o(e.navbarBlocks[2]),a(Se[3]);break;case"/admin/builder/theme/inputs":o(e.navbarBlocks[2]),a(Se[4]);break}},[s]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:n})},zl="_lock_1mxa7_1",Gl="_wrapper_1mxa7_12",ql="_content_1mxa7_22",Wl="_info_1mxa7_31",Zl="_buttons_1mxa7_38",Xl="_button_1mxa7_38",Yl="_input_1mxa7_50",Kl="_error_1mxa7_57",te={lock:zl,wrapper:Gl,content:ql,info:Wl,buttons:Zl,button:Xl,input:Yl,error:Kl},Jl=()=>{const[t,n]=j.useState(!1),[s,o]=j.useState(!1),[a,r]=j.useState(""),{general:i,setGeneral:l}=e.useGeneralStore(),{setThemeSettings:x}=e.useThemeSettingsStore(),g=e.useNavigate();j.useEffect(()=>{i&&i.info.passwordProtected&&g("/")},[i]),j.useEffect(()=>{(async()=>{if(n(!0),!i){const c=localStorage.getItem("shopPassword")||"",d=await He(c);d.isPasswordValid&&g("/"),l(d);const{theme:S}=(await Ct()).data;x(S)}n(!1)})()},[]);async function p(){n(!0),(await He(a)).isPasswordValid?(localStorage.setItem("shopPassword",a),g("/")):o(!0),n(!1)}return e.jsxRuntimeExports.jsxs("div",{className:te.wrapper,children:[!t&&e.jsxRuntimeExports.jsxs("div",{className:te.content,children:[e.jsxRuntimeExports.jsx("div",{className:te.lock,children:e.jsxRuntimeExports.jsx(e.Icon,{name:"Lock",fill:"var(--text-secondary)",width:64,height:64})}),e.jsxRuntimeExports.jsxs("div",{className:te.info,children:[e.jsxRuntimeExports.jsx("h2",{id:"h2",className:te.title,children:"The store is password protected"}),e.jsxRuntimeExports.jsx("p",{id:"p",className:te.description,children:"If you do not have a password, we recommend you to contact the technical support of the store or write to the mail"})]}),e.jsxRuntimeExports.jsxs("div",{className:te.input,children:[e.jsxRuntimeExports.jsx(e.Input$1,{type:"password",onChange:h=>{o(!1),r(h)},value:a,placeholder:"Password",required:!0}),e.jsxRuntimeExports.jsx("span",{className:te.error,children:s&&"Incorrect password"})]}),e.jsxRuntimeExports.jsxs("div",{className:te.buttons,children:[e.jsxRuntimeExports.jsx(e.Button$1,{type:"Secondary",className:te.button,children:"Contact Support"}),e.jsxRuntimeExports.jsx(e.Button$1,{type:"Primary",className:te.button,disabled:s,onClick:p,children:"Submit"})]})]}),t&&e.jsxRuntimeExports.jsx(e.Loader,{})]})},Ql=({children:t})=>{if(e.useLocation().pathname.startsWith("/admin/builder"))return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t});const[s,o]=j.useState(!0),{setThemeSettings:a,themeSettings:r}=e.useThemeSettingsStore(),{settings:i,setSettings:l}=e.useSettingsStore(),{setHeader:x,setFooter:g,setAnnouncement:p,header:h,footer:c,announcement:d}=e.useLayersStore(),{general:S,setGeneral:m}=e.useGeneralStore(),{pageContext:f,setPageContext:v}=e.usePagesStore(),_=e.useNavigate();return j.useEffect(()=>{o(!0);const u=async()=>{if(!S){const w=await He();w.isPasswordValid||_("/validation"),m(w)}},C=async()=>{const{settings:w,theme:E}=(await Ct()).data,b=await Et(encodeURIComponent("/products"));if(b){const{data:R}=b;v({...f,listings:R.listings})}else v({...f});if(w&&i){const R=i;if(w.settings?(Object.keys(w.settings).map(H=>{R[H]=w.settings[H]}),l(R)):l(i),w.header&&h){const H=h;Object.keys(w.header).map(A=>{H[A]=w.header[A]}),x(H)}if(w.footer&&c){const H=c;Object.keys(w.footer).map(A=>{H[A]=w.footer[A]}),g(H)}if(w.announcement&&d){const H=d;Object.keys(w.announcement).map(A=>{H[A]=w.announcement[A]}),p(H)}}else l(i);a(r),a(E||r),o(!1)};u(),C()},[]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:s?e.jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsxRuntimeExports.jsx(e.Loader,{})}):t})},ec=()=>(j.useEffect(()=>{setTimeout(()=>{window.location.reload()},500)},[]),e.jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsxRuntimeExports.jsx(e.Loader,{})})),tc="_wrapper_rccv2_1",sc="_content_rccv2_11",oc="_title_rccv2_21",nt={wrapper:tc,content:sc,title:oc},pe=()=>{const t=e.useNavigate();return e.jsxRuntimeExports.jsx("div",{className:nt.wrapper,children:e.jsxRuntimeExports.jsxs("div",{className:nt.content,children:[e.jsxRuntimeExports.jsx("h1",{className:nt.title,children:"Something went wrong"}),e.jsxRuntimeExports.jsx(e.Button,{type:"Primary",onClick:()=>t("/"),children:"Go to Home"})]})})},nc=t=>{const{blocks:n,settings:s,header:o,footer:a,announcement:r}=t,[i,l]=j.useState(null),{setBlocks:x,setSourceBlocks:g}=e.useBlocksStore(),{setSettings:p}=e.useSettingsStore(),{setHeader:h,setFooter:c,setAnnouncement:d}=e.useLayersStore(),{themeSettings:S}=e.useThemeSettingsStore(),{settings:m}=e.useSettingsStore(),f=window.location.hostname.includes("localhost")?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,v=localStorage.getItem("shopPassword"),_=localStorage.getItem("shopId")||"";return j.useEffect(()=>{if(!i){const u={};Object.keys(n).map(w=>{u[w]=n[w]}),g(u),x(u),h(o),c(a),p(s),d(r);const C=e.createBrowserRouter([{element:e.jsxRuntimeExports.jsx(e.hI,{shopDomain:f,shopId:_,shopPassword:v||void 0,routes:{Checkout:"/checkout",TopUp:"/top-up",Charge:"/charges",Order:"/orders",Subscription:"/subscriptions"},children:e.jsxRuntimeExports.jsx(Ql,{children:e.jsxRuntimeExports.jsx(e.Outlet,{})})}),errorElement:e.jsxRuntimeExports.jsx(ec,{}),children:[{path:"/admin/builder/*",element:e.jsxRuntimeExports.jsx(Vl,{children:e.jsxRuntimeExports.jsx(Ml,{blocks:n,settings:s,header:o,footer:a,announcement:r})}),errorElement:e.jsxRuntimeExports.jsx(Ul,{})},{path:"/checkout",element:e.jsxRuntimeExports.jsx(e.gI,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/top-up",element:e.jsxRuntimeExports.jsx(e.CI,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/charges/:id",element:e.jsxRuntimeExports.jsx(e._I,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/orders/:id/:accessToken?",element:e.jsxRuntimeExports.jsx(e.yI,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/subscriptions/:id/:accessToken?",element:e.jsxRuntimeExports.jsx(e.xI,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/customer-dash",element:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden"},children:[e.jsxRuntimeExports.jsx(Oe,{}),e.jsxRuntimeExports.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:e.jsxRuntimeExports.jsx(e.vI,{})}),e.jsxRuntimeExports.jsx(De,{})]}),errorElement:e.jsxRuntimeExports.jsx(pe,{})},{path:"/validation",element:e.jsxRuntimeExports.jsx(Jl,{})},{path:"/ticket/:id/:accessToken",element:e.jsxRuntimeExports.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden"},children:[e.jsxRuntimeExports.jsx(Oe,{}),e.jsxRuntimeExports.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:e.jsxRuntimeExports.jsx(e.Z2,{children:e.jsxRuntimeExports.jsx(e.bI,{})})}),e.jsxRuntimeExports.jsx(De,{})]})},{path:"*",element:e.jsxRuntimeExports.jsx(js,{}),errorElement:e.jsxRuntimeExports.jsx(pe,{})}]}]);l(C)}},[i]),j.useEffect(()=>{const u=Ss(S,m);bs(S),fs(u)},[S,m]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:i&&e.jsxRuntimeExports.jsx(e.RouterProvider,{router:i})})};exports.ReCaptchaProvider=e.Z2;exports.splitTextIntoSpans=e.splitTextIntoSpans;exports.useReCaptcha=e.bi;exports.App=nc;exports.ColorVariables=wt;exports.createTicket=ks;exports.hotReload=Es;exports.iconNames=At;
|