@billgangcom/theme-lib 1.66.2 → 1.66.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/ui.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-yNJDaEUC.cjs"),_=require("react"),ct="_wrapper_kh9z8_2",lt="_block_kh9z8_8",ut="_title_kh9z8_16",dt="_subtitle_kh9z8_23",xt="_alignmentContent_kh9z8_30",pt="_alignments_kh9z8_39",mt="_alignment_kh9z8_30",jt="_circle_kh9z8_64",ht="_paddings_kh9z8_71",_t="_padding_kh9z8_71",gt="_active_kh9z8_97",ft="_input_kh9z8_104",V={wrapper:ct,block:lt,title:ut,subtitle:dt,alignmentContent:xt,alignments:pt,alignment:mt,circle:jt,paddings:ht,padding:_t,active:gt,input:ft},vt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Et=["left","top","right","bottom"],Rt=a=>{const{alignment:i,padding:o,setPadding:s,setAlignment:e,isAlignment:c=!0,isPadding:u=!0}=a;function p(m){switch(m){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function j(m){switch(m){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[d,$]=_.useState(null),[E,n]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:V.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:V.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:V.alignmentContent,children:[c&&t.jsxRuntimeExports.jsxs("div",{className:V.block,children:[t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:V.alignments,children:vt.map(m=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(m)},className:V.alignment,onMouseEnter:()=>{$(m)},onMouseLeave:()=>{$(null)},children:[m!==i&&d!==m&&t.jsxRuntimeExports.jsx("div",{className:V.circle}),m!==i&&d===m&&t.jsxRuntimeExports.jsx(t.Icon,{name:p(d),fill:"#c2c2c2",width:22,height:22}),m===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:p(i),fill:"#FF3F19",width:22,height:22})]},m))})]}),u&&t.jsxRuntimeExports.jsxs("div",{className:V.block,children:[t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:V.paddings,children:Et.map(m=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(V.padding,{[V.active]:E===m}),onFocus:()=>{n(m)},onBlur:()=>{n(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:j(m),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[m]),onChange:r=>s({...o,[m]:Math.min(Number(r),999)}),max:999,paddingless:!0,borderless:!0})]},m))})]})]})]})},yt="_title_82zux_1",bt="_subtitle_82zux_5",It="_header_82zux_12",St="_text_82zux_13",Nt="_productsBlock_82zux_14",$t="_top_82zux_26",kt="_itemsBlock_82zux_35",Ct="_typeTexts_82zux_41",Bt="_block_82zux_48",wt="_active_82zux_61",Pt="_products_82zux_14",qt="_product_82zux_14",Tt="_button_82zux_80",Mt="_disabled_82zux_91",At="_image_82zux_95",Ot="_info_82zux_102",Dt="_name_82zux_114",Lt="_buttons_82zux_118",zt="_modal_82zux_125",Ft="_link_82zux_145",Vt="_modalOptions_82zux_151",Ut="_addButton_82zux_157",Ht="_deleteButton_82zux_179",U={title:yt,subtitle:bt,header:It,text:St,productsBlock:Nt,top:$t,itemsBlock:kt,typeTexts:Ct,block:Bt,active:wt,products:Pt,product:qt,button:Tt,disabled:Mt,image:At,info:Ot,name:Dt,buttons:Lt,modal:zt,link:Ft,modalOptions:Vt,addButton:Ut,deleteButton:Ht};function Yt({id:a,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:c,transition:u,isDragging:p}=t.useSortable({id:a}),j={transform:t.CSS.Transform.toString(c),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:e,style:j,className:`${U.product} ${p?U.dragging:""}`,...o,...s,children:i})}const Wt=a=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:c,tags:u,title:p,subtitle:j,draggable:d=!1,withImage:$=!1,addable:E=!0,itemsOptions:n,hasRangeSelector:m=!1,rangeSelectorOptions:r,limit:w,autoScrollInterval:h,deletable:y,aspectRatio:b,setAspectRatio:T}=a,D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),A=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const v=s.findIndex(P=>P===I.id),k=s.findIndex(P=>P===S.id);if(v!==-1&&k!==-1){const P=[...s],[g]=P.splice(v,1);P.splice(k,0,g),e(P)}}};function f(x){if($)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const L=(x,I=!1)=>{const S=n.find(k=>k.id===x);if(!S)return;const v=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:k=>{const P=[...s],g=n.find(l=>l.name===k);if(!g)return;const q=g.id,z=P.map(l=>l===x?q:l);e([...z])},value:S.name,options:n.filter(k=>!s.find(P=>P===k.id)).map(k=>k.name),leftAddonOptions:n.map(k=>({value:k.name,addon:f(k.images)}))}),I&&t.jsxRuntimeExports.jsx("div",{className:U.buttons,children:t.jsxRuntimeExports.jsx("div",{className:U.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(k=>k!==x))})})})]});return d?t.jsxRuntimeExports.jsx(Yt,{id:x,children:v},t.v4()):t.jsxRuntimeExports.jsx("div",{className:U.product,children:v},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:U.productsBlock,children:[(p||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:U.top,children:[p&&t.jsxRuntimeExports.jsx("h3",{className:U.title,children:p}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),m&&r&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...r}),t.jsxRuntimeExports.jsxs("div",{className:U.products,children:[j&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:j}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:A,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>L(x,y))})}):s.map(x=>L(x,y)),E&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(U.button,{[U.disabled]:!!(w&&w<=s.length||s.length===n.length)}),size:"s",disabled:!!(w&&w<=s.length||s.length===n.length),onClick:()=>{const x=[...s];let I=null;if(n){for(let S=0;S<n.length;S++)if(!s.find(v=>v===n[S].id)){I=n[S];break}}x.push((I==null?void 0:I.id)||n[0].id),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:U.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),b&&T&&t.jsxRuntimeExports.jsx(t.Select,{value:b,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>T(x),leftAddonOptions:t.aspectRatioOptions}),u!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:u}),c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:c}),h!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(h.scrollInterval),onChange:x=>h.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Gt="_title_roi3a_1",Xt="_subtitle_roi3a_5",Qt="_header_roi3a_12",Jt="_text_roi3a_13",Kt="_productsBlock_roi3a_14",Zt="_top_roi3a_26",te="_itemsBlock_roi3a_35",ee="_typeTexts_roi3a_41",se="_block_roi3a_48",ne="_active_roi3a_61",ie="_products_roi3a_14",oe="_product_roi3a_14",re="_button_roi3a_80",ae="_disabled_roi3a_91",ce="_image_roi3a_95",le="_info_roi3a_102",ue="_name_roi3a_114",de="_buttons_roi3a_118",xe="_modal_roi3a_125",pe="_link_roi3a_145",me="_modalOptions_roi3a_151",je="_addButton_roi3a_164",he="_deleteButton_roi3a_179",_e="_closeIcon_roi3a_191",F={title:Gt,subtitle:Xt,header:Qt,text:Jt,productsBlock:Kt,top:Zt,itemsBlock:te,typeTexts:ee,block:se,active:ne,products:ie,product:oe,button:re,disabled:ae,image:ce,info:le,name:ue,buttons:de,modal:xe,link:pe,modalOptions:me,addButton:je,deleteButton:he,closeIcon:_e};function ge({product:a,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:c,transition:u,isDragging:p}=t.useSortable({id:a.id}),j={transform:t.CSS.Transform.toString(c),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:e,style:j,className:`${F.product} ${p?F.dragging:""}`,...o,...s,children:i})}const fe=a=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,title:c,subtitle:u,editable:p=!0,draggable:j=!1,deletable:d=!0,addable:$=!0,itemsType:E,itemsOptions:n,addableOptions:m={},limit:r}=a,[w,h]=_.useState(null),[y,b]=_.useState(null),T=_.useRef(null),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{if(w){const x=[...s].map(I=>I.id===w.id?w:I);e(x)}},[w]),_.useEffect(()=>{T.current&&y&&(T.current.getBoundingClientRect().height,y.top)},[T.current,y]);const A=(x,I)=>{x.stopPropagation();const S=x.target.getBoundingClientRect();b({top:S.top+window.scrollY,left:S.left-30}),h(I)},f=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const v=s.findIndex(P=>P.id===I.id),k=s.findIndex(P=>P.id===S.id);if(v!==-1&&k!==-1){const P=[...s],[g]=P.splice(v,1);P.splice(k,0,g),e(P)}}},L=(x,I)=>{const S=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[j&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),E==="select"&&n&&t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const k=[...s],P=n.find(q=>q.name===v);if(!P)return;const g=k.map(q=>q.id===x.id?{...P,name:{"en-US":v}}:q);h({...x,name:{"en-US":v}}),e([...g])},value:x.name,options:n.filter(v=>!s.find(k=>k.name===v.name)).map(v=>v.name)}),t.jsxRuntimeExports.jsxs("div",{className:F.buttons,children:[p&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:v=>A(v,x)})}),d&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(v=>v.id!==x.id))})})]})]});return j?t.jsxRuntimeExports.jsx(ge,{product:x,index:I,children:S},x.id):t.jsxRuntimeExports.jsx("div",{className:F.product,children:S},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:u}),j?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:f,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,I)=>L(x,I))})}):s.map((x,I)=>L(x,I)),$&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(F.button,{[F.disabled]:!!(r&&r<=s.length||s.length===(n==null?void 0:n.length))}),size:"s",disabled:!!(r&&r<=s.length||s.length===(n==null?void 0:n.length)),onClick:()=>{const x=[...s];let I=null;if(n){for(let S=0;S<n.length;S++)if(!s.find(v=>v.id===n[S].id)){I=n[S];break}}E==="select"&&n&&x.push({name:I?I.name:n[0].name,id:(I==null?void 0:I.id)||n[0].id,...m}),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function ve(a){const{product:i,children:o}=a,{attributes:s,listeners:e,setNodeRef:c,transform:u,transition:p,isDragging:j}=t.useSortable({id:i.id}),d={transform:t.CSS.Transform.toString(u),transition:p};return t.jsxRuntimeExports.jsx("div",{ref:c,style:d,className:`${t.styles.product} ${j?t.styles.dragging:""}`,...s,...e,children:o})}const Ee=a=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:c,title:u,subtitle:p,editable:j=!0,draggable:d=!1,deletable:$=!0,addable:E=!0,itemsType:n,itemsPlaceholder:m="",itemsOptions:r,hasRangeSelector:w=!1,rangeSelectorOptions:h,modalOptions:y,addableOptions:b={},limit:T}=a,[D,A]=_.useState(null),[f,L]=_.useState({top:0,left:0}),[x,I]=_.useState(null),S=_.useRef(null),[v,k]=_.useState(!1),P=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const l=()=>{A(null),k(!1)};return document.body.addEventListener("click",l),A(null),k(!1),()=>{A(null),k(!1),document.body.removeEventListener("click",l)}},[]),_.useEffect(()=>{if(D){const l=[...s].map(B=>B.id===D.id?D:B);e(l)}},[D]),_.useEffect(()=>{if(S.current&&x){const l=S.current.getBoundingClientRect().height,B=window.innerHeight;let R=x.top;R+l>B+window.scrollY-200&&(R=B+window.scrollY-l-200),R<0&&(R=10),L({top:R,left:x.left})}},[S.current,x]);const g=(l,B)=>{l.stopPropagation();const R=l.target.getBoundingClientRect();I({top:R.top+window.scrollY,left:R.left-30}),A(B),k(!0)},q=l=>{const{active:B,over:R}=l;if(R&&B.id!==R.id){const M=s.findIndex(O=>O.id===B.id),W=s.findIndex(O=>O.id===R.id);if(M!==-1&&W!==-1){const O=[...s],[Y]=O.splice(M,1);O.splice(W,0,Y),e(O)}}},z=l=>{var R;const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),n==="select"&&r&&t.jsxRuntimeExports.jsx(t.Select,{onChange:M=>{const O=[...s].map(Y=>Y.id===l.id?{...l,name:{"en-US":M}}:Y);A({...l,name:{"en-US":M}}),e([...O])},value:l.name["en-US"],options:r.filter(M=>!s.find(W=>W.name["en-US"]===M))}),n==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:M=>{const O=[...s].map(Y=>Y.id===l.id?{...l,name:{"en-US":M}}:Y);e([...O])},value:l.name["en-US"],placeholder:m}),n==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:M=>{const O=[...s].map(Y=>Y.id===l.id?{...l,images:M}:Y);e([...O])},activeImage:(R=s.find(M=>M.id===l.id))==null?void 0:R.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[j&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:M=>g(M,l)})}),$&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(M=>M.id!==l.id))})})]})]});return d?t.jsxRuntimeExports.jsx(ve,{product:l,children:B},l.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:B},l.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:l=>o==null?void 0:o(l)})]}),D&&j&&y&&v&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:S,activeItem:D,setActiveItem:A,popupPosition:f,modalOptions:y,setIsOpenModal:k}),w&&h&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...h}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[p&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:p}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:P,onDragEnd:q,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(l=>l.id),strategy:t.verticalListSortingStrategy,children:s.map(l=>z(l))})}):s.map(l=>z(l)),E&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(t.styles.button,{[t.styles.disabled]:!!(T&&T<=s.length)}),size:"s",disabled:!!(T&&T<=s.length),onClick:()=>{const l=[...s];let B=null;if(r){for(let R=0;R<r.length;R++)if(!s.find(M=>M.name["en-US"]===r[R])){B=r[R];break}}n==="select"&&r?l.push({name:{"en-US":B||r[0]},id:t.v4(),...b,maxSymbols:100}):n==="input"?l.push({name:{"en-US":""},id:t.v4(),...b,maxSymbols:100}):l.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...b,maxSymbols:100}),e(l)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:c})]})},Re="_subtitle_jql1y_1",ye="_header_jql1y_8",be="_text_jql1y_9",Ie="_productsBlock_jql1y_10",Se="_buttonsBlock_jql1y_11",Ne="_top_jql1y_23",$e="_itemsBlock_jql1y_32",ke="_typeTexts_jql1y_38",Ce="_block_jql1y_45",Be="_active_jql1y_58",we="_products_jql1y_10",Pe="_product_jql1y_10",qe="_button_jql1y_11",Te="_image_jql1y_88",Me="_info_jql1y_95",Ae="_name_jql1y_107",Oe="_buttons_jql1y_11",De="_modal_jql1y_118",Le="_other_jql1y_138",ze="_options_jql1y_144",Fe="_addButton_jql1y_150",Ve="_deleteButton_jql1y_165",G={subtitle:Re,header:ye,text:be,productsBlock:Ie,buttonsBlock:Se,top:Ne,itemsBlock:$e,typeTexts:ke,block:Ce,active:Be,products:we,product:Pe,button:qe,image:Te,info:Me,name:Ae,buttons:Oe,modal:De,other:Le,options:ze,addButton:Fe,deleteButton:Ve},et=a=>{const{buttons:i,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:c=!0}=a,{pages:u}=t.usePagesStore(),[p,j]=_.useState(null),[d,$]=_.useState({top:0,left:0}),[E,n]=_.useState(null),m=_.useRef(null);_.useEffect(()=>{if(p){const h=[...i].map(y=>y.id===p.id?p:y);o(h)}},[p]),_.useEffect(()=>{if(m.current&&E){const h=m.current.getBoundingClientRect().height,y=window.innerHeight;let b=E.top;b+h>y+window.scrollY-200&&(b=y+window.scrollY-h-200),b<0&&(b=10),$({top:b,left:E.left})}},[m.current,E]);const r=(h,y)=>{h.stopPropagation();const b=h.target.getBoundingClientRect();n({top:b.top+window.scrollY-70,left:b.left-(e?30:65)}),j(y)},w=(h,y)=>{const b=[...i],T={...h,id:Math.random().toString(36).substr(2,9)};b.splice(y+1,0,T),o(b)};return t.jsxRuntimeExports.jsxs("div",{className:G.products,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:"Button Type"}),i.map((h,y)=>t.jsxRuntimeExports.jsxs("div",{className:G.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:b=>{const D=[...i].map(A=>A.id===h.id?{...h,type:b}:A);o(D)},value:h.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:G.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{w(h,y)}})}),t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:b=>{r(b,h)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const b=i.filter(T=>T.id!==h.id);o(b)},width:20,height:20,fill:"#C12A2A"})})]})]},h.id)),p&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:m,activeButton:p,setActiveButton:j,popupPosition:d,editableLink:c}),e&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:G.button,size:"s",onClick:()=>{const h=[...i];c?h.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:u?Object.values(u)[0].path:"/",openInNewTab:!1}):h.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:u?Object.values(u)[0].path:"/",openInNewTab:!1}),o(h)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:G.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Ue=a=>{const{isActiveButtons:i,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:c=!0,addable:u=!0,deletable:p=!0}=a;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.top,children:[t.jsxRuntimeExports.jsx("h3",{className:t.styles$1.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:j=>o(j)})]}),i&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:e,editableLink:c,addable:u,deletable:p})]})})};function He(a){const{product:i,children:o}=a,{attributes:s,listeners:e,setNodeRef:c,transform:u,transition:p,isDragging:j}=t.useSortable({id:String(i.listingId)}),d={transform:t.CSS.Transform.toString(u),transition:p};return t.jsxRuntimeExports.jsx("div",{ref:c,style:d,className:`${t.styles$2.product} ${j?t.styles$2.dragging:""}`,...s,...e,children:o})}const Ye=a=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:c,title:u,subtitle:p,editable:j=!0,draggable:d=!1,withImage:$=!1,deletable:E=!0,addable:n=!0,itemsType:m,itemsOptions:r,limit:w,aspectRatio:h,setAspectRatio:y}=a,[b,T]=_.useState(null),[D,A]=_.useState({top:0,left:0}),[f,L]=_.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const g=()=>{T(null),L(!1)};return document.body.addEventListener("click",g),T(null),L(!1),()=>{T(null),L(!1),document.body.removeEventListener("click",g)}},[]),_.useEffect(()=>{if(b){const g=[...s].map(q=>q.listingId===b.listingId?b:q);e(g)}},[b]);const I=(g,q)=>{g.stopPropagation();const z=g.target.getBoundingClientRect(),l=100,B=window.innerHeight;let R=z.top+window.scrollY;R+l>B&&(R=B-l-20),L(!0),A({top:R-80,left:z.left-30}),T(q)};function S(g){if($)return g?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${g}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const v=g=>{const{active:q,over:z}=g;if(z&&q.id!==z.id){const l=s.findIndex(R=>String(R.listingId)===q.id),B=s.findIndex(R=>String(R.listingId)===z.id);if(l!==-1&&B!==-1){const R=[...s],[M]=R.splice(l,1);R.splice(B,0,M),e(R)}}},k=g=>{const q=r.find(l=>g.listingId===l.id);if(!q)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:l=>{const B=[...s],R=r.find(O=>O.productData.name===l);if(!R)return;const M={listingId:R.id,image:R.productData.images.length>0?R.productData.images[0].cfId:""},W=B.map(O=>O.listingId===g.listingId?M:O);T(M),e([...W])},value:q.productData.name,options:[...r.filter(l=>!s.find(B=>B.listingId===l.id)).map(l=>l.productData.name)],leftAddonOptions:r.map(l=>{var B;return{value:l.productData.name,addon:S(((B=l.productData.images[0])==null?void 0:B.cfId)||"")}})}),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[j&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:l=>I(l,g)})}),E&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(l=>l!==g))})})]})]});return d?t.jsxRuntimeExports.jsx(He,{product:g,children:z},g.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},g.listingId)},P=_.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:g=>o==null?void 0:o(g)})]}),f&&b&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:P,activeItem:b,setActiveItem:T,setIsOpenModal:L,popupPosition:D,itemsOptions:r}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[p&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:p}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:v,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>String(g.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(g=>k(g))})}):s.map(g=>k(g)),n&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles$2.button,size:"s",onClick:()=>{const g=[...s];for(let q=0;q<r.length;q++)if(!s.find(z=>z.listingId===r[q].id)){g.push({listingId:r[q].id,image:r[q].productData.images.length>0?r[q].productData.images[0].cfId:""});break}e(g)},disabled:s.length===(w||r.length),style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),h&&y&&t.jsxRuntimeExports.jsx(t.Select,{value:h,options:Object.keys(t.aspectRatio),onChange:g=>y(g),leftAddonOptions:t.aspectRatioOptions}),i&&c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:c})]})},We="_options_1vlf9_1",Ge="_price_1vlf9_13",Xe="_oldPrice_1vlf9_20",Qe="_newPrice_1vlf9_28",Je="_animate_1vlf9_35",Ke="_appearAndBounce_1vlf9_1",Ze="_meta_1vlf9_53",ts="_info_1vlf9_59",es="_infoRight_1vlf9_67",ss="_buttons_1vlf9_74",ns="_variants_1vlf9_81",is="_variant_1vlf9_81",os="_stock_1vlf9_99",rs="_variantInfo_1vlf9_106",as="_quantity_1vlf9_112",cs="_count_1vlf9_119",ls="_focused_1vlf9_136",us="_button_1vlf9_74",ds="_activeVariant_1vlf9_162",xs="_chargeTypes_1vlf9_166",ps="_charge_1vlf9_166",ms="_chargeActive_1vlf9_191",js="_title_1vlf9_199",C={options:We,price:Ge,oldPrice:Xe,newPrice:Qe,animate:Je,appearAndBounce:Ke,meta:Ze,info:ts,infoRight:es,buttons:ss,variants:ns,variant:is,stock:os,variantInfo:rs,quantity:as,count:cs,focused:ls,button:us,activeVariant:ds,chargeTypes:xs,charge:ps,chargeActive:ms,title:js};var K=(a=>(a.ONE_TIME="One-Time",a.RECURRING="Subscribe & Save",a))(K||{});const st=a=>{var D,A;const{product:i,setIsOpen:o}=a,{variants:s}=i,[e,c]=_.useState(s[0]),[u,p]=_.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),j=t.useNavigate(),[d,$]=_.useState(1),{reset:E,addProductToCart:n,addProducts:m}=t.di(),[r,w]=_.useState(!1),{pageContext:h}=t.usePagesStore();_.useEffect(()=>{w(!0);const f=setTimeout(()=>w(!1),600);return()=>clearTimeout(f)},[d]);async function y(){await m((h==null?void 0:h.products)||[]),await n({productId:i.id,productVariantId:e.id,quantity:d}),o==null||o(!1)}function b(){E(),y(),j("/checkout")}function T(f){if(f>=864e5){const v=Math.floor(f/864e5);return`${v} ${v===1?"day":"days"}`}else if(f>=36e5){const v=Math.floor(f/36e5);return`${v} ${v===1?"hour":"hours"}`}else if(f>=6e4){const v=Math.floor(f/6e4);return`${v} ${v===1?"minute":"minutes"}`}else{const v=Math.floor(f/1e3);return`${v} ${v===1?"second":"seconds"}`}}return _.useEffect(()=>{e.quantity&&e.quantity.available===0&&$(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:C.options,children:[e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:C.chargeTypes,children:e.chargeTypes.map(f=>t.jsxRuntimeExports.jsx("div",{className:t.clx(C.charge,{[C.chargeActive]:u===f}),onClick:()=>p(f),children:K[f]},f))}),t.jsxRuntimeExports.jsx("div",{className:C.variants,children:s.map(f=>{var L,x;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(C.variant,{[C.activeVariant]:e.id===f.id}),onClick:()=>c(f),children:[t.jsxRuntimeExports.jsxs("div",{className:C.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:C.title,children:t.splitTextIntoSpans(f.name)}),t.jsxRuntimeExports.jsxs("span",{children:["$",u==="ONE_TIME"?f.price.amount:f.subscriptionSettings?f.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:u==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:C.stock,children:[(L=f.quantity.restrictions)!=null&&L.max||f.quantity.available!==void 0?((x=f.quantity.restrictions)==null?void 0:x.max)||f.quantity.available:"∞"," ","in stock"]})})]},f.id)})}),u==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:C.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{d>1?$(f=>f-1):$(1)},className:C.button,disabled:e.quantity.available&&e.quantity.restrictions&&d<=e.quantity.restrictions.min||e.quantity.available===0,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(d),onChange:f=>$(Number(f)),max:((D=e.quantity.restrictions)==null?void 0:D.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((A=e.quantity.restrictions)==null?void 0:A.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&d>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{$(f=>f+1)},className:C.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&d>=e.quantity.restrictions.max||e.quantity.available===0),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:C.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:C.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":T(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:C.infoRight,children:u==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:r}),children:["$ ",(e.price.amount||0)*d]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*d]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:r}),children:["$ ",(e.price.amount||0)*d]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:r}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:r}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>b(),disabled:e.quantity&&e.quantity.available===0,children:u==="ONE_TIME"?"Buy Now":"Subscribe Now"}),u==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>y(),disabled:e.quantity&&e.quantity.available===0,children:"Add to Cart"})]})]})},hs="_button_14q75_1",_s="_login_14q75_14",gs="_signUp_14q75_18",fs="_buttons_14q75_23",vs="_modal_14q75_32",Es="_closing_14q75_64",Rs="_info_14q75_113",ys="_top_14q75_120",bs="_title_14q75_131",Is="_clear_14q75_138",Ss="_activeClear_14q75_145",Ns="_count_14q75_149",$s="_cart_14q75_164",ks="_empty_14q75_172",Cs="_product_14q75_198",Bs="_products_14q75_207",ws="_image_14q75_215",Ps="_productInfo_14q75_230",qs="_content_14q75_237",Ts="_name_14q75_243",Ms="_price_14q75_249",As="_productButtons_14q75_255",Os="_productButton_14q75_255",Ds="_productCount_14q75_272",Ls="_bottom_14q75_289",zs="_subtotal_14q75_297",Fs="_block_14q75_305",Vs="_shoppingCount_14q75_312",Us="_total_14q75_332",Hs="_link_14q75_338",Ys="_userInfo_14q75_345",Ws="_pagesMobileModal_14q75_356",Gs="_pagesMobileModalContent_14q75_370",Xs="_pagesMobileModalHeader_14q75_376",Qs="_pagesMobileModalFooter_14q75_386",N={button:hs,login:_s,signUp:gs,buttons:fs,modal:vs,"slide-in-fade":"_slide-in-fade_14q75_1","mobile-slide-in-fade":"_mobile-slide-in-fade_14q75_1",closing:Es,"mobile-slide-out-fade":"_mobile-slide-out-fade_14q75_1","slide-out-fade":"_slide-out-fade_14q75_1",info:Rs,top:ys,title:bs,clear:Is,activeClear:Ss,count:Ns,cart:$s,empty:ks,product:Cs,products:Bs,image:ws,productInfo:Ps,content:qs,name:Ts,price:Ms,productButtons:As,productButton:Os,productCount:Ds,bottom:Ls,subtotal:zs,block:Fs,shoppingCount:Vs,total:Us,link:Hs,userInfo:Ys,pagesMobileModal:Ws,pagesMobileModalContent:Gs,pagesMobileModalHeader:Xs,pagesMobileModalFooter:Qs},Js=a=>{const{shopping:i,signUp:o,isShowUserInfo:s=!0}=a;return t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[i&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})},nt=()=>{const[a,i]=_.useState(!1),[o,s]=_.useState([]),{cart:e}=t.di(),{pageContext:c}=t.usePagesStore();function u(n){if(n.variants.length>0){for(let m=0;m<e.parts.length;m++)for(let r=0;r<n.variants.length;r++)if(n.variants[r]&&e.parts[m].productVariantId===n.variants[r].id)return e.parts[m].productVariantId}return n.variants[0].id}function p(n){for(let m=0;m<e.parts.length;m++)for(let r=0;r<n.variants.length;r++)if(n.variants[r]&&e.parts[m].productVariantId===n.variants[r].id)return e.parts[m].quantity}_.useEffect(()=>{(async()=>{var h;const m=e.parts.map(y=>String(y.productId)),w=(((h=c==null?void 0:c.products)==null?void 0:h.filter(y=>m.includes(String(y.id))))||[]).map(y=>({...y,activeVariantId:u(y),quantity:p(y)}));s(w)})()},[e.parts]);function j(n){var m;return!n||!(n!=null&&n.variants)?!1:(m=n.variants.find(r=>r.id===n.activeVariantId))==null?void 0:m.subscriptionSettings}const d=e.parts.length>0&&o.length>0&&!j(o[0]),[$,E]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10,position:"relative"},onClick:n=>{n.stopPropagation(),window.location.pathname.includes("/admin/builder")||(i(!0),E(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-primary)"}),d&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:e.parts.length})]}),a&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{E(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:d,isOpen:$})})]})},it=a=>{const{activeProducts:i,isCartNotEmpty:o,isOpen:s}=a,{cart:e,reset:c,getTotalAndDiscount:u,updateQuantityOfProduct:p}=t.di(),j=t.useNavigate();function d(n){j(n)}function $(n){n.quantity&&p({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity+1})}function E(n){n.quantity&&p({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(N.modal,{[N.closing]:!s}),onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[t.jsxRuntimeExports.jsxs("div",{className:N.info,children:[t.jsxRuntimeExports.jsx("span",{className:N.title,children:"Cart"}),o&&t.jsxRuntimeExports.jsx("div",{className:N.count,children:e.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(N.clear,{[N.activeClear]:o}),disabled:!o,onClick:c,children:"Clear all"})]}),o?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:i.map(n=>t.jsxRuntimeExports.jsxs("div",{className:N.product,children:[t.jsxRuntimeExports.jsxs("div",{className:N.productInfo,children:[n.images.length>0?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:N.image}):t.jsxRuntimeExports.jsx("div",{className:N.image,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsxs("div",{className:N.content,children:[t.jsxRuntimeExports.jsx("div",{className:N.name,children:t.splitTextIntoSpans(n.name)}),t.jsxRuntimeExports.jsxs("div",{className:N.price,children:["$",n.variants.find(m=>m.id===n.activeVariantId).price.amount*((n==null?void 0:n.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:N.productButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{n.quantity!==1&&E(n)},className:N.productButton,disabled:n.quantity===1,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:N.productCount,children:n.quantity}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>$(n),className:N.productButton,disabled:n.quantity===n.variants.find(m=>m.id===n.activeVariantId).quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},n.id))}),t.jsxRuntimeExports.jsxs("div",{className:N.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:N.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:N.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:N.total,children:["$",u().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>d("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ot,{})]})},ot=()=>t.jsxRuntimeExports.jsxs("div",{className:N.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:N.link,children:"view products"})]})]}),tt=({signUp:a,close:i})=>{const o=JSON.parse(localStorage.getItem("token")||"{}"),{data:s}=o,e=t.useNavigate();function c(j){window.location.pathname.includes("/admin/builder")||e(j)}if(!s)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Secondary",style:{padding:10},children:"Login"}),a&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[u,p]=_.useState("test-email@gmail.com");return _.useEffect(()=>{(async()=>{const d=t.jwtDecode(s);p(d.email)})()},[s]),t.jsxRuntimeExports.jsx("div",{className:N.userInfo,onClick:()=>{c("/customer-dash"),i==null||i()},children:t.jsxRuntimeExports.jsx("div",{children:u||"test-email@gmail.com"})})},rt=({children:a,logo:i,setIsOpen:o,signUp:s})=>{const{setIsOpen:e}=t.useModalStore(),c=()=>{e(!1),setTimeout(()=>{o(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModal,onClick:u=>u.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:i}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:c,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--text-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalContent,children:a}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:s,close:c})})]})},Ks=({children:a,logo:i,signUp:o})=>{const[s,e]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:e}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>e(!1),children:t.jsxRuntimeExports.jsx(rt,{logo:i,setIsOpen:e,signUp:o,children:a})})]})},at=a=>{const{setIsOpenModal:i}=a;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:o=>{o.stopPropagation(),window.location.pathname.includes("/admin/builder")||i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--text-primary)"})})},Zs="_share_10urc_1",tn="_modal_10urc_9",en="_header_10urc_21",sn="_socials_10urc_31",nn="_social_10urc_31",on="_copy_10urc_41",rn="_title_10urc_48",an="_copyWrapper_10urc_54",cn="_copyText_10urc_63",ln="_copyTextMobile_10urc_76",un="_copyTextMiniMobile_10urc_95",X={share:Zs,modal:tn,header:en,socials:sn,social:nn,copy:on,title:rn,copyWrapper:an,copyText:cn,copyTextMobile:ln,copyTextMiniMobile:un},dn=({title:a="Copy Product Link"})=>{const{isOpenModal:i,setIsOpenModal:o}=t.useShareLinkStore();function s(){o(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{className:X.share,onClick:e=>{e.stopPropagation(),s()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),i&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(xn,{title:a})})]})},xn=({title:a="Copy Product Link"})=>{const{setIsOpenModal:i}=t.useShareLinkStore(),{notification:o,setNotification:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),c=window.location.href;function u(){navigator.clipboard.writeText(c),s({message:"Link copied to clipboard",status:"success"})}function p(){e(!1),setTimeout(()=>{i(!1),e(!0)},300)}function j(d,$){return d.length>$?d.slice(0,$)+"...":d}return t.jsxRuntimeExports.jsxs("div",{className:X.modal,onClick:d=>d.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:X.header,children:[t.jsxRuntimeExports.jsx("div",{className:X.title,children:a}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:p,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:X.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:u,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:X.copyText,children:j(c,100)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMobile,children:j(c,40)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMiniMobile,children:j(c,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:u,children:o?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},pn="_accordion_1s1lq_1",mn="_header_1s1lq_9",jn="_icon_1s1lq_18",hn="_open_1s1lq_21",_n="_content_1s1lq_25",J={accordion:pn,header:mn,icon:jn,open:hn,content:_n},gn=({title:a,content:i,defaultOpen:o=!1})=>{const[s,e]=_.useState(o),[c,u]=_.useState(0),p=_.useRef(null),j=()=>{e(!s)};return _.useEffect(()=>{p.current&&u(s?p.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:J.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:J.header,onClick:j,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:a}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.icon,{[J.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:p,className:J.content,style:{height:`${c}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},fn=({children:a,path:i,className:o,target:s="_self",id:e})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:o,role:"link",style:{cursor:"pointer"},id:e,children:a});const c=t.useNavigate(),u=/^https?:\/\//.test(i),p=j=>{u||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.open(i,"_self"):(j.preventDefault(),c(i))};return t.jsxRuntimeExports.jsx("div",{onClick:p,className:o,role:"link",style:{cursor:"pointer"},id:e,children:a})},vn="_buttonsBlock_1b2rb_1",En="_slideUp_1b2rb_1",Rn={buttonsBlock:vn,slideUp:En},yn=a=>{var d,$;const{setIsOpen:i,setModalType:o,productId:s}=a,{cart:e}=t.di(),{pageContext:c}=t.usePagesStore(),u=(d=c==null?void 0:c.listings)==null?void 0:d.find(E=>E.id===s);if(!u)return null;const p=($=c==null?void 0:c.products)==null?void 0:$.find(E=>E.uniquePath===u.productData.uniquePath);if(!p)return null;const j=e.parts.find(E=>E.productId===p.id);return t.jsxRuntimeExports.jsxs("div",{className:Rn.buttonsBlock,onClick:E=>E.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{width:"100%"},onClick:()=>{o("Add To Cart"),i(!0)},children:j?"Add More":"Add To Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>{o("Buy Now"),i(!0)},children:"Buy"})]})},bn="_wrapper_27wzz_1",In="_logo_27wzz_8",Sn="_info_27wzz_12",Z={wrapper:bn,logo:In,info:Sn},Nn=({date:a})=>{const{general:i}=t.useGeneralStore();if(!i)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),c={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",c)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:Z.logo,children:i.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.info.logo.cfId}/w=500,h=500`,alt:"image",style:{objectFit:"contain",width:"48px",height:"48px"}}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:48,height:48})}),t.jsxRuntimeExports.jsxs("div",{className:Z.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:i.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:o(a)})]})]})},$n="_options_mju90_1",kn="_price_mju90_12",Cn="_oldPrice_mju90_19",Bn="_newPrice_mju90_27",wn="_animate_mju90_34",Pn="_appearAndBounce_mju90_1",qn="_meta_mju90_52",Tn="_info_mju90_58",Mn="_infoRight_mju90_66",An="_buttons_mju90_73",On="_variants_mju90_80",Dn="_variant_mju90_80",Ln="_stock_mju90_98",zn="_variantInfo_mju90_105",Fn="_quantity_mju90_111",Vn="_count_mju90_118",Un="_focused_mju90_135",Hn="_button_mju90_73",Yn="_activeVariant_mju90_161",Wn="_chargeTypes_mju90_165",Gn="_charge_mju90_165",Xn="_chargeActive_mju90_190",Qn="_title_mju90_198",Jn="_modal_mju90_204",Kn="_header_mju90_218",H={options:$n,price:kn,oldPrice:Cn,newPrice:Bn,animate:wn,appearAndBounce:Pn,meta:qn,info:Tn,infoRight:Mn,buttons:An,variants:On,variant:Dn,stock:Ln,variantInfo:zn,quantity:Fn,count:Vn,focused:Un,button:Hn,activeVariant:Yn,chargeTypes:Wn,charge:Gn,chargeActive:Xn,title:Qn,modal:Jn,header:Kn},Zn=a=>{var p,j;const{pageContext:i}=t.usePagesStore(),o=(p=i==null?void 0:i.listings)==null?void 0:p.find(d=>d.id===a.productId);if(!o)return;const s=(j=i==null?void 0:i.products)==null?void 0:j.find(d=>d.uniquePath===o.productData.uniquePath);if(!s)return;const e=s.variants[0],[c,u]=_.useState(e.chargeTypes&&e.chargeTypes.length>1?e.chargeTypes[0]:"ONE_TIME");return t.jsxRuntimeExports.jsxs("div",{className:H.modal,onClick:d=>d.stopPropagation(),children:[a.type==="Add To Cart"&&t.jsxRuntimeExports.jsx(ti,{variants:s.variants,activeVariant:e,activeChargeType:c,setActiveChargeType:u,productId:s.id,setIsOpen:a.setIsOpen}),a.type==="Buy Now"&&t.jsxRuntimeExports.jsx(ei,{product:s,setIsOpen:a.setIsOpen})]})},ti=a=>{const{variants:i,activeChargeType:o,setActiveChargeType:s,activeVariant:e,productId:c,setIsOpen:u}=a,{cart:p,addProductToCart:j,addProducts:d,updateQuantityOfProduct:$}=t.di(),{setNotification:E}=t.useNotificationStore(),{pageContext:n}=t.usePagesStore();async function m(r){const w=p.parts.find(h=>h.productId===a.productId&&h.productVariantId===r);w?$({productId:c,productVariantId:r,quantity:w.quantity+1}):(n!=null&&n.products&&await d(n.products),await j({productId:c,productVariantId:r,quantity:1})),E({message:"Product added to cart",status:"success"})}return t.jsxRuntimeExports.jsxs("div",{className:H.modal,children:[t.jsxRuntimeExports.jsxs("div",{className:H.header,children:[t.jsxRuntimeExports.jsx("div",{id:"h3",children:"Choose a variant"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:()=>u(!1)})]}),e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:H.chargeTypes,children:e.chargeTypes.map(r=>t.jsxRuntimeExports.jsx("div",{className:t.clx(H.charge,{[H.chargeActive]:o===r}),onClick:()=>s(r),children:K[r]},r))}),t.jsxRuntimeExports.jsx("div",{className:H.variants,children:i.map(r=>{var w,h;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(H.variant),onClick:()=>{m(r.id),u(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:H.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:H.title,children:r.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?r.price.amount:r.subscriptionSettings?r.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:H.stock,children:[(w=r.quantity.restrictions)!=null&&w.max||r.quantity.available!==void 0?((h=r.quantity.restrictions)==null?void 0:h.max)||r.quantity.available:"∞"," ","in stock"]})})]},r.id)})})]})},ei=a=>{const{product:i,setIsOpen:o}=a;return t.jsxRuntimeExports.jsxs("div",{className:H.modal,children:[t.jsxRuntimeExports.jsxs("div",{className:H.header,children:[t.jsxRuntimeExports.jsxs("div",{id:"h3",children:["Buy ",t.splitTextIntoSpans(i.name)]}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:()=>o(!1),style:{minWidth:24,minHeight:24}})]}),t.jsxRuntimeExports.jsx(st,{product:i,setIsOpen:o})]})},si="_wrapper_1efqk_1",ni="_label_1efqk_10",ii="_contentBorder_1efqk_19",oi="_contentField_1efqk_23",ri="_textarea_1efqk_27",ai="_length_1efqk_42",Q={wrapper:si,label:ni,contentBorder:ii,contentField:oi,textarea:ri,length:ai},ci=a=>{const{onChange:i,label:o,value:s,maxLength:e,placeholder:c="Type something...",type:u="text"}=a,[p,j]=_.useState(s.length),{themeSettings:d}=t.useThemeSettingsStore();function $(E){return u==="number"?E.replace(/[^\d\n]+/g,""):E}return t.jsxRuntimeExports.jsxs("div",{className:Q.wrapper,children:[o&&t.jsxRuntimeExports.jsx("label",{className:Q.label,htmlFor:o,children:o}),t.jsxRuntimeExports.jsx("textarea",{id:o,value:s,onChange:E=>{const n=$(E.target.value);j(n.length),i(n)},placeholder:c,className:t.clx(Q.textarea,{[Q.contentBorder]:d.inputs.border.active,[Q.contentField]:d.inputs.field.active}),maxLength:e}),e&&t.jsxRuntimeExports.jsxs("div",{className:Q.length,children:[p,"/",e]})]})};exports.Button=t.Button$1;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.InputUI=t.Input$1;exports.ItemsSettings=t.ItemsSettings;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.SelectInfiniteList=t.SelectInfiniteList;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TypesText=t.TypesText;exports.Accordion=gn;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=et;exports.ButtonsSettings=Ue;exports.CategorySettings=Wt;exports.ChargeTypes=K;exports.EmptyCart=ot;exports.FormSettings=Ee;exports.HeaderButtons=Js;exports.LayoutSettings=Rt;exports.Link=fn;exports.ListingSelector=Ye;exports.MetaInfoPost=Nn;exports.PagesMobileMenu=Ks;exports.PagesMobileModal=rt;exports.PagesSettings=fe;exports.ProductCardButtons=yn;exports.ProductCardModal=Zn;exports.ProductOptions=st;exports.ShareLink=dn;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.TextareaUI=ci;exports.UserInfo=tt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BmXiMU9s.cjs"),_=require("react"),ct="_wrapper_kh9z8_2",lt="_block_kh9z8_8",dt="_title_kh9z8_16",ut="_subtitle_kh9z8_23",xt="_alignmentContent_kh9z8_30",pt="_alignments_kh9z8_39",mt="_alignment_kh9z8_30",ht="_circle_kh9z8_64",jt="_paddings_kh9z8_71",_t="_padding_kh9z8_71",gt="_active_kh9z8_97",ft="_input_kh9z8_104",U={wrapper:ct,block:lt,title:dt,subtitle:ut,alignmentContent:xt,alignments:pt,alignment:mt,circle:ht,paddings:jt,padding:_t,active:gt,input:ft},Et=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Rt=["left","top","right","bottom"],bt=r=>{const{alignment:i,padding:o,setPadding:s,setAlignment:e,isAlignment:c=!0,isPadding:d=!0}=r;function p(m){switch(m){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function h(m){switch(m){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[u,$]=_.useState(null),[R,n]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:U.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:U.title,children:"Layout (for Desktop version)"}),t.jsxRuntimeExports.jsxs("div",{className:U.alignmentContent,children:[c&&t.jsxRuntimeExports.jsxs("div",{className:U.block,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsx("div",{className:U.alignments,children:Et.map(m=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{e(m)},className:U.alignment,onMouseEnter:()=>{$(m)},onMouseLeave:()=>{$(null)},children:[m!==i&&u!==m&&t.jsxRuntimeExports.jsx("div",{className:U.circle}),m!==i&&u===m&&t.jsxRuntimeExports.jsx(t.Icon,{name:p(u),fill:"#c2c2c2",width:22,height:22}),m===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:p(i),fill:"#FF3F19",width:22,height:22})]},m))})]}),d&&t.jsxRuntimeExports.jsxs("div",{className:U.block,children:[t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:"Paddings"}),t.jsxRuntimeExports.jsx("div",{className:U.paddings,children:Rt.map(m=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(U.padding,{[U.active]:R===m}),onFocus:()=>{n(m)},onBlur:()=>{n(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:h(m),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(o[m]),onChange:a=>s({...o,[m]:Math.min(Number(a),999)}),max:999,paddingless:!0,borderless:!0})]},m))})]})]})]})},vt="_title_82zux_1",yt="_subtitle_82zux_5",It="_header_82zux_12",St="_text_82zux_13",Nt="_productsBlock_82zux_14",$t="_top_82zux_26",kt="_itemsBlock_82zux_35",Ct="_typeTexts_82zux_41",qt="_block_82zux_48",Bt="_active_82zux_61",wt="_products_82zux_14",Pt="_product_82zux_14",Tt="_button_82zux_80",Mt="_disabled_82zux_91",At="_image_82zux_95",Ot="_info_82zux_102",Dt="_name_82zux_114",Lt="_buttons_82zux_118",zt="_modal_82zux_125",Ft="_link_82zux_145",Vt="_modalOptions_82zux_151",Ut="_addButton_82zux_157",Ht="_deleteButton_82zux_179",H={title:vt,subtitle:yt,header:It,text:St,productsBlock:Nt,top:$t,itemsBlock:kt,typeTexts:Ct,block:qt,active:Bt,products:wt,product:Pt,button:Tt,disabled:Mt,image:At,info:Ot,name:Dt,buttons:Lt,modal:zt,link:Ft,modalOptions:Vt,addButton:Ut,deleteButton:Ht};function Yt({id:r,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:c,transition:d,isDragging:p}=t.useSortable({id:r}),h={transform:t.CSS.Transform.toString(c),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:e,style:h,className:`${H.product} ${p?H.dragging:""}`,...o,...s,children:i})}const Wt=r=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:c,tags:d,title:p,subtitle:h,draggable:u=!1,withImage:$=!1,addable:R=!0,itemsOptions:n,hasRangeSelector:m=!1,rangeSelectorOptions:a,limit:B,autoScrollInterval:j,deletable:v,aspectRatio:y,setAspectRatio:T}=r,D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}})),A=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const E=s.findIndex(w=>w===I.id),k=s.findIndex(w=>w===S.id);if(E!==-1&&k!==-1){const w=[...s],[g]=w.splice(E,1);w.splice(k,0,g),e(w)}}};function f(x){if($)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const L=(x,I=!1)=>{const S=n.find(k=>k.id===x);if(!S)return;const E=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:k=>{const w=[...s],g=n.find(l=>l.name===k);if(!g)return;const P=g.id,z=w.map(l=>l===x?P:l);e([...z])},value:S.name,options:n.filter(k=>!s.find(w=>w===k.id)).map(k=>k.name),leftAddonOptions:n.map(k=>({value:k.name,addon:f(k.images)}))}),I&&t.jsxRuntimeExports.jsx("div",{className:H.buttons,children:t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(k=>k!==x))})})})]});return u?t.jsxRuntimeExports.jsx(Yt,{id:x,children:E},t.v4()):t.jsxRuntimeExports.jsx("div",{className:H.product,children:E},t.v4())};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(p||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[p&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:p}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),m&&a&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...a}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[h&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:h}),u?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:A,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s,strategy:t.verticalListSortingStrategy,children:s.map(x=>L(x,v))})}):s.map(x=>L(x,v)),R&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!(B&&B<=s.length||s.length===n.length)}),size:"s",disabled:!!(B&&B<=s.length||s.length===n.length),onClick:()=>{const x=[...s];let I=null;if(n){for(let S=0;S<n.length;S++)if(!s.find(E=>E===n[S].id)){I=n[S];break}}x.push((I==null?void 0:I.id)||n[0].id),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:H.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),y&&T&&t.jsxRuntimeExports.jsx(t.Select,{value:y,label:"Aspect Ratio",options:Object.keys(t.aspectRatio),onChange:x=>T(x),leftAddonOptions:t.aspectRatioOptions}),d!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{tagsTitle:"Tags",items:d}),c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:c}),j!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(j.scrollInterval),onChange:x=>j.setScrollInterval(Number(x)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Gt="_title_roi3a_1",Xt="_subtitle_roi3a_5",Qt="_header_roi3a_12",Jt="_text_roi3a_13",Kt="_productsBlock_roi3a_14",Zt="_top_roi3a_26",te="_itemsBlock_roi3a_35",ee="_typeTexts_roi3a_41",se="_block_roi3a_48",ne="_active_roi3a_61",ie="_products_roi3a_14",oe="_product_roi3a_14",ae="_button_roi3a_80",re="_disabled_roi3a_91",ce="_image_roi3a_95",le="_info_roi3a_102",de="_name_roi3a_114",ue="_buttons_roi3a_118",xe="_modal_roi3a_125",pe="_link_roi3a_145",me="_modalOptions_roi3a_151",he="_addButton_roi3a_164",je="_deleteButton_roi3a_179",_e="_closeIcon_roi3a_191",F={title:Gt,subtitle:Xt,header:Qt,text:Jt,productsBlock:Kt,top:Zt,itemsBlock:te,typeTexts:ee,block:se,active:ne,products:ie,product:oe,button:ae,disabled:re,image:ce,info:le,name:de,buttons:ue,modal:xe,link:pe,modalOptions:me,addButton:he,deleteButton:je,closeIcon:_e};function ge({product:r,children:i}){const{attributes:o,listeners:s,setNodeRef:e,transform:c,transition:d,isDragging:p}=t.useSortable({id:r.id}),h={transform:t.CSS.Transform.toString(c),transition:d};return t.jsxRuntimeExports.jsx("div",{ref:e,style:h,className:`${F.product} ${p?F.dragging:""}`,...o,...s,children:i})}const fe=r=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,title:c,subtitle:d,editable:p=!0,draggable:h=!1,deletable:u=!0,addable:$=!0,itemsType:R,itemsOptions:n,addableOptions:m={},limit:a}=r,[B,j]=_.useState(null),[v,y]=_.useState(null),T=_.useRef(null),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{if(B){const x=[...s].map(I=>I.id===B.id?B:I);e(x)}},[B]),_.useEffect(()=>{T.current&&v&&(T.current.getBoundingClientRect().height,v.top)},[T.current,v]);const A=(x,I)=>{x.stopPropagation();const S=x.target.getBoundingClientRect();y({top:S.top+window.scrollY,left:S.left-30}),j(I)},f=x=>{const{active:I,over:S}=x;if(S&&I.id!==S.id){const E=s.findIndex(w=>w.id===I.id),k=s.findIndex(w=>w.id===S.id);if(E!==-1&&k!==-1){const w=[...s],[g]=w.splice(E,1);w.splice(k,0,g),e(w)}}},L=(x,I)=>{const S=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),R==="select"&&n&&t.jsxRuntimeExports.jsx(t.Select,{onChange:E=>{const k=[...s],w=n.find(P=>P.name===E);if(!w)return;const g=k.map(P=>P.id===x.id?{...w,name:{"en-US":E}}:P);j({...x,name:{"en-US":E}}),e([...g])},value:x.name,options:n.filter(E=>!s.find(k=>k.name===E.name)).map(E=>E.name)}),t.jsxRuntimeExports.jsxs("div",{className:F.buttons,children:[p&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:E=>A(E,x)})}),u&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(E=>E.id!==x.id))})})]})]});return h?t.jsxRuntimeExports.jsx(ge,{product:x,index:I,children:S},x.id):t.jsxRuntimeExports.jsx("div",{className:F.product,children:S},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(c||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:c}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>o==null?void 0:o(x)})]}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:d}),h?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:f,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map((x,I)=>L(x,I))})}):s.map((x,I)=>L(x,I)),$&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(F.button,{[F.disabled]:!!(a&&a<=s.length||s.length===(n==null?void 0:n.length))}),size:"s",disabled:!!(a&&a<=s.length||s.length===(n==null?void 0:n.length)),onClick:()=>{const x=[...s];let I=null;if(n){for(let S=0;S<n.length;S++)if(!s.find(E=>E.id===n[S].id)){I=n[S];break}}R==="select"&&n&&x.push({name:I?I.name:n[0].name,id:(I==null?void 0:I.id)||n[0].id,...m}),e(x)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function Ee(r){const{product:i,children:o}=r,{attributes:s,listeners:e,setNodeRef:c,transform:d,transition:p,isDragging:h}=t.useSortable({id:i.id}),u={transform:t.CSS.Transform.toString(d),transition:p};return t.jsxRuntimeExports.jsx("div",{ref:c,style:u,className:`${t.styles.product} ${h?t.styles.dragging:""}`,...s,...e,children:o})}const Re=r=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:c,title:d,subtitle:p,editable:h=!0,draggable:u=!1,deletable:$=!0,addable:R=!0,itemsType:n,itemsPlaceholder:m="",itemsOptions:a,hasRangeSelector:B=!1,rangeSelectorOptions:j,modalOptions:v,addableOptions:y={},limit:T}=r,[D,A]=_.useState(null),[f,L]=_.useState({top:0,left:0}),[x,I]=_.useState(null),S=_.useRef(null),[E,k]=_.useState(!1),w=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const l=()=>{A(null),k(!1)};return document.body.addEventListener("click",l),A(null),k(!1),()=>{A(null),k(!1),document.body.removeEventListener("click",l)}},[]),_.useEffect(()=>{if(D){const l=[...s].map(q=>q.id===D.id?D:q);e(l)}},[D]),_.useEffect(()=>{if(S.current&&x){const l=S.current.getBoundingClientRect().height,q=window.innerHeight;let b=x.top;b+l>q+window.scrollY-200&&(b=q+window.scrollY-l-200),b<0&&(b=10),L({top:b,left:x.left})}},[S.current,x]);const g=(l,q)=>{l.stopPropagation();const b=l.target.getBoundingClientRect();I({top:b.top+window.scrollY,left:b.left-30}),A(q),k(!0)},P=l=>{const{active:q,over:b}=l;if(b&&q.id!==b.id){const M=s.findIndex(O=>O.id===q.id),W=s.findIndex(O=>O.id===b.id);if(M!==-1&&W!==-1){const O=[...s],[Y]=O.splice(M,1);O.splice(W,0,Y),e(O)}}},z=l=>{var b;const q=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),n==="select"&&a&&t.jsxRuntimeExports.jsx(t.Select,{onChange:M=>{const O=[...s].map(Y=>Y.id===l.id?{...l,name:{"en-US":M}}:Y);A({...l,name:{"en-US":M}}),e([...O])},value:l.name["en-US"],options:a.filter(M=>!s.find(W=>W.name["en-US"]===M))}),n==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:M=>{const O=[...s].map(Y=>Y.id===l.id?{...l,name:{"en-US":M}}:Y);e([...O])},value:l.name["en-US"],placeholder:m}),n==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:M=>{const O=[...s].map(Y=>Y.id===l.id?{...l,images:M}:Y);e([...O])},activeImage:(b=s.find(M=>M.id===l.id))==null?void 0:b.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[h&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:M=>g(M,l)})}),$&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(M=>M.id!==l.id))})})]})]});return u?t.jsxRuntimeExports.jsx(Ee,{product:l,children:q},l.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:q},l.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(d||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:d}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:l=>o==null?void 0:o(l)})]}),D&&h&&v&&E&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:S,activeItem:D,setActiveItem:A,popupPosition:f,modalOptions:v,setIsOpenModal:k}),B&&j&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...j}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[p&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:p}),u?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:w,onDragEnd:P,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(l=>l.id),strategy:t.verticalListSortingStrategy,children:s.map(l=>z(l))})}):s.map(l=>z(l)),R&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(t.styles.button,{[t.styles.disabled]:!!(T&&T<=s.length)}),size:"s",disabled:!!(T&&T<=s.length),onClick:()=>{const l=[...s];let q=null;if(a){for(let b=0;b<a.length;b++)if(!s.find(M=>M.name["en-US"]===a[b])){q=a[b];break}}n==="select"&&a?l.push({name:{"en-US":q||a[0]},id:t.v4(),...y,maxSymbols:100}):n==="input"?l.push({name:{"en-US":""},id:t.v4(),...y,maxSymbols:100}):l.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...y,maxSymbols:100}),e(l)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:c})]})},be="_subtitle_jql1y_1",ve="_header_jql1y_8",ye="_text_jql1y_9",Ie="_productsBlock_jql1y_10",Se="_buttonsBlock_jql1y_11",Ne="_top_jql1y_23",$e="_itemsBlock_jql1y_32",ke="_typeTexts_jql1y_38",Ce="_block_jql1y_45",qe="_active_jql1y_58",Be="_products_jql1y_10",we="_product_jql1y_10",Pe="_button_jql1y_11",Te="_image_jql1y_88",Me="_info_jql1y_95",Ae="_name_jql1y_107",Oe="_buttons_jql1y_11",De="_modal_jql1y_118",Le="_other_jql1y_138",ze="_options_jql1y_144",Fe="_addButton_jql1y_150",Ve="_deleteButton_jql1y_165",G={subtitle:be,header:ve,text:ye,productsBlock:Ie,buttonsBlock:Se,top:Ne,itemsBlock:$e,typeTexts:ke,block:Ce,active:qe,products:Be,product:we,button:Pe,image:Te,info:Me,name:Ae,buttons:Oe,modal:De,other:Le,options:ze,addButton:Fe,deleteButton:Ve},et=r=>{const{buttons:i,setButtons:o,deletable:s=!0,addable:e=!0,editableLink:c=!0}=r,{pages:d}=t.usePagesStore(),[p,h]=_.useState(null),[u,$]=_.useState({top:0,left:0}),[R,n]=_.useState(null),m=_.useRef(null);_.useEffect(()=>{if(p){const j=[...i].map(v=>v.id===p.id?p:v);o(j)}},[p]),_.useEffect(()=>{if(m.current&&R){const j=m.current.getBoundingClientRect().height,v=window.innerHeight;let y=R.top;y+j>v+window.scrollY-200&&(y=v+window.scrollY-j-200),y<0&&(y=10),$({top:y,left:R.left})}},[m.current,R]);const a=(j,v)=>{j.stopPropagation();const y=j.target.getBoundingClientRect();n({top:y.top+window.scrollY-70,left:y.left-(e?30:65)}),h(v)},B=(j,v)=>{const y=[...i],T={...j,id:Math.random().toString(36).substr(2,9)};y.splice(v+1,0,T),o(y)};return t.jsxRuntimeExports.jsxs("div",{className:G.products,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:"Button Type"}),i.map((j,v)=>t.jsxRuntimeExports.jsxs("div",{className:G.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const D=[...i].map(A=>A.id===j.id?{...j,type:y}:A);o(D)},value:j.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:G.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{B(j,v)}})}),t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>{a(y,j)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:G.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const y=i.filter(T=>T.id!==j.id);o(y)},width:20,height:20,fill:"#C12A2A"})})]})]},j.id)),p&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:m,activeButton:p,setActiveButton:h,popupPosition:u,editableLink:c}),e&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:G.button,size:"s",onClick:()=>{const j=[...i];c?j.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:d?Object.values(d)[0].path:"/",openInNewTab:!1}):j.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:d?Object.values(d)[0].path:"/",openInNewTab:!1}),o(j)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:G.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Ue=r=>{const{isActiveButtons:i,setIsActiveButtons:o,buttons:s,setButtons:e,editableLink:c=!0,addable:d=!0,deletable:p=!0}=r;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.top,children:[t.jsxRuntimeExports.jsx("h3",{className:t.styles$1.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:h=>o(h)})]}),i&&t.jsxRuntimeExports.jsx(et,{buttons:s,setButtons:e,editableLink:c,addable:d,deletable:p})]})})};function He(r){const{product:i,children:o}=r,{attributes:s,listeners:e,setNodeRef:c,transform:d,transition:p,isDragging:h}=t.useSortable({id:String(i.listingId)}),u={transform:t.CSS.Transform.toString(d),transition:p};return t.jsxRuntimeExports.jsx("div",{ref:c,style:u,className:`${t.styles$2.product} ${h?t.styles$2.dragging:""}`,...s,...e,children:o})}const Ye=r=>{const{isActiveItems:i,setIsActiveItems:o,items:s,setItems:e,other:c,title:d,subtitle:p,editable:h=!0,draggable:u=!1,withImage:$=!1,deletable:R=!0,addable:n=!0,itemsType:m,itemsOptions:a,limit:B,aspectRatio:j,setAspectRatio:v}=r,[y,T]=_.useState(null),[D,A]=_.useState({top:0,left:0}),[f,L]=_.useState(!1),x=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const g=()=>{T(null),L(!1)};return document.body.addEventListener("click",g),T(null),L(!1),()=>{T(null),L(!1),document.body.removeEventListener("click",g)}},[]),_.useEffect(()=>{if(y){const g=[...s].map(P=>P.listingId===y.listingId?y:P);e(g)}},[y]);const I=(g,P)=>{g.stopPropagation();const z=g.target.getBoundingClientRect(),l=100,q=window.innerHeight;let b=z.top+window.scrollY;b+l>q&&(b=q-l-20),L(!0),A({top:b-80,left:z.left-30}),T(P)};function S(g){if($)return g?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${g}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const E=g=>{const{active:P,over:z}=g;if(z&&P.id!==z.id){const l=s.findIndex(b=>String(b.listingId)===P.id),q=s.findIndex(b=>String(b.listingId)===z.id);if(l!==-1&&q!==-1){const b=[...s],[M]=b.splice(l,1);b.splice(q,0,M),e(b)}}},k=g=>{const P=a.find(l=>g.listingId===l.id);if(!P)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[u&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:l=>{const q=[...s],b=a.find(O=>O.productData.name===l);if(!b)return;const M={listingId:b.id,image:b.productData.images.length>0?b.productData.images[0].cfId:""},W=q.map(O=>O.listingId===g.listingId?M:O);T(M),e([...W])},value:P.productData.name,options:[...a.filter(l=>!s.find(q=>q.listingId===l.id)).map(l=>l.productData.name)],leftAddonOptions:a.map(l=>{var q;return{value:l.productData.name,addon:S(((q=l.productData.images[0])==null?void 0:q.cfId)||"")}})}),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[h&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:l=>I(l,g)})}),R&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>e(s.filter(l=>l!==g))})})]})]});return u?t.jsxRuntimeExports.jsx(He,{product:g,children:z},g.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},g.listingId)},w=_.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(d||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:d}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:g=>o==null?void 0:o(g)})]}),f&&y&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:w,activeItem:y,setActiveItem:T,setIsOpenModal:L,popupPosition:D,itemsOptions:a}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[p&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:p}),u?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:x,onDragEnd:E,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>String(g.listingId)),strategy:t.verticalListSortingStrategy,children:s.map(g=>k(g))})}):s.map(g=>k(g)),n&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.styles$2.button,size:"s",onClick:()=>{const g=[...s];for(let P=0;P<a.length;P++)if(!s.find(z=>z.listingId===a[P].id)){g.push({listingId:a[P].id,image:a[P].productData.images.length>0?a[P].productData.images[0].cfId:""});break}e(g)},disabled:s.length===(B||a.length),style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),j&&v&&t.jsxRuntimeExports.jsx(t.Select,{value:j,options:Object.keys(t.aspectRatio),onChange:g=>v(g),leftAddonOptions:t.aspectRatioOptions}),i&&c!==void 0&&t.jsxRuntimeExports.jsx(t.OtherAndTagsSettings,{otherTitle:"Other",items:c})]})},We="_options_1aiq8_1",Ge="_price_1aiq8_18",Xe="_oldPrice_1aiq8_25",Qe="_newPrice_1aiq8_33",Je="_animate_1aiq8_40",Ke="_appearAndBounce_1aiq8_1",Ze="_meta_1aiq8_58",ts="_info_1aiq8_64",es="_infoRight_1aiq8_72",ss="_buttons_1aiq8_79",ns="_variants_1aiq8_86",is="_variant_1aiq8_86",os="_stock_1aiq8_104",as="_variantInfo_1aiq8_111",rs="_quantity_1aiq8_117",cs="_count_1aiq8_124",ls="_focused_1aiq8_141",ds="_button_1aiq8_79",us="_activeVariant_1aiq8_167",xs="_chargeTypes_1aiq8_171",ps="_charge_1aiq8_171",ms="_chargeActive_1aiq8_196",hs="_title_1aiq8_204",C={options:We,price:Ge,oldPrice:Xe,newPrice:Qe,animate:Je,appearAndBounce:Ke,meta:Ze,info:ts,infoRight:es,buttons:ss,variants:ns,variant:is,stock:os,variantInfo:as,quantity:rs,count:cs,focused:ls,button:ds,activeVariant:us,chargeTypes:xs,charge:ps,chargeActive:ms,title:hs};var K=(r=>(r.ONE_TIME="One-Time",r.RECURRING="Subscribe & Save",r))(K||{});const st=r=>{var D,A;const{product:i,setIsOpen:o}=r,{variants:s}=i,[e,c]=_.useState(s[0]),[d,p]=_.useState(e.chargeTypes?e.chargeTypes[0]:"ONE_TIME"),h=t.useNavigate(),[u,$]=_.useState(1),{reset:R,addProductToCart:n,addProducts:m}=t.di(),[a,B]=_.useState(!1),{pageContext:j}=t.usePagesStore();_.useEffect(()=>{B(!0);const f=setTimeout(()=>B(!1),600);return()=>clearTimeout(f)},[u]);async function v(){await m((j==null?void 0:j.products)||[]),await n({productId:i.id,productVariantId:e.id,quantity:u}),o==null||o(!1)}function y(){R(),v(),h("/checkout")}function T(f){if(f>=864e5){const E=Math.floor(f/864e5);return`${E} ${E===1?"day":"days"}`}else if(f>=36e5){const E=Math.floor(f/36e5);return`${E} ${E===1?"hour":"hours"}`}else if(f>=6e4){const E=Math.floor(f/6e4);return`${E} ${E===1?"minute":"minutes"}`}else{const E=Math.floor(f/1e3);return`${E} ${E===1?"second":"seconds"}`}}return _.useEffect(()=>{e.quantity&&e.quantity.available===0&&$(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:C.options,children:[e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:C.chargeTypes,children:e.chargeTypes.map(f=>t.jsxRuntimeExports.jsx("div",{className:t.clx(C.charge,{[C.chargeActive]:d===f}),onClick:()=>p(f),children:K[f]},f))}),t.jsxRuntimeExports.jsx("div",{className:C.variants,children:s.map(f=>{var L,x;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(C.variant,{[C.activeVariant]:e.id===f.id}),onClick:()=>c(f),children:[t.jsxRuntimeExports.jsxs("div",{className:C.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:C.title,children:t.splitTextIntoSpans(f.name)}),t.jsxRuntimeExports.jsxs("span",{children:["$",d==="ONE_TIME"?f.price.amount:f.subscriptionSettings?f.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:d==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:C.stock,children:[(L=f.quantity.restrictions)!=null&&L.max||f.quantity.available!==void 0?((x=f.quantity.restrictions)==null?void 0:x.max)||f.quantity.available:"∞"," ","in stock"]})})]},f.id)})}),d==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:C.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{u>1?$(f=>f-1):$(1)},className:C.button,disabled:e.quantity.available&&e.quantity.restrictions&&u<=e.quantity.restrictions.min||e.quantity.available===0,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(u),onChange:f=>$(Number(f)),max:((D=e.quantity.restrictions)==null?void 0:D.max)||e.quantity.available||Number.POSITIVE_INFINITY,min:((A=e.quantity.restrictions)==null?void 0:A.min)||0,centered:!0,disabled:e.quantity&&e.quantity.available===0||Object.keys(e.quantity.restrictions||{}).length!==0&&u>=e.quantity.restrictions.max}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{$(f=>f+1)},className:C.button,disabled:!!(e.quantity.available&&e.quantity.restrictions&&u>=e.quantity.restrictions.max||e.quantity.available===0),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:C.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:C.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":T(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:C.infoRight,children:d==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:a}),children:["$ ",(e.price.amount||0)*u]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*u]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:a}),children:["$ ",(e.price.amount||0)*u]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:a}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:a}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>y(),disabled:e.quantity&&e.quantity.available===0,children:d==="ONE_TIME"?"Buy Now":"Subscribe Now"}),d==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>v(),disabled:e.quantity&&e.quantity.available===0,children:"Add to Cart"})]})]})},js="_button_14q75_1",_s="_login_14q75_14",gs="_signUp_14q75_18",fs="_buttons_14q75_23",Es="_modal_14q75_32",Rs="_closing_14q75_64",bs="_info_14q75_113",vs="_top_14q75_120",ys="_title_14q75_131",Is="_clear_14q75_138",Ss="_activeClear_14q75_145",Ns="_count_14q75_149",$s="_cart_14q75_164",ks="_empty_14q75_172",Cs="_product_14q75_198",qs="_products_14q75_207",Bs="_image_14q75_215",ws="_productInfo_14q75_230",Ps="_content_14q75_237",Ts="_name_14q75_243",Ms="_price_14q75_249",As="_productButtons_14q75_255",Os="_productButton_14q75_255",Ds="_productCount_14q75_272",Ls="_bottom_14q75_289",zs="_subtotal_14q75_297",Fs="_block_14q75_305",Vs="_shoppingCount_14q75_312",Us="_total_14q75_332",Hs="_link_14q75_338",Ys="_userInfo_14q75_345",Ws="_pagesMobileModal_14q75_356",Gs="_pagesMobileModalContent_14q75_370",Xs="_pagesMobileModalHeader_14q75_376",Qs="_pagesMobileModalFooter_14q75_386",N={button:js,login:_s,signUp:gs,buttons:fs,modal:Es,"slide-in-fade":"_slide-in-fade_14q75_1","mobile-slide-in-fade":"_mobile-slide-in-fade_14q75_1",closing:Rs,"mobile-slide-out-fade":"_mobile-slide-out-fade_14q75_1","slide-out-fade":"_slide-out-fade_14q75_1",info:bs,top:vs,title:ys,clear:Is,activeClear:Ss,count:Ns,cart:$s,empty:ks,product:Cs,products:qs,image:Bs,productInfo:ws,content:Ps,name:Ts,price:Ms,productButtons:As,productButton:Os,productCount:Ds,bottom:Ls,subtotal:zs,block:Fs,shoppingCount:Vs,total:Us,link:Hs,userInfo:Ys,pagesMobileModal:Ws,pagesMobileModalContent:Gs,pagesMobileModalHeader:Xs,pagesMobileModalFooter:Qs},Js=r=>{const{shopping:i,signUp:o,isShowUserInfo:s=!0}=r;return t.jsxRuntimeExports.jsxs("div",{className:N.buttons,children:[i&&t.jsxRuntimeExports.jsx(nt,{}),s&&t.jsxRuntimeExports.jsx(tt,{signUp:o})]})},nt=()=>{const[r,i]=_.useState(!1),[o,s]=_.useState([]),{cart:e}=t.di(),{pageContext:c}=t.usePagesStore();function d(n){if(n.variants.length>0){for(let m=0;m<e.parts.length;m++)for(let a=0;a<n.variants.length;a++)if(n.variants[a]&&e.parts[m].productVariantId===n.variants[a].id)return e.parts[m].productVariantId}return n.variants[0].id}function p(n){for(let m=0;m<e.parts.length;m++)for(let a=0;a<n.variants.length;a++)if(n.variants[a]&&e.parts[m].productVariantId===n.variants[a].id)return e.parts[m].quantity}_.useEffect(()=>{(async()=>{var j;const m=e.parts.map(v=>String(v.productId)),B=(((j=c==null?void 0:c.products)==null?void 0:j.filter(v=>m.includes(String(v.id))))||[]).map(v=>({...v,activeVariantId:d(v),quantity:p(v)}));s(B)})()},[e.parts]);function h(n){var m;return!n||!(n!=null&&n.variants)?!1:(m=n.variants.find(a=>a.id===n.activeVariantId))==null?void 0:m.subscriptionSettings}const u=e.parts.length>0&&o.length>0&&!h(o[0]),[$,R]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10,position:"relative"},onClick:n=>{n.stopPropagation(),window.location.pathname.includes("/admin/builder")||(i(!0),R(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-primary)"}),u&&t.jsxRuntimeExports.jsx("div",{className:N.shoppingCount,children:e.parts.length})]}),r&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{R(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(it,{activeProducts:o,isCartNotEmpty:u,isOpen:$})})]})},it=r=>{const{activeProducts:i,isCartNotEmpty:o,isOpen:s}=r,{cart:e,reset:c,getTotalAndDiscount:d,updateQuantityOfProduct:p}=t.di(),h=t.useNavigate();function u(n){h(n)}function $(n){n.quantity&&p({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity+1})}function R(n){n.quantity&&p({productId:n.id,productVariantId:n.activeVariantId,quantity:n.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(N.modal,{[N.closing]:!s}),onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.top,children:[t.jsxRuntimeExports.jsxs("div",{className:N.info,children:[t.jsxRuntimeExports.jsx("span",{className:N.title,children:"Cart"}),o&&t.jsxRuntimeExports.jsx("div",{className:N.count,children:e.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(N.clear,{[N.activeClear]:o}),disabled:!o,onClick:c,children:"Clear all"})]}),o?t.jsxRuntimeExports.jsxs("div",{className:N.cart,children:[t.jsxRuntimeExports.jsx("div",{className:N.products,children:i.map(n=>t.jsxRuntimeExports.jsxs("div",{className:N.product,children:[t.jsxRuntimeExports.jsxs("div",{className:N.productInfo,children:[n.images.length>0?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${n.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:N.image}):t.jsxRuntimeExports.jsx("div",{className:N.image,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsxs("div",{className:N.content,children:[t.jsxRuntimeExports.jsx("div",{className:N.name,children:t.splitTextIntoSpans(n.name)}),t.jsxRuntimeExports.jsxs("div",{className:N.price,children:["$",n.variants.find(m=>m.id===n.activeVariantId).price.amount*((n==null?void 0:n.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:N.productButtons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{n.quantity!==1&&R(n)},className:N.productButton,disabled:n.quantity===1,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:N.productCount,children:n.quantity}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>$(n),className:N.productButton,disabled:n.quantity===n.variants.find(m=>m.id===n.activeVariantId).quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},n.id))}),t.jsxRuntimeExports.jsxs("div",{className:N.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:N.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:N.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{className:N.total,children:["$",d().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>u("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ot,{})]})},ot=()=>t.jsxRuntimeExports.jsxs("div",{className:N.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--text-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:N.link,children:"view products"})]})]}),tt=({signUp:r,close:i})=>{const o=JSON.parse(localStorage.getItem("token")||"{}"),{data:s}=o,e=t.useNavigate();function c(h){window.location.pathname.includes("/admin/builder")||e(h)}if(!s)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Secondary",style:{padding:10},children:"Login"}),r&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>{c("/customer-dash"),i==null||i()},type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[d,p]=_.useState("test-email@gmail.com");return _.useEffect(()=>{(async()=>{const u=t.jwtDecode(s);p(u.email)})()},[s]),t.jsxRuntimeExports.jsx("div",{className:N.userInfo,onClick:()=>{c("/customer-dash"),i==null||i()},children:t.jsxRuntimeExports.jsx("div",{children:d||"test-email@gmail.com"})})},at=({children:r,logo:i,setIsOpen:o,signUp:s})=>{const{setIsOpen:e}=t.useModalStore(),c=()=>{e(!1),setTimeout(()=>{o(!1),e(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModal,onClick:d=>d.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:N.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:i}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:c,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--text-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalContent,children:r}),t.jsxRuntimeExports.jsx("div",{className:N.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(tt,{signUp:s,close:c})})]})},Ks=({children:r,logo:i,signUp:o})=>{const[s,e]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(rt,{setIsOpenModal:e}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>e(!1),children:t.jsxRuntimeExports.jsx(at,{logo:i,setIsOpen:e,signUp:o,children:r})})]})},rt=r=>{const{setIsOpenModal:i}=r;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:o=>{o.stopPropagation(),window.location.pathname.includes("/admin/builder")||i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--text-primary)"})})},Zs="_share_10urc_1",tn="_modal_10urc_9",en="_header_10urc_21",sn="_socials_10urc_31",nn="_social_10urc_31",on="_copy_10urc_41",an="_title_10urc_48",rn="_copyWrapper_10urc_54",cn="_copyText_10urc_63",ln="_copyTextMobile_10urc_76",dn="_copyTextMiniMobile_10urc_95",X={share:Zs,modal:tn,header:en,socials:sn,social:nn,copy:on,title:an,copyWrapper:rn,copyText:cn,copyTextMobile:ln,copyTextMiniMobile:dn},un=({title:r="Copy Product Link"})=>{const{isOpenModal:i,setIsOpenModal:o}=t.useShareLinkStore();function s(){o(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{className:X.share,onClick:e=>{e.stopPropagation(),s()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),i&&t.jsxRuntimeExports.jsx(t.Modal,{close:o,children:t.jsxRuntimeExports.jsx(xn,{title:r})})]})},xn=({title:r="Copy Product Link"})=>{const{setIsOpenModal:i}=t.useShareLinkStore(),{notification:o,setNotification:s}=t.useNotificationStore(),{setIsOpen:e}=t.useModalStore(),c=window.location.href;function d(){navigator.clipboard.writeText(c),s({message:"Link copied to clipboard",status:"success"})}function p(){e(!1),setTimeout(()=>{i(!1),e(!0)},300)}function h(u,$){return u.length>$?u.slice(0,$)+"...":u}return t.jsxRuntimeExports.jsxs("div",{className:X.modal,onClick:u=>u.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:X.header,children:[t.jsxRuntimeExports.jsx("div",{className:X.title,children:r}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:p,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:X.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",onClick:d,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:X.copyText,children:h(c,100)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMobile,children:h(c,40)}),t.jsxRuntimeExports.jsx("div",{className:X.copyTextMiniMobile,children:h(c,20)})]}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:d,children:o?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},pn="_accordion_1s1lq_1",mn="_header_1s1lq_9",hn="_icon_1s1lq_18",jn="_open_1s1lq_21",_n="_content_1s1lq_25",J={accordion:pn,header:mn,icon:hn,open:jn,content:_n},gn=({title:r,content:i,defaultOpen:o=!1})=>{const[s,e]=_.useState(o),[c,d]=_.useState(0),p=_.useRef(null),h=()=>{e(!s)};return _.useEffect(()=>{p.current&&d(s?p.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:J.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:J.header,onClick:h,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:r}),t.jsxRuntimeExports.jsx("div",{className:t.clx(J.icon,{[J.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:p,className:J.content,style:{height:`${c}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},fn=({children:r,path:i,className:o,target:s="_self",id:e})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:o,role:"link",style:{cursor:"pointer"},id:e,children:r});const c=t.useNavigate(),d=/^https?:\/\//.test(i),p=h=>{d||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.open(i,"_self"):(h.preventDefault(),c(i))};return t.jsxRuntimeExports.jsx("div",{onClick:p,className:o,role:"link",style:{cursor:"pointer"},id:e,children:r})},En="_buttonsBlock_1b2rb_1",Rn="_slideUp_1b2rb_1",bn={buttonsBlock:En,slideUp:Rn},vn=r=>{var u,$;const{setIsOpen:i,setModalType:o,productId:s}=r,{cart:e}=t.di(),{pageContext:c}=t.usePagesStore(),d=(u=c==null?void 0:c.listings)==null?void 0:u.find(R=>R.id===s);if(!d)return null;const p=($=c==null?void 0:c.products)==null?void 0:$.find(R=>R.uniquePath===d.productData.uniquePath);if(!p)return null;const h=e.parts.find(R=>R.productId===p.id);return t.jsxRuntimeExports.jsxs("div",{className:bn.buttonsBlock,onClick:R=>R.stopPropagation(),children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{width:"100%"},onClick:()=>{o("Add To Cart"),i(!0)},children:h?"Add More":"Add To Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>{o("Buy Now"),i(!0)},children:"Buy"})]})},yn="_wrapper_27wzz_1",In="_logo_27wzz_8",Sn="_info_27wzz_12",Z={wrapper:yn,logo:In,info:Sn},Nn=({date:r})=>{const{general:i}=t.useGeneralStore();if(!i)return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{});function o(s){const e=new Date(s),c={month:"short",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1};return e.toLocaleDateString("en-US",c)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[t.jsxRuntimeExports.jsx("div",{className:Z.logo,children:i.info.logo?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.info.logo.cfId}/w=500,h=500`,alt:"image",style:{objectFit:"contain",width:"48px",height:"48px"}}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:48,height:48})}),t.jsxRuntimeExports.jsxs("div",{className:Z.info,children:[t.jsxRuntimeExports.jsx("h3",{id:"h4",children:i.info.name}),t.jsxRuntimeExports.jsx("p",{id:"p",children:o(r)})]})]})},$n="_options_6lbld_1",kn="_price_6lbld_12",Cn="_oldPrice_6lbld_19",qn="_newPrice_6lbld_27",Bn="_animate_6lbld_34",wn="_appearAndBounce_6lbld_1",Pn="_meta_6lbld_52",Tn="_info_6lbld_58",Mn="_infoRight_6lbld_66",An="_buttons_6lbld_73",On="_variants_6lbld_80",Dn="_variant_6lbld_80",Ln="_stock_6lbld_98",zn="_variantInfo_6lbld_105",Fn="_quantity_6lbld_111",Vn="_count_6lbld_118",Un="_focused_6lbld_135",Hn="_button_6lbld_73",Yn="_activeVariant_6lbld_161",Wn="_chargeTypes_6lbld_165",Gn="_charge_6lbld_165",Xn="_chargeActive_6lbld_190",Qn="_title_6lbld_198",Jn="_modal_6lbld_204",Kn="_header_6lbld_224",Zn="_productOptions_6lbld_232",V={options:$n,price:kn,oldPrice:Cn,newPrice:qn,animate:Bn,appearAndBounce:wn,meta:Pn,info:Tn,infoRight:Mn,buttons:An,variants:On,variant:Dn,stock:Ln,variantInfo:zn,quantity:Fn,count:Vn,focused:Un,button:Hn,activeVariant:Yn,chargeTypes:Wn,charge:Gn,chargeActive:Xn,title:Qn,modal:Jn,header:Kn,productOptions:Zn},ti=r=>{var p,h;const{pageContext:i}=t.usePagesStore(),o=(p=i==null?void 0:i.listings)==null?void 0:p.find(u=>u.id===r.productId);if(!o)return;const s=(h=i==null?void 0:i.products)==null?void 0:h.find(u=>u.uniquePath===o.productData.uniquePath);if(!s)return;const e=s.variants[0],[c,d]=_.useState(e.chargeTypes&&e.chargeTypes.length>1?e.chargeTypes[0]:"ONE_TIME");return t.jsxRuntimeExports.jsxs("div",{className:V.modal,onClick:u=>u.stopPropagation(),children:[r.type==="Add To Cart"&&t.jsxRuntimeExports.jsx(ei,{variants:s.variants,activeVariant:e,activeChargeType:c,setActiveChargeType:d,productId:s.id,setIsOpen:r.setIsOpen}),r.type==="Buy Now"&&t.jsxRuntimeExports.jsx(si,{product:s,setIsOpen:r.setIsOpen})]})},ei=r=>{const{variants:i,activeChargeType:o,setActiveChargeType:s,activeVariant:e,productId:c,setIsOpen:d}=r,{cart:p,addProductToCart:h,addProducts:u,updateQuantityOfProduct:$}=t.di(),{setNotification:R}=t.useNotificationStore(),{pageContext:n}=t.usePagesStore();async function m(a){const B=p.parts.find(j=>j.productId===r.productId&&j.productVariantId===a);B?$({productId:c,productVariantId:a,quantity:B.quantity+1}):(n!=null&&n.products&&await u(n.products),await h({productId:c,productVariantId:a,quantity:1})),R({message:"Product added to cart",status:"success"})}return t.jsxRuntimeExports.jsxs("div",{className:V.modal,children:[t.jsxRuntimeExports.jsxs("div",{className:V.header,children:[t.jsxRuntimeExports.jsx("div",{id:"h3",children:"Choose a variant"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:()=>d(!1)})]}),e.chargeTypes&&e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:V.chargeTypes,children:e.chargeTypes.map(a=>t.jsxRuntimeExports.jsx("div",{className:t.clx(V.charge,{[V.chargeActive]:o===a}),onClick:()=>s(a),children:K[a]},a))}),t.jsxRuntimeExports.jsx("div",{className:V.variants,children:i.map(a=>{var B,j;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(V.variant),onClick:()=>{m(a.id),d(!1)},children:[t.jsxRuntimeExports.jsxs("div",{className:V.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:V.title,children:a.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",o==="ONE_TIME"?a.price.amount:a.subscriptionSettings?a.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:o==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:V.stock,children:[(B=a.quantity.restrictions)!=null&&B.max||a.quantity.available!==void 0?((j=a.quantity.restrictions)==null?void 0:j.max)||a.quantity.available:"∞"," ","in stock"]})})]},a.id)})})]})},si=r=>{const{product:i,setIsOpen:o}=r;return t.jsxRuntimeExports.jsxs("div",{className:V.modal,children:[t.jsxRuntimeExports.jsxs("div",{className:V.header,children:[t.jsxRuntimeExports.jsxs("div",{id:"h3",children:["Buy ",t.splitTextIntoSpans(i.name)]}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",width:24,height:24,fill:"var(--text-secondary)",hoverable:!0,onClick:()=>o(!1),style:{minWidth:24,minHeight:24}})]}),t.jsxRuntimeExports.jsx("div",{className:V.productOptions,children:t.jsxRuntimeExports.jsx(st,{product:i,setIsOpen:o})})]})},ni="_wrapper_1efqk_1",ii="_label_1efqk_10",oi="_contentBorder_1efqk_19",ai="_contentField_1efqk_23",ri="_textarea_1efqk_27",ci="_length_1efqk_42",Q={wrapper:ni,label:ii,contentBorder:oi,contentField:ai,textarea:ri,length:ci},li=r=>{const{onChange:i,label:o,value:s,maxLength:e,placeholder:c="Type something...",type:d="text"}=r,[p,h]=_.useState(s.length),{themeSettings:u}=t.useThemeSettingsStore();function $(R){return d==="number"?R.replace(/[^\d\n]+/g,""):R}return t.jsxRuntimeExports.jsxs("div",{className:Q.wrapper,children:[o&&t.jsxRuntimeExports.jsx("label",{className:Q.label,htmlFor:o,children:o}),t.jsxRuntimeExports.jsx("textarea",{id:o,value:s,onChange:R=>{const n=$(R.target.value);h(n.length),i(n)},placeholder:c,className:t.clx(Q.textarea,{[Q.contentBorder]:u.inputs.border.active,[Q.contentField]:u.inputs.field.active}),maxLength:e}),e&&t.jsxRuntimeExports.jsxs("div",{className:Q.length,children:[p,"/",e]})]})};exports.Button=t.Button$1;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.InputUI=t.Input$1;exports.ItemsSettings=t.ItemsSettings;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.SelectInfiniteList=t.SelectInfiniteList;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.Textarea;exports.TypesText=t.TypesText;exports.Accordion=gn;exports.BurgerMenuButton=rt;exports.ButtonTypeSettings=et;exports.ButtonsSettings=Ue;exports.CategorySettings=Wt;exports.ChargeTypes=K;exports.EmptyCart=ot;exports.FormSettings=Re;exports.HeaderButtons=Js;exports.LayoutSettings=bt;exports.Link=fn;exports.ListingSelector=Ye;exports.MetaInfoPost=Nn;exports.PagesMobileMenu=Ks;exports.PagesMobileModal=at;exports.PagesSettings=fe;exports.ProductCardButtons=vn;exports.ProductCardModal=ti;exports.ProductOptions=st;exports.ShareLink=un;exports.ShoppingButton=nt;exports.ShoppingModalCart=it;exports.TextareaUI=li;exports.UserInfo=tt;