@billgangcom/theme-lib 1.36.0 → 1.36.1

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-BnJDbbG8.cjs"),_=require("react");require("@phosphor-icons/react");const It="_wrapper_3ibiw_2",kt="_alignmentBlock_3ibiw_8",$t="_title_3ibiw_15",Nt="_subtitle_3ibiw_22",wt="_alignmentContent_3ibiw_29",St="_alignments_3ibiw_37",Ct="_alignment_3ibiw_8",Bt="_circle_3ibiw_63",Tt="_paddings_3ibiw_70",Pt="_padding_3ibiw_70",At="_active_3ibiw_94",Ot="_input_3ibiw_101",G={wrapper:It,alignmentBlock:kt,title:$t,subtitle:Nt,alignmentContent:wt,alignments:St,alignment:Ct,circle:Bt,paddings:Tt,padding:Pt,active:At,input:Ot},qt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Lt=["left","top","right","bottom"],Dt=l=>{const{alignment:a,padding:e,setPadding:s,setAlignment:i}=l;function r(){switch(a){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 c(o){switch(o){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[x,n]=_.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:G.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:G.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:G.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:G.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:G.alignments,children:qt.map(o=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(o)},className:G.alignment,children:[o!==a&&t.jsxRuntimeExports.jsx("div",{className:G.circle}),o===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(),fill:"#FF3F19",width:22,height:22})]},o))}),t.jsxRuntimeExports.jsx("div",{className:G.paddings,children:Lt.map(o=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(G.padding,{[G.active]:x===o}),onFocus:()=>{n(o)},onBlur:()=>{n(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(o),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[o]),onChange:j=>s({...e,[o]:Number(j)}),paddingless:!0,borderless:!0})]},o))})]})]})]})},Mt="_title_1jkiw_1",Ht="_subtitle_1jkiw_5",zt="_header_1jkiw_12",Ft="_text_1jkiw_13",Vt="_top_1jkiw_20",Ut="_itemsBlock_1jkiw_29",rt={title:Mt,subtitle:Ht,header:zt,text:Ft,top:Vt,itemsBlock:Ut},Yt="_typeTexts_167ez_1",Gt="_block_167ez_8",Wt="_active_167ez_25",pt={typeTexts:Yt,block:Gt,active:Wt},Xt=["bold","italic","underline","strike-through","code"],_t=l=>{const{typesText:a,setTypesText:e}=l;function s(i){switch(i){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:pt.typeTexts,children:Xt.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(pt.block,{[pt.active]:a.includes(i)}),onClick:()=>{const r=[...a];if(r.includes(i)){const c=r.filter(x=>x!==i);e(c)}else r.push(i),e(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(i),fill:a.includes(i)?"#252525":"#757575",width:20,height:20})},String(i)))})},jt=l=>{const{typesText:a,isActiveText:e,setIsActiveText:s,text:i,setText:r,setTypesText:c,title:x,subtitle:n="Items"}=l;return t.jsxRuntimeExports.jsxs("div",{className:rt.text,children:[(x||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:rt.top,children:[x&&t.jsxRuntimeExports.jsx("h3",{className:rt.title,children:x}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:o=>s(o)})]}),t.jsxRuntimeExports.jsxs("div",{className:rt.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:rt.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:o=>r(o),value:i,maxLength:150}),t.jsxRuntimeExports.jsx(_t,{typesText:a,setTypesText:c})]})]})},Jt="_title_157lh_1",Qt="_subtitle_157lh_5",Kt="_header_157lh_12",Zt="_text_157lh_13",te="_productsBlock_157lh_14",ee="_top_157lh_26",se="_itemsBlock_157lh_35",ne="_typeTexts_157lh_41",ie="_block_157lh_48",oe="_active_157lh_61",re="_products_157lh_14",ae="_product_157lh_14",ce="_button_157lh_80",le="_disabled_157lh_91",ue="_image_157lh_95",de="_info_157lh_102",xe="_name_157lh_114",me="_buttons_157lh_118",pe="_modal_157lh_125",he="_link_157lh_145",_e="_modalOptions_157lh_151",je="_addButton_157lh_163",ge="_deleteButton_157lh_178",M={title:Jt,subtitle:Qt,header:Kt,text:Zt,productsBlock:te,top:ee,itemsBlock:se,typeTexts:ne,block:ie,active:oe,products:re,product:ae,button:ce,disabled:le,image:ue,info:de,name:xe,buttons:me,modal:pe,link:he,modalOptions:_e,addButton:je,deleteButton:ge},fe=_.forwardRef((l,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=l;function x(n,o){return n.length>o?`${n.slice(0,o)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:a,className:M.modal,onClick:n=>{n.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:M.top,children:[t.jsxRuntimeExports.jsx("h3",{className:M.title,children:x(e.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:M.modalOptions,children:r.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:o=>{const j={...e,[n.field]:o};s(j)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(jt,{typesText:e[n.field.type],setTypesText:o=>{const j={...e,[n.field.type]:o};s(j)},text:e[n.field.text]||"",setText:o=>{const j={...e,[n.field.text]:o};s(j)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const j={...e,[n.field]:o};s(j)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:M.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const j={...e,[n.field.text]:o};s(j)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:o=>{const j={...e,[n.field.switch]:o};s(j)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(gt,{items:e[n.field]||[],setItems:o=>{const j={...e,[n.field]:o};s(j)},itemsType:"select",draggable:n.draggable||!1,itemsOptions:n.itemsOptions,deletable:n.deletable||!1,editable:!1,subtitle:n.label,addableOptions:n.addableOptions});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:o=>{const j={...e,[n.field]:o};s(j)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})}),be="_other_g74jx_1",ve="_subtitle_g74jx_7",Ee="_items_g74jx_14",ht={other:be,subtitle:ve,items:Ee},xt=l=>{const{items:a,title:e="Other"}=l;return t.jsxRuntimeExports.jsxs("div",{className:ht.other,children:[t.jsxRuntimeExports.jsx("h5",{className:ht.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:ht.items,children:a.map((s,i)=>t.jsxRuntimeExports.jsx(t.Switch,{current:s.isItem,onChange:r=>s.setIsItem(r),label:s.label,hasBackground:!0,paddingless:!1},i))})]})};function Re({product:l,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:x}=t.useSortable({id:l.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${M.product} ${x?M.dragging:""}`,...e,...s,children:a})}const gt=l=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:x,editable:n=!0,draggable:o=!1,withImage:j=!1,deletable:I=!0,addable:p=!0,itemsType:m,itemsPlaceholder:h="",itemsOptions:u,hasRangeSelector:$=!1,rangeSelectorOptions:O,modalOptions:v,addableOptions:q={},limit:N,autoScrollInterval:S}=l,[g,E]=_.useState(null),[z,X]=_.useState({top:0,left:0}),[f,y]=_.useState(null),C=_.useRef(null),[F,P]=_.useState(!1),D=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const d=()=>{E(null),P(!1)};return document.body.addEventListener("click",d),E(null),P(!1),()=>{E(null),P(!1),document.body.removeEventListener("click",d)}},[]),_.useEffect(()=>{if(g){const d=[...s].map(R=>R.id===g.id?g:R);i(d)}},[g]),_.useEffect(()=>{if(C.current&&f){const d=C.current.getBoundingClientRect().height,R=window.innerHeight;let B=f.top;B+d>R+window.scrollY-200&&(B=R+window.scrollY-d-200),B<0&&(B=10),X({top:B,left:f.left})}},[C.current,f]);const J=(d,R)=>{d.stopPropagation();const B=d.target.getBoundingClientRect();y({top:B.top+window.scrollY,left:B.left-30}),E(R),P(!0)};function et(d){if(j)return d?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${d[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const b=d=>{const{active:R,over:B}=d;if(B&&R.id!==B.id){const L=s.findIndex(T=>T.id===R.id),V=s.findIndex(T=>T.id===B.id);if(L!==-1&&V!==-1){const T=[...s],[st]=T.splice(L,1);T.splice(V,0,st),i(T)}}},A=(d,R)=>{var L,V;const B=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&u&&t.jsxRuntimeExports.jsx(t.Select,{onChange:T=>{const st=[...s],ot=u.find(lt=>lt.name===T);if(!ot)return;const nt=st.map(lt=>lt.id===d.id?{...ot,name:T}:lt);E({...d,name:T}),i([...nt])},value:d.name,options:u.filter(T=>!s.find(st=>st.name===T.name)).map(T=>T.name),leftAddon:et(d.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:T=>{const ot=[...s].map(nt=>nt.id===d.id?{...d,name:T}:nt);i([...ot])},value:d.name,placeholder:h}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:T=>{const ot=[...s].map(nt=>nt.id===d.id?{...d,images:T}:nt);i([...ot])},activeImage:(L=s.find(T=>T.id===d.id))!=null&&L.images?(V=s.find(T=>T.id===d.id))==null?void 0:V.images[0]:void 0}),t.jsxRuntimeExports.jsxs("div",{className:M.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:M.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:T=>J(T,d)})}),I&&t.jsxRuntimeExports.jsx("div",{className:M.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(T=>T.id!==d.id))})})]})]});return o?t.jsxRuntimeExports.jsx(Re,{product:d,index:R,children:B},d.id):t.jsxRuntimeExports.jsx("div",{className:M.product,children:B},d.id)};return t.jsxRuntimeExports.jsxs("div",{className:M.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:M.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:M.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:d=>e==null?void 0:e(d)})]}),g&&n&&v&&F&&t.jsxRuntimeExports.jsx(fe,{ref:C,activeItem:g,setActiveItem:E,popupPosition:z,modalOptions:v,setIsOpenModal:P}),$&&O&&t.jsxRuntimeExports.jsx(mt,{...O}),t.jsxRuntimeExports.jsxs("div",{className:M.products,children:[x&&t.jsxRuntimeExports.jsx("h5",{className:M.subtitle,children:x}),o?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:D,onDragEnd:b,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(d=>d.id),strategy:t.verticalListSortingStrategy,children:s.map((d,R)=>A(d,R))})}):s.map((d,R)=>A(d,R)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(M.button,{[M.disabled]:!!(N&&N<=s.length||s.length===(u==null?void 0:u.length))}),size:"s",disabled:!!(N&&N<=s.length||s.length===(u==null?void 0:u.length)),onClick:()=>{const d=[...s];let R=null;if(u){for(let B=0;B<u.length;B++)if(!s.find(L=>L.id===u[B].id)){R=u[B];break}}m==="select"&&u?d.push({name:R?R.name:u[0].name,id:(R==null?void 0:R.id)||u[0].id,...q}):m==="input"?d.push({name:"",id:t.v4(),...q}):d.push({name:`Image ${s.length+1}`,id:t.v4(),...q}),i(d)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:M.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:r}),S!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(S.scrollInterval),onChange:d=>S.setScrollInterval(Number(d)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},ye="_title_82zux_1",Ie="_subtitle_82zux_5",ke="_header_82zux_12",$e="_text_82zux_13",Ne="_productsBlock_82zux_14",we="_top_82zux_26",Se="_itemsBlock_82zux_35",Ce="_typeTexts_82zux_41",Be="_block_82zux_48",Te="_active_82zux_61",Pe="_products_82zux_14",Ae="_product_82zux_14",Oe="_button_82zux_80",qe="_disabled_82zux_91",Le="_image_82zux_95",De="_info_82zux_102",Me="_name_82zux_114",He="_buttons_82zux_118",ze="_modal_82zux_125",Fe="_link_82zux_145",Ve="_modalOptions_82zux_151",Ue="_addButton_82zux_157",Ye="_deleteButton_82zux_179",W={title:ye,subtitle:Ie,header:ke,text:$e,productsBlock:Ne,top:we,itemsBlock:Se,typeTexts:Ce,block:Be,active:Te,products:Pe,product:Ae,button:Oe,disabled:qe,image:Le,info:De,name:Me,buttons:He,modal:ze,link:Fe,modalOptions:Ve,addButton:Ue,deleteButton:Ye},Ge=l=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:x,draggable:n=!1,withImage:o=!1,addable:j=!0,itemsOptions:I,hasRangeSelector:p=!1,rangeSelectorOptions:m,limit:h,autoScrollInterval:u}=l;function $(v){if(o)return v?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${v[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const O=v=>{const q=I.find(S=>S.id===v);if(!q)return;const N=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[n&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:S=>{const g=[...s],E=I.find(f=>f.name===S);if(!E)return;const z=E.id,X=g.map(f=>f===v?z:f);i([...X])},value:q.name,options:I.filter(S=>!s.find(g=>g===S.id)).map(S=>S.name),leftAddon:$(q.images)}),t.jsxRuntimeExports.jsx("div",{className:W.buttons,children:t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(S=>S!==v))})})})]});return t.jsxRuntimeExports.jsx("div",{className:W.product,children:N},v)};return t.jsxRuntimeExports.jsxs("div",{className:W.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:W.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:W.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:v=>e==null?void 0:e(v)})]}),p&&m&&t.jsxRuntimeExports.jsx(mt,{...m}),t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[x&&t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:x}),s.map(v=>O(v)),j&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(W.button,{[W.disabled]:!!(h&&h<=s.length||s.length===I.length)}),size:"s",disabled:!!(h&&h<=s.length||s.length===I.length),onClick:()=>{const v=[...s];let q=null;if(I){for(let N=0;N<I.length;N++)if(!s.find(S=>S===I[N].id)){q=I[N];break}}v.push((q==null?void 0:q.id)||I[0].id),i(v)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:r}),u!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(u.scrollInterval),onChange:v=>u.setScrollInterval(Number(v)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},We="_title_1wm9m_1",Xe="_subtitle_1wm9m_5",Je="_header_1wm9m_12",Qe="_text_1wm9m_13",Ke="_productsBlock_1wm9m_14",Ze="_top_1wm9m_26",ts="_itemsBlock_1wm9m_35",es="_typeTexts_1wm9m_41",ss="_block_1wm9m_48",ns="_active_1wm9m_61",is="_products_1wm9m_14",os="_product_1wm9m_14",rs="_button_1wm9m_80",as="_disabled_1wm9m_91",cs="_image_1wm9m_95",ls="_info_1wm9m_102",us="_name_1wm9m_114",ds="_buttons_1wm9m_118",xs="_modal_1wm9m_125",ms="_link_1wm9m_146",ps="_modalOptions_1wm9m_152",hs="_addButton_1wm9m_164",_s="_deleteButton_1wm9m_179",H={title:We,subtitle:Xe,header:Je,text:Qe,productsBlock:Ke,top:Ze,itemsBlock:ts,typeTexts:es,block:ss,active:ns,products:is,product:os,button:rs,disabled:as,image:cs,info:ls,name:us,buttons:ds,modal:xs,link:ms,modalOptions:ps,addButton:hs,deleteButton:_s},js=_.forwardRef((l,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=l;function x(n,o){return n.length>o?`${n.slice(0,o)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:a,className:H.modal,onClick:n=>{n.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:x(e.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:H.modalOptions,children:r.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:o=>{const j={...e,[n.field]:o};s(j)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(jt,{typesText:e[n.field.type],setTypesText:o=>{const j={...e,[n.field.type]:o};s(j)},text:e[n.field.text]||"",setText:o=>{const j={...e,[n.field.text]:o};s(j)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const j={...e,[n.field]:o};s(j)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:H.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const j={...e,[n.field.text]:o};s(j)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:o=>{const j={...e,[n.field.switch]:o};s(j)}})]});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:o=>{const j={...e,[n.field]:o};s(j)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})});function gs(l){const{product:a,children:e}=l,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:x,isDragging:n}=t.useSortable({id:a.id}),o={transform:t.CSS.Transform.toString(c),transition:x};return t.jsxRuntimeExports.jsx("div",{ref:r,style:o,className:`${H.product} ${n?H.dragging:""}`,...s,...i,children:e})}const fs=l=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:x,editable:n=!0,draggable:o=!1,withImage:j=!1,deletable:I=!0,addable:p=!0,itemsType:m,itemsPlaceholder:h="",itemsOptions:u,hasRangeSelector:$=!1,rangeSelectorOptions:O,modalOptions:v,addableOptions:q={}}=l,[N,S]=_.useState(null),[g,E]=_.useState({top:0,left:0}),[z,X]=_.useState(null),f=_.useRef(null),[y,C]=_.useState(!1),F=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const b=()=>{S(null),C(!1)};return document.body.addEventListener("click",b),S(null),C(!1),()=>{S(null),C(!1),document.body.removeEventListener("click",b)}},[]),_.useEffect(()=>{if(N){const b=[...s].map(A=>A.id===N.id?N:A);i(b)}},[N]),_.useEffect(()=>{if(f.current&&z){const b=f.current.getBoundingClientRect().height,A=window.innerHeight;let d=z.top;d+b>A+window.scrollY-200&&(d=A+window.scrollY-b-200),d<0&&(d=10),E({top:d,left:z.left})}},[f.current,z]);const P=(b,A)=>{b.stopPropagation();const d=b.target.getBoundingClientRect();X({top:d.top+window.scrollY,left:d.left-30}),S(A),C(!0)};function D(b){if(j)return b?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${b[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const J=b=>{const{active:A,over:d}=b;if(d&&A.id!==d.id){const R=s.findIndex(L=>L.id===A.id),B=s.findIndex(L=>L.id===d.id);if(R!==-1&&B!==-1){const L=[...s],[V]=L.splice(R,1);L.splice(B,0,V),i(L)}}},et=b=>{var d;const A=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&u&&t.jsxRuntimeExports.jsx(t.Select,{onChange:R=>{const L=[...s].map(V=>V.id===b.id?{...b,name:R}:V);S({...b,name:R}),i([...L])},value:b.name,options:u.filter(R=>!s.find(B=>B.name===R)),leftAddon:D(b.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:R=>{const L=[...s].map(V=>V.id===b.id?{...b,name:R}:V);i([...L])},value:b.name,placeholder:h}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:R=>{const L=[...s].map(V=>V.id===b.id?{...b,images:R}:V);i([...L])},activeImage:(d=s.find(R=>R.id===b.id))==null?void 0:d.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:H.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:R=>P(R,b)})}),I&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(R=>R.id!==b.id))})})]})]});return o?t.jsxRuntimeExports.jsx(gs,{product:b,children:A},b.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:A},b.id)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:b=>e==null?void 0:e(b)})]}),N&&n&&v&&y&&t.jsxRuntimeExports.jsx(js,{ref:f,activeItem:N,setActiveItem:S,popupPosition:g,modalOptions:v,setIsOpenModal:C}),$&&O&&t.jsxRuntimeExports.jsx(mt,{...O}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[x&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:x}),o?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:F,onDragEnd:J,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(b=>b.id),strategy:t.verticalListSortingStrategy,children:s.map(b=>et(b))})}):s.map(b=>et(b)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:H.button,size:"s",onClick:()=>{const b=[...s];let A=null;if(u){for(let d=0;d<u.length;d++)if(!s.find(R=>R.name===u[d])){A=u[d];break}}m==="select"&&u?b.push({name:A||u[0],id:t.v4(),...q,maxSymbols:100}):m==="input"?b.push({name:"",id:t.v4(),...q,maxSymbols:100}):b.push({name:`Image ${s.length+1}`,id:t.v4(),...q,maxSymbols:100}),i(b)},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})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:r})]})},bs="_title_174ru_1",vs="_subtitle_174ru_5",Es="_header_174ru_12",Rs="_text_174ru_13",ys="_productsBlock_174ru_14",Is="_buttonsBlock_174ru_15",ks="_top_174ru_26",$s="_itemsBlock_174ru_35",Ns="_typeTexts_174ru_41",ws="_block_174ru_48",Ss="_active_174ru_60",Cs="_products_174ru_14",Bs="_product_174ru_14",Ts="_button_174ru_15",Ps="_image_174ru_90",As="_info_174ru_97",Os="_name_174ru_109",qs="_buttons_174ru_15",Ls="_modal_174ru_120",Ds="_other_174ru_139",Ms="_options_174ru_145",it={title:bs,subtitle:vs,header:Es,text:Rs,productsBlock:ys,buttonsBlock:Is,top:ks,itemsBlock:$s,typeTexts:Ns,block:ws,active:Ss,products:Cs,product:Bs,button:Ts,image:Ps,info:As,name:Os,buttons:qs,modal:Ls,other:Ds,options:Ms},Hs=_.forwardRef((l,a)=>{const{activeButton:e,setActiveButton:s,popupPosition:i}=l,[r,c]=_.useState(e.typesText),[x,n]=_.useState(e.destination),[o,j]=_.useState(e.page),[I,p]=_.useState(e.link||""),[m,h]=_.useState(e.text||""),[u,$]=_.useState(e.openInNewTab),{pages:O}=t.usePagesStore();return _.useEffect(()=>{s({...e,...{text:m,link:I,destination:x,typesText:r,page:o,openInNewTab:u}})},[r,x,I,m,o,u]),t.jsxRuntimeExports.jsxs("div",{className:it.modal,onClick:v=>{v.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},ref:a,children:[t.jsxRuntimeExports.jsxs("div",{className:it.top,children:[t.jsxRuntimeExports.jsx("h3",{className:it.title,children:e.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:it.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:v=>n(v),options:["Go to Page","Open Link"].filter(v=>v!==x),value:x}),x==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:v=>j(v),options:O?Object.values(O).filter(v=>v.name!==o).map(v=>v.name):[],value:o}):t.jsxRuntimeExports.jsx(t.Input,{onChange:v=>p(v),value:I,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:v=>$(v)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:v=>h(v),value:m,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(_t,{typesText:r,setTypesText:c})]})]})}),zs="_subtitle_jql1y_1",Fs="_header_jql1y_8",Vs="_text_jql1y_9",Us="_productsBlock_jql1y_10",Ys="_buttonsBlock_jql1y_11",Gs="_top_jql1y_23",Ws="_itemsBlock_jql1y_32",Xs="_typeTexts_jql1y_38",Js="_block_jql1y_45",Qs="_active_jql1y_58",Ks="_products_jql1y_10",Zs="_product_jql1y_10",tn="_button_jql1y_11",en="_image_jql1y_88",sn="_info_jql1y_95",nn="_name_jql1y_107",on="_buttons_jql1y_11",rn="_modal_jql1y_118",an="_other_jql1y_138",cn="_options_jql1y_144",ln="_addButton_jql1y_150",un="_deleteButton_jql1y_165",Q={subtitle:zs,header:Fs,text:Vs,productsBlock:Us,buttonsBlock:Ys,top:Gs,itemsBlock:Ws,typeTexts:Xs,block:Js,active:Qs,products:Ks,product:Zs,button:tn,image:en,info:sn,name:nn,buttons:on,modal:rn,other:an,options:cn,addButton:ln,deleteButton:un},ft=l=>{const{buttons:a,setButtons:e,deletable:s=!0,addable:i=!0}=l,[r,c]=_.useState(null),[x,n]=_.useState({top:0,left:0}),[o,j]=_.useState(null),I=_.useRef(null);_.useEffect(()=>{const m=()=>{c(null)};return document.body.addEventListener("click",m),c(null),()=>{c(null),document.body.removeEventListener("click",m)}},[]),_.useEffect(()=>{if(r){const m=[...a].map(h=>h.id===r.id?r:h);e(m)}},[r]),_.useEffect(()=>{if(I.current&&o){const m=I.current.getBoundingClientRect().height,h=window.innerHeight;let u=o.top;u+m>h+window.scrollY-200&&(u=h+window.scrollY-m-200),u<0&&(u=10),n({top:u,left:o.left})}},[I.current,o]);const p=(m,h)=>{m.stopPropagation();const u=m.target.getBoundingClientRect();j({top:u.top+window.scrollY,left:u.left-30}),c(h)};return t.jsxRuntimeExports.jsxs("div",{className:Q.products,children:[t.jsxRuntimeExports.jsx("h5",{className:Q.subtitle,children:"Button Type"}),a.map(m=>t.jsxRuntimeExports.jsxs("div",{className:Q.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:h=>{const $=[...a].map(O=>O.id===m.id?{...m,type:h}:O);e($)},value:m.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:Q.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:Q.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:h=>{p(h,m)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:Q.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const h=a.filter(u=>u.id!==m.id);e(h)},width:20,height:20,fill:"#C12A2A"})})]})]},m.id)),r&&t.jsxRuntimeExports.jsx(Hs,{ref:I,activeButton:r,setActiveButton:c,popupPosition:x}),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:Q.button,size:"s",onClick:()=>{const m=[...a];m.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:"Button Name",page:"home",openInNewTab:!0}),e(m)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:Q.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},dn=l=>{const{isActiveButtons:a,setIsActiveButtons:e,buttons:s,setButtons:i}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:it.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:it.top,children:[t.jsxRuntimeExports.jsx("h3",{className:it.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:r=>e(r)})]}),t.jsxRuntimeExports.jsx(ft,{buttons:s,setButtons:i})]})})},xn="_wrapper_m18qi_1",mn="_subtitle_m18qi_7",pn="_content_m18qi_14",hn="_range_m18qi_22",_n="_track_m18qi_27",jn="_progress_m18qi_36",gn="_dots_m18qi_46",fn="_dot_m18qi_46",bn="_active_m18qi_65",vn="_input_m18qi_77",En="_countBlock_m18qi_91",Rn="_count_m18qi_91",yn="_controls_m18qi_107",In="_button_m18qi_113",U={wrapper:xn,subtitle:mn,content:pn,range:hn,track:_n,progress:jn,dots:gn,dot:fn,active:bn,input:vn,countBlock:En,count:Rn,controls:yn,button:In},mt=l=>{const{label:a,min:e=1,max:s=4,step:i=1,count:r,setCount:c}=l,[x,n]=_.useState(!1),o=Array.from({length:(s-e)/i+1}),j=(r-e)/(s-e)*100,I=()=>{r<s&&c(r+i)},p=()=>{r>e&&c(r-i)},m=h=>{const u=e+h*i;c(u)};return t.jsxRuntimeExports.jsxs("div",{className:U.wrapper,children:[a&&t.jsxRuntimeExports.jsx("h5",{className:U.subtitle,children:a}),t.jsxRuntimeExports.jsxs("div",{className:U.content,children:[t.jsxRuntimeExports.jsxs("div",{className:U.range,children:[t.jsxRuntimeExports.jsx("div",{className:U.track}),t.jsxRuntimeExports.jsx("div",{className:U.progress,style:{width:`${j}%`}}),t.jsxRuntimeExports.jsx("div",{className:U.dots,children:o.map((h,u)=>{const $=u<=(r-e)/i;return t.jsxRuntimeExports.jsx("button",{onClick:()=>m(u),className:t.clx(U.dot,{[U.active]:$,[U.inactive]:!$,[U.dragging]:x}),"aria-label":`Set value to ${e+u*i}`},u)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:i,value:r,onChange:h=>c(Number(h.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:U.input})]}),t.jsxRuntimeExports.jsxs("div",{className:U.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:h=>{const u=Number(h);u>s?c(s):u<e?c(e):c(u)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:U.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:I,disabled:r>=s,className:U.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:p,disabled:r<=e,className:U.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},kn="_title_1lejm_1",$n="_subtitle_1lejm_5",Nn="_header_1lejm_12",wn="_text_1lejm_13",Sn="_productsBlock_1lejm_14",Cn="_top_1lejm_26",Bn="_itemsBlock_1lejm_35",Tn="_typeTexts_1lejm_41",Pn="_block_1lejm_48",An="_active_1lejm_61",On="_products_1lejm_14",qn="_product_1lejm_14",Ln="_button_1lejm_80",Dn="_image_1lejm_91",Mn="_info_1lejm_98",Hn="_name_1lejm_110",zn="_buttons_1lejm_114",Fn="_modal_1lejm_121",Vn="_link_1lejm_141",Un="_modalOptions_1lejm_147",Yn="_addButton_1lejm_159",Gn="_deleteButton_1lejm_174",Y={title:kn,subtitle:$n,header:Nn,text:wn,productsBlock:Sn,top:Cn,itemsBlock:Bn,typeTexts:Tn,block:Pn,active:An,products:On,product:qn,button:Ln,image:Dn,info:Mn,name:Hn,buttons:zn,modal:Fn,link:Vn,modalOptions:Un,addButton:Yn,deleteButton:Gn},Wn=l=>{const{activeItem:a,setActiveItem:e,popupPosition:s,setIsOpenModal:i,itemsOptions:r}=l,c=r.find(n=>n.id===a.listingId);if(!c)return null;function x(n,o){return n.length>o?`${n.slice(0,o)}...`:n}return t.jsxRuntimeExports.jsxs("div",{className:Y.modal,onClick:n=>{n.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:Y.top,children:[t.jsxRuntimeExports.jsx("h3",{children:x(c.productData.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{i(!1),e(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:Y.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:c.productData.images.length>0?c.productData.images[0].cfId:void 0,onChange:n=>{const o={...a,image:n[0]};e(o)}})})]})};function Xn(l){const{product:a,children:e}=l,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:x,isDragging:n}=t.useSortable({id:String(a.listingId)}),o={transform:t.CSS.Transform.toString(c),transition:x};return t.jsxRuntimeExports.jsx("div",{ref:r,style:o,className:`${Y.product} ${n?Y.dragging:""}`,...s,...i,children:e})}const Jn=l=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:x,editable:n=!0,draggable:o=!1,withImage:j=!1,deletable:I=!0,addable:p=!0,itemsType:m,itemsOptions:h}=l,[u,$]=_.useState(null),[O,v]=_.useState({top:0,left:0}),[q,N]=_.useState(!1),S=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));_.useEffect(()=>{const f=()=>{$(null),N(!1)};return document.body.addEventListener("click",f),$(null),N(!1),()=>{$(null),N(!1),document.body.removeEventListener("click",f)}},[]),_.useEffect(()=>{if(u){const f=[...s].map(y=>y.listingId===u.listingId?u:y);i(f)}},[u]);const g=(f,y)=>{f.stopPropagation();const C=f.target.getBoundingClientRect(),F=100,P=window.innerHeight;let D=C.top+window.scrollY;D+F>P&&(D=P-F-20),N(!0),v({top:D-80,left:C.left-30}),$(y)};function E(f){if(j)return f?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${f}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const z=f=>{const{active:y,over:C}=f;if(C&&y.id!==C.id){const F=s.findIndex(D=>String(D.listingId)===y.id),P=s.findIndex(D=>String(D.listingId)===C.id);if(F!==-1&&P!==-1){const D=[...s],[J]=D.splice(F,1);D.splice(P,0,J),i(D)}}},X=(f,y)=>{const C=h.find(P=>f.listingId===P.id);if(!C)return null;const F=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o&&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:P=>{const D=[...s],J=h.find(A=>A.productData.name===P);if(!J)return;const et={listingId:J.id,image:J.productData.images.length>0?J.productData.images[0].cfId:""},b=D.map(A=>A.listingId===f.listingId?et:A);$(et),i([...b])},value:C.productData.name,options:[...h.filter(P=>!s.find(D=>D.listingId===P.id)).map(P=>P.productData.name)],leftAddon:E(f.image||C.productData.images.length>0&&C.productData.images[0].cfId||"")},y),t.jsxRuntimeExports.jsxs("div",{className:Y.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:Y.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:P=>g(P,f)})}),I&&t.jsxRuntimeExports.jsx("div",{className:Y.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(P=>P!==f))})})]})]});return o?t.jsxRuntimeExports.jsx(Xn,{product:f,children:F},f.listingId):t.jsxRuntimeExports.jsx("div",{className:Y.product,children:F},f.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:Y.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:Y.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:Y.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:f=>e==null?void 0:e(f)})]}),q&&u&&t.jsxRuntimeExports.jsx(Wn,{activeItem:u,setActiveItem:$,setIsOpenModal:N,popupPosition:O,itemsOptions:h}),t.jsxRuntimeExports.jsxs("div",{className:Y.products,children:[x&&t.jsxRuntimeExports.jsx("h5",{className:Y.subtitle,children:x}),o?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:S,onDragEnd:z,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(f=>String(f.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((f,y)=>X(f,y))})}):s.map((f,y)=>X(f,y)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:Y.button,size:"s",onClick:()=>{const f=[...s];for(let y=0;y<h.length;y++)if(!s.find(C=>C.listingId===h[y].id)){f.push({listingId:h[y].id,image:h[y].productData.images.length>0?h[y].productData.images[0].cfId:""});break}i(f)},disabled:s.length===h.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:Y.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:r})]})},Qn="_options_d1lk6_1",Kn="_price_d1lk6_12",Zn="_oldPrice_d1lk6_19",ti="_newPrice_d1lk6_27",ei="_animate_d1lk6_34",si="_appearAndBounce_d1lk6_1",ni="_meta_d1lk6_52",ii="_info_d1lk6_58",oi="_infoRight_d1lk6_66",ri="_buttons_d1lk6_73",ai="_variants_d1lk6_80",ci="_variant_d1lk6_80",li="_stock_d1lk6_98",ui="_variantInfo_d1lk6_105",di="_quantity_d1lk6_111",xi="_count_d1lk6_118",mi="_focused_d1lk6_135",pi="_button_d1lk6_73",hi="_activeVariant_d1lk6_161",_i="_chargeTypes_d1lk6_165",ji="_charge_d1lk6_165",gi="_chargeActive_d1lk6_190",fi="_title_d1lk6_198",k={options:Qn,price:Kn,oldPrice:Zn,newPrice:ti,animate:ei,appearAndBounce:si,meta:ni,info:ii,infoRight:oi,buttons:ri,variants:ai,variant:ci,stock:li,variantInfo:ui,quantity:di,count:xi,focused:mi,button:pi,activeVariant:hi,chargeTypes:_i,charge:ji,chargeActive:gi,title:fi};var bt=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(bt||{});const bi=l=>{var N,S;const{variants:a}=l,[e,s]=_.useState(a[0]),[i,r]=_.useState(e.chargeTypes[0]),c=t.useNavigate(),[x,n]=_.useState(1),[o,j]=_.useState(!1),{reset:I,addProductToCart:p,getProducts:m}=t.useCart(),[h,u]=_.useState(!1);_.useEffect(()=>{u(!0);const g=setTimeout(()=>u(!1),600);return()=>clearTimeout(g)},[x]);async function $(){await m(),await p({productId:l.id,productVariantId:e.id,quantity:x})}function O(){I(),$(),c("/checkout")}function v(g){if(g>=864e5){const y=Math.floor(g/864e5);return`${y} ${y===1?"day":"days"}`}else if(g>=36e5){const y=Math.floor(g/36e5);return`${y} ${y===1?"hour":"hours"}`}else if(g>=6e4){const y=Math.floor(g/6e4);return`${y} ${y===1?"minute":"minutes"}`}else{const y=Math.floor(g/1e3);return`${y} ${y===1?"second":"seconds"}`}}function q(g,E){return g.length>E?g.slice(0,E)+"...":g}return t.jsxRuntimeExports.jsxs("div",{className:k.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:k.chargeTypes,children:e.chargeTypes.map(g=>t.jsxRuntimeExports.jsx("div",{className:t.clx(k.charge,{[k.chargeActive]:i===g}),onClick:()=>r(g),children:bt[g]},g))}),t.jsxRuntimeExports.jsx("div",{className:k.variants,children:a.map(g=>{var E;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(k.variant,{[k.activeVariant]:e.id===g.id}),onClick:()=>s(g),children:[t.jsxRuntimeExports.jsxs("div",{className:k.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:k.title,children:q(g.name,15)}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?g.price.amount:g.subscriptionSettings?g.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:k.stock,children:[((E=g.quantity.restrictions)==null?void 0:E.max)||g.quantity.available||0," in stock"]})})]},g.id)})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:k.quantity,children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>{x>1?n(g=>g-1):n(1)},className:k.button,disabled:e.quantity.restrictions&&x<=e.quantity.restrictions.min,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("label",{className:t.clx(k.count,{[k.focused]:o}),onFocus:()=>j(!0),onBlur:()=>j(!1),children:t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(x),onChange:g=>n(Number(g)),max:((N=e.quantity.restrictions)==null?void 0:N.max)||e.quantity.available||1/0,min:((S=e.quantity.restrictions)==null?void 0:S.min)||0,style:{backgroundColor:"transparent",border:"none",textAlign:"center"}})}),t.jsxRuntimeExports.jsx("button",{onClick:()=>{n(g=>g+1)},className:k.button,disabled:!!(e.quantity.restrictions&&x>=e.quantity.restrictions.max||e.quantity.available&&x>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:k.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:k.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:k.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":v(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:k.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:k.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:k.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:h}),children:["$ ",(e.price.amount||0)*x]}),t.jsxRuntimeExports.jsxs("span",{className:k.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*x]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:h}),children:["$ ",(e.price.amount||0)*x]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:k.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:h}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:k.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(k.newPrice,{[k.animate]:h}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:k.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>O(),children:t.jsxRuntimeExports.jsx("span",{children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>$(),children:"Add to Cart"})]})]})},vi="_button_oyh2y_1",Ei="_login_oyh2y_14",Ri="_signUp_oyh2y_18",yi="_buttons_oyh2y_23",Ii="_modal_oyh2y_32",ki="_closing_oyh2y_61",$i="_info_oyh2y_85",Ni="_top_oyh2y_92",wi="_title_oyh2y_103",Si="_clear_oyh2y_110",Ci="_activeClear_oyh2y_117",Bi="_count_oyh2y_121",Ti="_cart_oyh2y_136",Pi="_empty_oyh2y_144",Ai="_product_oyh2y_170",Oi="_products_oyh2y_179",qi="_image_oyh2y_187",Li="_productInfo_oyh2y_193",Di="_content_oyh2y_200",Mi="_name_oyh2y_206",Hi="_price_oyh2y_212",zi="_productButtons_oyh2y_218",Fi="_productButton_oyh2y_218",Vi="_productCount_oyh2y_238",Ui="_bottom_oyh2y_254",Yi="_subtotal_oyh2y_262",Gi="_block_oyh2y_270",Wi="_shoppingCount_oyh2y_277",Xi="_total_oyh2y_297",Ji="_link_oyh2y_303",Qi="_userInfo_oyh2y_310",w={button:vi,login:Ei,signUp:Ri,buttons:yi,modal:Ii,"slide-in-fade":"_slide-in-fade_oyh2y_1",closing:ki,"slide-out-fade":"_slide-out-fade_oyh2y_1",info:$i,top:Ni,title:wi,clear:Si,activeClear:Ci,count:Bi,cart:Ti,empty:Pi,product:Ai,products:Oi,image:qi,productInfo:Li,content:Di,name:Mi,price:Hi,productButtons:zi,productButton:Fi,productCount:Vi,bottom:Ui,subtotal:Yi,block:Gi,shoppingCount:Wi,total:Xi,link:Ji,userInfo:Qi},Ki="_button_85085_1",Zi="_primary_85085_20",to="_primaryHovered_85085_30",eo="_secondary_85085_34",so="_secondaryHovered_85085_44",no="_tertiary_85085_48",io="_tertiaryHovered_85085_58",oo="_content_85085_62",K={button:Ki,primary:Zi,primaryHovered:to,secondary:eo,secondaryHovered:so,tertiary:no,tertiaryHovered:io,content:oo},dt=l=>{const{children:a,onClick:e,style:s,className:i,disabled:r=!1,type:c="Primary"}=l,{themeSettings:x}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(K.button,i,{[K.primary]:c==="Primary",[K.secondary]:c==="Secondary",[K.tertiary]:c==="Tertiary",[K.primaryHovered]:c==="Primary"&&!r&&x.buttons.primary.hover,[K.secondaryHovered]:c==="Secondary"&&!r&&x.buttons.secondary.hover,[K.tertiaryHovered]:c==="Tertiary"&&!r&&x.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:r,children:c==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:K.content,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"#757575",width:20,height:20}),a]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a})})};class ct extends Error{}ct.prototype.name="InvalidTokenError";function ro(l){return decodeURIComponent(atob(l).replace(/(.)/g,(a,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function ao(l){let a=l.replace(/-/g,"+").replace(/_/g,"/");switch(a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ro(a)}catch{return atob(a)}}function co(l,a){if(typeof l!="string")throw new ct("Invalid token specified: must be a string");a||(a={});const e=a.header===!0?0:1,s=l.split(".")[e];if(typeof s!="string")throw new ct(`Invalid token specified: missing part #${e+1}`);let i;try{i=ao(s)}catch(r){throw new ct(`Invalid token specified: invalid base64 for part #${e+1} (${r.message})`)}try{return JSON.parse(i)}catch(r){throw new ct(`Invalid token specified: invalid json for part #${e+1} (${r.message})`)}}const lo=l=>{const{shopping:a,signUp:e}=l,s=t.useNavigate();function i(c){s(c)}const r=JSON.parse(localStorage.getItem("token")||"{}");return t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[a&&t.jsxRuntimeExports.jsx(vt,{}),!r.data&&t.jsxRuntimeExports.jsx(dt,{onClick:()=>i("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),!r.data&&e&&t.jsxRuntimeExports.jsx(dt,{onClick:()=>i("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"}),r.data&&t.jsxRuntimeExports.jsx(yt,{token:r.data})]})},vt=()=>{const[l,a]=_.useState(!1),[e,s]=_.useState([]),{cart:i,getProducts:r}=t.useCart();function c(p){for(let m=0;m<i.parts.length;m++)for(let h=0;h<p.variants.length;h++)if(i.parts[m].productVariantId===p.variants[m].id)return i.parts[m].productVariantId}function x(p){for(let m=0;m<i.parts.length;m++)for(let h=0;h<p.variants.length;h++)if(i.parts[m].productVariantId===p.variants[m].id)return i.parts[m].quantity}_.useEffect(()=>{(async()=>{const m=i.parts.map($=>String($.productId)),u=(await r([...m])).map($=>({...$,activeVariantId:c($),quantity:x($)}));s(u)})()},[i.parts.length]);function n(p){var m;return!p||!(p!=null&&p.variants)?!1:(m=p.variants.find(h=>h.id===p.activeVariantId))==null?void 0:m.subscriptionSettings}const o=i.parts.length>0&&e.length>0&&!n(e[0]),[j,I]=_.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:w.button,onClick:p=>{p.stopPropagation(),a(!0),I(!0)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),o&&t.jsxRuntimeExports.jsx("div",{className:w.shoppingCount,children:i.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{I(!1),setTimeout(()=>{a(!1)},300)},children:t.jsxRuntimeExports.jsx(Et,{activeProducts:e,isCartNotEmpty:o,isOpen:j})})]})},Et=l=>{const{activeProducts:a,isCartNotEmpty:e,isOpen:s}=l,{cart:i,reset:r,getTotalAndDiscount:c,updateQuantityOfProduct:x}=t.useCart(),n=t.useNavigate();function o(p){n(p)}function j(p){x({productId:p.id,productVariantId:p.activeVariantId,quantity:p.quantity+1})}function I(p){x({productId:p.id,productVariantId:p.activeVariantId,quantity:p.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(w.modal,{[w.closing]:!s}),onClick:p=>p.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:w.top,children:[t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{className:w.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:w.count,children:i.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(w.clear,{[w.activeClear]:e}),disabled:!e,onClick:r,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:w.cart,children:[t.jsxRuntimeExports.jsx("div",{className:w.products,children:a.map(p=>t.jsxRuntimeExports.jsxs("div",{className:w.product,children:[t.jsxRuntimeExports.jsxs("div",{className:w.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${p.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:w.image}),t.jsxRuntimeExports.jsxs("div",{className:w.content,children:[t.jsxRuntimeExports.jsx("div",{className:w.name,children:p.name}),t.jsxRuntimeExports.jsxs("div",{className:w.price,children:["$",p.variants.find(m=>m.id===p.activeVariantId).price.amount*((p==null?void 0:p.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{p.quantity!==1&&I(p)},className:w.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:w.productCount,children:p.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>j(p),className:w.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},p.id))}),t.jsxRuntimeExports.jsxs("div",{className:w.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:w.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:w.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:w.total,children:["$",c().total]})]}),t.jsxRuntimeExports.jsx(dt,{onClick:()=>o("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(Rt,{})]})},Rt=()=>t.jsxRuntimeExports.jsxs("div",{className:w.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-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:w.link,children:"view products"})]})]}),yt=({token:l})=>{const[a,e]=_.useState("test-email@gmail.com"),s=t.useNavigate();_.useEffect(()=>{(async()=>{const c=co(l);e(c.email)})()},[l]);function i(r){s(r)}return t.jsxRuntimeExports.jsx("div",{className:w.userInfo,onClick:()=>i("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:a||"test-email@gmail.com"})})},uo="_share_11u0d_1",xo="_modal_11u0d_8",mo="_header_11u0d_14",po="_socials_11u0d_24",ho="_social_11u0d_24",_o="_copy_11u0d_34",jo="_title_11u0d_41",go="_copyWrapper_11u0d_47",fo="_copyText_11u0d_56",tt={share:uo,modal:xo,header:mo,socials:po,social:ho,copy:_o,title:jo,copyWrapper:go,copyText:fo},bo=()=>{const{isOpenModal:l,setIsOpenModal:a}=t.useShareLinkStore();function e(){a(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:tt.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:a,children:t.jsxRuntimeExports.jsx(vo,{})})]})},vo=()=>{const{setIsOpenModal:l}=t.useShareLinkStore(),{notification:a,setNotification:e}=t.useNotificationStore(),s=window.location.href;function i(){navigator.clipboard.writeText(s),e({message:"Link copied to clipboard",status:"success"})}return t.jsxRuntimeExports.jsxs("div",{className:tt.modal,onClick:r=>r.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:tt.header,children:[t.jsxRuntimeExports.jsx("div",{className:tt.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:()=>l(!1),hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:tt.copyWrapper,children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(tt.copy,tt.copyText),onClick:i,children:s}),t.jsxRuntimeExports.jsx("div",{onClick:i,className:tt.copy,children:a?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},Eo="_accordion_1s1lq_1",Ro="_header_1s1lq_9",yo="_icon_1s1lq_18",Io="_open_1s1lq_21",ko="_content_1s1lq_25",at={accordion:Eo,header:Ro,icon:yo,open:Io,content:ko},$o=({title:l,content:a})=>{const[e,s]=_.useState(!1),[i,r]=_.useState(0),c=_.useRef(null),x=()=>{s(!e)};return _.useEffect(()=>{c.current&&r(e?c.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:at.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:at.header,onClick:x,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(at.icon,{[at.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:c,className:at.content,style:{height:`${i}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:a})})]})},No="_wrapper_1r14x_1",wo="_label_1r14x_9",So="_input_1r14x_18",Co="_required_1r14x_35",Bo="_paddingless_1r14x_39",To="_content_1r14x_43",Po="_borderless_1r14x_58",Ao="_rightIcon_1r14x_63",Z={wrapper:No,label:wo,input:So,required:Co,paddingless:Bo,content:To,borderless:Po,rightIcon:Ao},Oo=l=>{const{onChange:a,style:e,label:s,value:i,type:r,min:c,max:x,placeholder:n,disabled:o=!1,required:j=!1,regex:I,paddingless:p=!1,borderless:m=!1,editable:h=!1,isSearch:u=!1}=l,{themeSettings:$}=t.useThemeSettingsStore(),{inputs:O}=$,[v,q]=_.useState(!1);function N(E,z){if(E.startsWith("#")){let y,C,F;return E.length===7?(y=parseInt(E.slice(1,3),16),C=parseInt(E.slice(3,5),16),F=parseInt(E.slice(5,7),16)):E.length===4&&(y=parseInt(E[1]+E[1],16),C=parseInt(E[2]+E[2],16),F=parseInt(E[3]+E[3],16)),`rgba(${y}, ${C}, ${F}, ${z})`}const f={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#00ff00",blue:"#0000ff"}[E.toLowerCase()];return f?N(f,z):E}function S(E){return Number(E)<0?String(c):E}function g(E){return!j||!I?!0:new RegExp(I).test(E)}return t.jsxRuntimeExports.jsxs("div",{className:Z.wrapper,children:[s&&t.jsxRuntimeExports.jsx("label",{className:Z.label,htmlFor:s,children:s}),t.jsxRuntimeExports.jsxs("div",{className:Z.content,style:{paddingRight:O.general.height+15,...e,backgroundColor:N(O.field.color,O.field.opacity/100)},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:r||"text",onChange:E=>{if(r==="text")a(E.target.value);else{const z=S(E.target.value);a(z)}},value:i,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(Z.input,{[Z.required]:v&&j&&!g(i),[Z.paddingless]:p,[Z.borderless]:m}),min:r==="number"?c:void 0,max:r==="number"?x:void 0,disabled:o,onFocus:()=>q(!0)}),u&&t.jsxRuntimeExports.jsx("div",{className:Z.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:O.general.height,height:O.general.height})}),h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},qo="_wrapper_st58d_1",Lo="_label_st58d_10",Do="_textarea_st58d_18",Mo="_length_st58d_33",ut={wrapper:qo,label:Lo,textarea:Do,length:Mo},Ho=l=>{const{onChange:a,label:e,value:s,maxLength:i,placeholder:r="Type something..."}=l,[c,x]=_.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:ut.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:ut.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{x(n.target.value.length),a(n.target.value)},placeholder:r,className:ut.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:ut.length,children:[c,"/",i]})]})};exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextareaSettings=t.Textarea;exports.Accordion=$o;exports.Button=dt;exports.ButtonTypeSettings=ft;exports.ButtonsSettings=dn;exports.CategorySettings=Ge;exports.EmptyCart=Rt;exports.FormSettings=fs;exports.HeaderButtons=lo;exports.InputUI=Oo;exports.ItemsSettings=gt;exports.LayoutSettings=Dt;exports.ListingSelector=Jn;exports.ProductOptions=bi;exports.RangeSelector=mt;exports.ShareLink=bo;exports.ShoppingButton=vt;exports.ShoppingModalCart=Et;exports.TextSettings=jt;exports.TextareaUI=Ho;exports.TypesText=_t;exports.UserInfo=yt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-D1mPV-lW.cjs"),j=require("react");require("@phosphor-icons/react");const It="_wrapper_3ibiw_2",kt="_alignmentBlock_3ibiw_8",$t="_title_3ibiw_15",Nt="_subtitle_3ibiw_22",St="_alignmentContent_3ibiw_29",wt="_alignments_3ibiw_37",Ct="_alignment_3ibiw_8",Bt="_circle_3ibiw_63",Tt="_paddings_3ibiw_70",Pt="_padding_3ibiw_70",At="_active_3ibiw_94",Ot="_input_3ibiw_101",G={wrapper:It,alignmentBlock:kt,title:$t,subtitle:Nt,alignmentContent:St,alignments:wt,alignment:Ct,circle:Bt,paddings:Tt,padding:Pt,active:At,input:Ot},qt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Dt=["left","top","right","bottom"],Lt=l=>{const{alignment:a,padding:e,setPadding:s,setAlignment:i}=l;function r(){switch(a){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 c(o){switch(o){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[x,n]=j.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:G.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:G.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:G.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:G.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:G.alignments,children:qt.map(o=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(o)},className:G.alignment,children:[o!==a&&t.jsxRuntimeExports.jsx("div",{className:G.circle}),o===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(),fill:"#FF3F19",width:22,height:22})]},o))}),t.jsxRuntimeExports.jsx("div",{className:G.paddings,children:Dt.map(o=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(G.padding,{[G.active]:x===o}),onFocus:()=>{n(o)},onBlur:()=>{n(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(o),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[o]),onChange:g=>s({...e,[o]:Number(g)}),paddingless:!0,borderless:!0})]},o))})]})]})]})},Mt="_title_1jkiw_1",Ht="_subtitle_1jkiw_5",zt="_header_1jkiw_12",Ft="_text_1jkiw_13",Vt="_top_1jkiw_20",Ut="_itemsBlock_1jkiw_29",rt={title:Mt,subtitle:Ht,header:zt,text:Ft,top:Vt,itemsBlock:Ut},Yt="_typeTexts_167ez_1",Gt="_block_167ez_8",Wt="_active_167ez_25",pt={typeTexts:Yt,block:Gt,active:Wt},Xt=["bold","italic","underline","strike-through","code"],jt=l=>{const{typesText:a,setTypesText:e}=l;function s(i){switch(i){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:pt.typeTexts,children:Xt.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(pt.block,{[pt.active]:a.includes(i)}),onClick:()=>{const r=[...a];if(r.includes(i)){const c=r.filter(x=>x!==i);e(c)}else r.push(i),e(r)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(i),fill:a.includes(i)?"#252525":"#757575",width:20,height:20})},String(i)))})},_t=l=>{const{typesText:a,isActiveText:e,setIsActiveText:s,text:i,setText:r,setTypesText:c,title:x,subtitle:n="Items"}=l;return t.jsxRuntimeExports.jsxs("div",{className:rt.text,children:[(x||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:rt.top,children:[x&&t.jsxRuntimeExports.jsx("h3",{className:rt.title,children:x}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:o=>s(o)})]}),t.jsxRuntimeExports.jsxs("div",{className:rt.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:rt.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:o=>r(o),value:i,maxLength:150}),t.jsxRuntimeExports.jsx(jt,{typesText:a,setTypesText:c})]})]})},Jt="_title_157lh_1",Qt="_subtitle_157lh_5",Kt="_header_157lh_12",Zt="_text_157lh_13",te="_productsBlock_157lh_14",ee="_top_157lh_26",se="_itemsBlock_157lh_35",ne="_typeTexts_157lh_41",ie="_block_157lh_48",oe="_active_157lh_61",re="_products_157lh_14",ae="_product_157lh_14",ce="_button_157lh_80",le="_disabled_157lh_91",ue="_image_157lh_95",de="_info_157lh_102",xe="_name_157lh_114",me="_buttons_157lh_118",pe="_modal_157lh_125",he="_link_157lh_145",je="_modalOptions_157lh_151",_e="_addButton_157lh_163",ge="_deleteButton_157lh_178",M={title:Jt,subtitle:Qt,header:Kt,text:Zt,productsBlock:te,top:ee,itemsBlock:se,typeTexts:ne,block:ie,active:oe,products:re,product:ae,button:ce,disabled:le,image:ue,info:de,name:xe,buttons:me,modal:pe,link:he,modalOptions:je,addButton:_e,deleteButton:ge},fe=j.forwardRef((l,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=l;function x(n,o){return n.length>o?`${n.slice(0,o)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:a,className:M.modal,onClick:n=>{n.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:M.top,children:[t.jsxRuntimeExports.jsx("h3",{className:M.title,children:x(e.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:M.modalOptions,children:r.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:o=>{const g={...e,[n.field]:o};s(g)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(_t,{typesText:e[n.field.type],setTypesText:o=>{const g={...e,[n.field.type]:o};s(g)},text:e[n.field.text]||"",setText:o=>{const g={...e,[n.field.text]:o};s(g)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const g={...e,[n.field]:o};s(g)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:M.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const g={...e,[n.field.text]:o};s(g)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:o=>{const g={...e,[n.field.switch]:o};s(g)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(gt,{items:e[n.field]||[],setItems:o=>{const g={...e,[n.field]:o};s(g)},itemsType:"select",draggable:n.draggable||!1,itemsOptions:n.itemsOptions,deletable:n.deletable||!1,editable:!1,subtitle:n.label,addableOptions:n.addableOptions});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:o=>{const g={...e,[n.field]:o};s(g)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})}),be="_other_g74jx_1",ve="_subtitle_g74jx_7",Ee="_items_g74jx_14",ht={other:be,subtitle:ve,items:Ee},xt=l=>{const{items:a,title:e="Other"}=l;return t.jsxRuntimeExports.jsxs("div",{className:ht.other,children:[t.jsxRuntimeExports.jsx("h5",{className:ht.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:ht.items,children:a.map((s,i)=>t.jsxRuntimeExports.jsx(t.Switch,{current:s.isItem,onChange:r=>s.setIsItem(r),label:s.label,hasBackground:!0,paddingless:!1},i))})]})};function ye({product:l,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:x}=t.useSortable({id:l.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${M.product} ${x?M.dragging:""}`,...e,...s,children:a})}const gt=l=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:x,editable:n=!0,draggable:o=!1,withImage:g=!1,deletable:y=!0,addable:p=!0,itemsType:m,itemsPlaceholder:h="",itemsOptions:u,hasRangeSelector:k=!1,rangeSelectorOptions:P,modalOptions:v,addableOptions:q={},limit:N,autoScrollInterval:S}=l,[_,O]=j.useState(null),[Y,J]=j.useState({top:0,left:0}),[b,R]=j.useState(null),A=j.useRef(null),[U,B]=j.useState(!1),L=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const d=()=>{O(null),B(!1)};return document.body.addEventListener("click",d),O(null),B(!1),()=>{O(null),B(!1),document.body.removeEventListener("click",d)}},[]),j.useEffect(()=>{if(_){const d=[...s].map(E=>E.id===_.id?_:E);i(d)}},[_]),j.useEffect(()=>{if(A.current&&b){const d=A.current.getBoundingClientRect().height,E=window.innerHeight;let w=b.top;w+d>E+window.scrollY-200&&(w=E+window.scrollY-d-200),w<0&&(w=10),J({top:w,left:b.left})}},[A.current,b]);const X=(d,E)=>{d.stopPropagation();const w=d.target.getBoundingClientRect();R({top:w.top+window.scrollY,left:w.left-30}),O(E),B(!0)};function et(d){if(g)return d?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${d[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const f=d=>{const{active:E,over:w}=d;if(w&&E.id!==w.id){const D=s.findIndex(C=>C.id===E.id),z=s.findIndex(C=>C.id===w.id);if(D!==-1&&z!==-1){const C=[...s],[st]=C.splice(D,1);C.splice(z,0,st),i(C)}}},T=(d,E)=>{var D,z;const w=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&u&&t.jsxRuntimeExports.jsx(t.Select,{onChange:C=>{const st=[...s],ot=u.find(lt=>lt.name===C);if(!ot)return;const nt=st.map(lt=>lt.id===d.id?{...ot,name:C}:lt);O({...d,name:C}),i([...nt])},value:d.name,options:u.filter(C=>!s.find(st=>st.name===C.name)).map(C=>C.name),leftAddon:et(d.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:C=>{const ot=[...s].map(nt=>nt.id===d.id?{...d,name:C}:nt);i([...ot])},value:d.name,placeholder:h}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:C=>{const ot=[...s].map(nt=>nt.id===d.id?{...d,images:C}:nt);i([...ot])},activeImage:(D=s.find(C=>C.id===d.id))!=null&&D.images?(z=s.find(C=>C.id===d.id))==null?void 0:z.images[0]:void 0}),t.jsxRuntimeExports.jsxs("div",{className:M.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:M.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:C=>X(C,d)})}),y&&t.jsxRuntimeExports.jsx("div",{className:M.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(C=>C.id!==d.id))})})]})]});return o?t.jsxRuntimeExports.jsx(ye,{product:d,index:E,children:w},d.id):t.jsxRuntimeExports.jsx("div",{className:M.product,children:w},d.id)};return t.jsxRuntimeExports.jsxs("div",{className:M.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:M.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:M.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:d=>e==null?void 0:e(d)})]}),_&&n&&v&&U&&t.jsxRuntimeExports.jsx(fe,{ref:A,activeItem:_,setActiveItem:O,popupPosition:Y,modalOptions:v,setIsOpenModal:B}),k&&P&&t.jsxRuntimeExports.jsx(mt,{...P}),t.jsxRuntimeExports.jsxs("div",{className:M.products,children:[x&&t.jsxRuntimeExports.jsx("h5",{className:M.subtitle,children:x}),o?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:L,onDragEnd:f,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(d=>d.id),strategy:t.verticalListSortingStrategy,children:s.map((d,E)=>T(d,E))})}):s.map((d,E)=>T(d,E)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(M.button,{[M.disabled]:!!(N&&N<=s.length||s.length===(u==null?void 0:u.length))}),size:"s",disabled:!!(N&&N<=s.length||s.length===(u==null?void 0:u.length)),onClick:()=>{const d=[...s];let E=null;if(u){for(let w=0;w<u.length;w++)if(!s.find(D=>D.id===u[w].id)){E=u[w];break}}m==="select"&&u?d.push({name:E?E.name:u[0].name,id:(E==null?void 0:E.id)||u[0].id,...q}):m==="input"?d.push({name:"",id:t.v4(),...q}):d.push({name:`Image ${s.length+1}`,id:t.v4(),...q}),i(d)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:M.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:r}),S!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(S.scrollInterval),onChange:d=>S.setScrollInterval(Number(d)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Re="_title_82zux_1",Ie="_subtitle_82zux_5",ke="_header_82zux_12",$e="_text_82zux_13",Ne="_productsBlock_82zux_14",Se="_top_82zux_26",we="_itemsBlock_82zux_35",Ce="_typeTexts_82zux_41",Be="_block_82zux_48",Te="_active_82zux_61",Pe="_products_82zux_14",Ae="_product_82zux_14",Oe="_button_82zux_80",qe="_disabled_82zux_91",De="_image_82zux_95",Le="_info_82zux_102",Me="_name_82zux_114",He="_buttons_82zux_118",ze="_modal_82zux_125",Fe="_link_82zux_145",Ve="_modalOptions_82zux_151",Ue="_addButton_82zux_157",Ye="_deleteButton_82zux_179",W={title:Re,subtitle:Ie,header:ke,text:$e,productsBlock:Ne,top:Se,itemsBlock:we,typeTexts:Ce,block:Be,active:Te,products:Pe,product:Ae,button:Oe,disabled:qe,image:De,info:Le,name:Me,buttons:He,modal:ze,link:Fe,modalOptions:Ve,addButton:Ue,deleteButton:Ye},Ge=l=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:x,draggable:n=!1,withImage:o=!1,addable:g=!0,itemsOptions:y,hasRangeSelector:p=!1,rangeSelectorOptions:m,limit:h,autoScrollInterval:u}=l;function k(v){if(o)return v?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${v[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const P=v=>{const q=y.find(S=>S.id===v);if(!q)return;const N=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[n&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:S=>{const _=[...s],O=y.find(b=>b.name===S);if(!O)return;const Y=O.id,J=_.map(b=>b===v?Y:b);i([...J])},value:q.name,options:y.filter(S=>!s.find(_=>_===S.id)).map(S=>S.name),leftAddon:k(q.images)}),t.jsxRuntimeExports.jsx("div",{className:W.buttons,children:t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(S=>S!==v))})})})]});return t.jsxRuntimeExports.jsx("div",{className:W.product,children:N},v)};return t.jsxRuntimeExports.jsxs("div",{className:W.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:W.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:W.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:v=>e==null?void 0:e(v)})]}),p&&m&&t.jsxRuntimeExports.jsx(mt,{...m}),t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[x&&t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:x}),s.map(v=>P(v)),g&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(W.button,{[W.disabled]:!!(h&&h<=s.length||s.length===y.length)}),size:"s",disabled:!!(h&&h<=s.length||s.length===y.length),onClick:()=>{const v=[...s];let q=null;if(y){for(let N=0;N<y.length;N++)if(!s.find(S=>S===y[N].id)){q=y[N];break}}v.push((q==null?void 0:q.id)||y[0].id),i(v)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:r}),u!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(u.scrollInterval),onChange:v=>u.setScrollInterval(Number(v)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},We="_title_fymju_1",Xe="_subtitle_fymju_5",Je="_header_fymju_12",Qe="_text_fymju_13",Ke="_productsBlock_fymju_14",Ze="_top_fymju_26",ts="_itemsBlock_fymju_35",es="_typeTexts_fymju_41",ss="_block_fymju_48",ns="_active_fymju_61",is="_products_fymju_14",os="_product_fymju_14",rs="_button_fymju_80",as="_disabled_fymju_91",cs="_image_fymju_95",ls="_info_fymju_102",us="_name_fymju_114",ds="_buttons_fymju_118",xs="_modal_fymju_125",ms="_link_fymju_146",ps="_modalOptions_fymju_152",hs="_addButton_fymju_164",js="_deleteButton_fymju_179",H={title:We,subtitle:Xe,header:Je,text:Qe,productsBlock:Ke,top:Ze,itemsBlock:ts,typeTexts:es,block:ss,active:ns,products:is,product:os,button:rs,disabled:as,image:cs,info:ls,name:us,buttons:ds,modal:xs,link:ms,modalOptions:ps,addButton:hs,deleteButton:js},_s=j.forwardRef((l,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=l;function x(n,o){return n.length>o?`${n.slice(0,o)}...`:n}return t.jsxRuntimeExports.jsxs("div",{ref:a,className:H.modal,onClick:n=>{n.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:x(e.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:H.modalOptions,children:r.map(n=>{if(n.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[n.field],onChange:o=>{const g={...e,[n.field]:o};s(g)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(_t,{typesText:e[n.field.type],setTypesText:o=>{const g={...e,[n.field.type]:o};s(g)},text:e[n.field.text]||"",setText:o=>{const g={...e,[n.field.text]:o};s(g)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const g={...e,[n.field]:o};s(g)},value:e[n.field]||"",label:n.label,placeholder:n.placeholder});if(n.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:H.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:o=>{const g={...e,[n.field.text]:o};s(g)},value:e[n.field.text]||"",label:n.inputLabel,placeholder:n.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[n.field.switch]||!1,label:n.switchLabel,onChange:o=>{const g={...e,[n.field.switch]:o};s(g)}})]});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:o=>{const g={...e,[n.field]:o};s(g)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]})})})})]})});function gs(l){const{product:a,children:e}=l,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:x,isDragging:n}=t.useSortable({id:a.id}),o={transform:t.CSS.Transform.toString(c),transition:x};return t.jsxRuntimeExports.jsx("div",{ref:r,style:o,className:`${H.product} ${n?H.dragging:""}`,...s,...i,children:e})}const fs=l=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:x,editable:n=!0,draggable:o=!1,withImage:g=!1,deletable:y=!0,addable:p=!0,itemsType:m,itemsPlaceholder:h="",itemsOptions:u,hasRangeSelector:k=!1,rangeSelectorOptions:P,modalOptions:v,addableOptions:q={}}=l,[N,S]=j.useState(null),[_,O]=j.useState({top:0,left:0}),[Y,J]=j.useState(null),b=j.useRef(null),[R,A]=j.useState(!1),U=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const f=()=>{S(null),A(!1)};return document.body.addEventListener("click",f),S(null),A(!1),()=>{S(null),A(!1),document.body.removeEventListener("click",f)}},[]),j.useEffect(()=>{if(N){const f=[...s].map(T=>T.id===N.id?N:T);i(f)}},[N]),j.useEffect(()=>{if(b.current&&Y){const f=b.current.getBoundingClientRect().height,T=window.innerHeight;let d=Y.top;d+f>T+window.scrollY-200&&(d=T+window.scrollY-f-200),d<0&&(d=10),O({top:d,left:Y.left})}},[b.current,Y]);const B=(f,T)=>{f.stopPropagation();const d=f.target.getBoundingClientRect();J({top:d.top+window.scrollY,left:d.left-30}),S(T),A(!0)};function L(f){if(g)return f?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${f[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const X=f=>{const{active:T,over:d}=f;if(d&&T.id!==d.id){const E=s.findIndex(D=>D.id===T.id),w=s.findIndex(D=>D.id===d.id);if(E!==-1&&w!==-1){const D=[...s],[z]=D.splice(E,1);D.splice(w,0,z),i(D)}}},et=f=>{var d;const T=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),m==="select"&&u&&t.jsxRuntimeExports.jsx(t.Select,{onChange:E=>{const D=[...s].map(z=>z.id===f.id?{...f,name:E}:z);S({...f,name:E}),i([...D])},value:f.name,options:u.filter(E=>!s.find(w=>w.name===E)),leftAddon:L(f.images)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:E=>{const D=[...s].map(z=>z.id===f.id?{...f,name:E}:z);i([...D])},value:f.name,placeholder:h}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:E=>{const D=[...s].map(z=>z.id===f.id?{...f,images:E}:z);i([...D])},activeImage:(d=s.find(E=>E.id===f.id))==null?void 0:d.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:H.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:E=>B(E,f)})}),y&&t.jsxRuntimeExports.jsx("div",{className:H.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(E=>E.id!==f.id))})})]})]});return o?t.jsxRuntimeExports.jsx(gs,{product:f,children:T},f.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:T},f.id)};return t.jsxRuntimeExports.jsxs("div",{className:H.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:H.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:H.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:f=>e==null?void 0:e(f)})]}),N&&n&&v&&R&&t.jsxRuntimeExports.jsx(_s,{ref:b,activeItem:N,setActiveItem:S,popupPosition:_,modalOptions:v,setIsOpenModal:A}),k&&P&&t.jsxRuntimeExports.jsx(mt,{...P}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[x&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:x}),o?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:U,onDragEnd:X,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(f=>f.id),strategy:t.verticalListSortingStrategy,children:s.map(f=>et(f))})}):s.map(f=>et(f)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:H.button,size:"s",onClick:()=>{const f=[...s];let T=null;if(u){for(let d=0;d<u.length;d++)if(!s.find(E=>E.name===u[d])){T=u[d];break}}m==="select"&&u?f.push({name:T||u[0],id:t.v4(),...q,maxSymbols:100}):m==="input"?f.push({name:"",id:t.v4(),...q,maxSymbols:100}):f.push({name:`Image ${s.length+1}`,id:t.v4(),...q,maxSymbols:100}),i(f)},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})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:r})]})},bs="_title_174ru_1",vs="_subtitle_174ru_5",Es="_header_174ru_12",ys="_text_174ru_13",Rs="_productsBlock_174ru_14",Is="_buttonsBlock_174ru_15",ks="_top_174ru_26",$s="_itemsBlock_174ru_35",Ns="_typeTexts_174ru_41",Ss="_block_174ru_48",ws="_active_174ru_60",Cs="_products_174ru_14",Bs="_product_174ru_14",Ts="_button_174ru_15",Ps="_image_174ru_90",As="_info_174ru_97",Os="_name_174ru_109",qs="_buttons_174ru_15",Ds="_modal_174ru_120",Ls="_other_174ru_139",Ms="_options_174ru_145",it={title:bs,subtitle:vs,header:Es,text:ys,productsBlock:Rs,buttonsBlock:Is,top:ks,itemsBlock:$s,typeTexts:Ns,block:Ss,active:ws,products:Cs,product:Bs,button:Ts,image:Ps,info:As,name:Os,buttons:qs,modal:Ds,other:Ls,options:Ms},Hs=j.forwardRef((l,a)=>{const{activeButton:e,setActiveButton:s,popupPosition:i}=l,[r,c]=j.useState(e.typesText),[x,n]=j.useState(e.destination),[o,g]=j.useState(e.page),[y,p]=j.useState(e.link||""),[m,h]=j.useState(e.text||""),[u,k]=j.useState(e.openInNewTab),{pages:P}=t.usePagesStore();return j.useEffect(()=>{s({...e,...{text:m,link:y,destination:x,typesText:r,page:o,openInNewTab:u}})},[r,x,y,m,o,u]),t.jsxRuntimeExports.jsxs("div",{className:it.modal,onClick:v=>{v.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},ref:a,children:[t.jsxRuntimeExports.jsxs("div",{className:it.top,children:[t.jsxRuntimeExports.jsx("h3",{className:it.title,children:e.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:it.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:v=>n(v),options:["Go to Page","Open Link"].filter(v=>v!==x),value:x}),x==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:v=>g(v),options:P?Object.values(P).filter(v=>v.name!==o).map(v=>v.name):[],value:o}):t.jsxRuntimeExports.jsx(t.Input,{onChange:v=>p(v),value:y,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:v=>k(v)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:v=>h(v),value:m,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(jt,{typesText:r,setTypesText:c})]})]})}),zs="_subtitle_jql1y_1",Fs="_header_jql1y_8",Vs="_text_jql1y_9",Us="_productsBlock_jql1y_10",Ys="_buttonsBlock_jql1y_11",Gs="_top_jql1y_23",Ws="_itemsBlock_jql1y_32",Xs="_typeTexts_jql1y_38",Js="_block_jql1y_45",Qs="_active_jql1y_58",Ks="_products_jql1y_10",Zs="_product_jql1y_10",tn="_button_jql1y_11",en="_image_jql1y_88",sn="_info_jql1y_95",nn="_name_jql1y_107",on="_buttons_jql1y_11",rn="_modal_jql1y_118",an="_other_jql1y_138",cn="_options_jql1y_144",ln="_addButton_jql1y_150",un="_deleteButton_jql1y_165",K={subtitle:zs,header:Fs,text:Vs,productsBlock:Us,buttonsBlock:Ys,top:Gs,itemsBlock:Ws,typeTexts:Xs,block:Js,active:Qs,products:Ks,product:Zs,button:tn,image:en,info:sn,name:nn,buttons:on,modal:rn,other:an,options:cn,addButton:ln,deleteButton:un},ft=l=>{const{buttons:a,setButtons:e,deletable:s=!0,addable:i=!0}=l,[r,c]=j.useState(null),[x,n]=j.useState({top:0,left:0}),[o,g]=j.useState(null),y=j.useRef(null);j.useEffect(()=>{const m=()=>{c(null)};return document.body.addEventListener("click",m),c(null),()=>{c(null),document.body.removeEventListener("click",m)}},[]),j.useEffect(()=>{if(r){const m=[...a].map(h=>h.id===r.id?r:h);e(m)}},[r]),j.useEffect(()=>{if(y.current&&o){const m=y.current.getBoundingClientRect().height,h=window.innerHeight;let u=o.top;u+m>h+window.scrollY-200&&(u=h+window.scrollY-m-200),u<0&&(u=10),n({top:u,left:o.left})}},[y.current,o]);const p=(m,h)=>{m.stopPropagation();const u=m.target.getBoundingClientRect();g({top:u.top+window.scrollY,left:u.left-30}),c(h)};return t.jsxRuntimeExports.jsxs("div",{className:K.products,children:[t.jsxRuntimeExports.jsx("h5",{className:K.subtitle,children:"Button Type"}),a.map(m=>t.jsxRuntimeExports.jsxs("div",{className:K.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:h=>{const k=[...a].map(P=>P.id===m.id?{...m,type:h}:P);e(k)},value:m.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:K.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:K.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:h=>{p(h,m)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:K.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const h=a.filter(u=>u.id!==m.id);e(h)},width:20,height:20,fill:"#C12A2A"})})]})]},m.id)),r&&t.jsxRuntimeExports.jsx(Hs,{ref:y,activeButton:r,setActiveButton:c,popupPosition:x}),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:K.button,size:"s",onClick:()=>{const m=[...a];m.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:"Button Name",page:"home",openInNewTab:!0}),e(m)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:K.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},dn=l=>{const{isActiveButtons:a,setIsActiveButtons:e,buttons:s,setButtons:i}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:it.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:it.top,children:[t.jsxRuntimeExports.jsx("h3",{className:it.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:r=>e(r)})]}),t.jsxRuntimeExports.jsx(ft,{buttons:s,setButtons:i})]})})},xn="_wrapper_m18qi_1",mn="_subtitle_m18qi_7",pn="_content_m18qi_14",hn="_range_m18qi_22",jn="_track_m18qi_27",_n="_progress_m18qi_36",gn="_dots_m18qi_46",fn="_dot_m18qi_46",bn="_active_m18qi_65",vn="_input_m18qi_77",En="_countBlock_m18qi_91",yn="_count_m18qi_91",Rn="_controls_m18qi_107",In="_button_m18qi_113",F={wrapper:xn,subtitle:mn,content:pn,range:hn,track:jn,progress:_n,dots:gn,dot:fn,active:bn,input:vn,countBlock:En,count:yn,controls:Rn,button:In},mt=l=>{const{label:a,min:e=1,max:s=4,step:i=1,count:r,setCount:c}=l,[x,n]=j.useState(!1),o=Array.from({length:(s-e)/i+1}),g=(r-e)/(s-e)*100,y=()=>{r<s&&c(r+i)},p=()=>{r>e&&c(r-i)},m=h=>{const u=e+h*i;c(u)};return t.jsxRuntimeExports.jsxs("div",{className:F.wrapper,children:[a&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:a}),t.jsxRuntimeExports.jsxs("div",{className:F.content,children:[t.jsxRuntimeExports.jsxs("div",{className:F.range,children:[t.jsxRuntimeExports.jsx("div",{className:F.track}),t.jsxRuntimeExports.jsx("div",{className:F.progress,style:{width:`${g}%`}}),t.jsxRuntimeExports.jsx("div",{className:F.dots,children:o.map((h,u)=>{const k=u<=(r-e)/i;return t.jsxRuntimeExports.jsx("button",{onClick:()=>m(u),className:t.clx(F.dot,{[F.active]:k,[F.inactive]:!k,[F.dragging]:x}),"aria-label":`Set value to ${e+u*i}`},u)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:i,value:r,onChange:h=>c(Number(h.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:F.input})]}),t.jsxRuntimeExports.jsxs("div",{className:F.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:h=>{const u=Number(h);u>s?c(s):u<e?c(e):c(u)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:F.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:y,disabled:r>=s,className:F.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:p,disabled:r<=e,className:F.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},kn="_title_1lejm_1",$n="_subtitle_1lejm_5",Nn="_header_1lejm_12",Sn="_text_1lejm_13",wn="_productsBlock_1lejm_14",Cn="_top_1lejm_26",Bn="_itemsBlock_1lejm_35",Tn="_typeTexts_1lejm_41",Pn="_block_1lejm_48",An="_active_1lejm_61",On="_products_1lejm_14",qn="_product_1lejm_14",Dn="_button_1lejm_80",Ln="_image_1lejm_91",Mn="_info_1lejm_98",Hn="_name_1lejm_110",zn="_buttons_1lejm_114",Fn="_modal_1lejm_121",Vn="_link_1lejm_141",Un="_modalOptions_1lejm_147",Yn="_addButton_1lejm_159",Gn="_deleteButton_1lejm_174",V={title:kn,subtitle:$n,header:Nn,text:Sn,productsBlock:wn,top:Cn,itemsBlock:Bn,typeTexts:Tn,block:Pn,active:An,products:On,product:qn,button:Dn,image:Ln,info:Mn,name:Hn,buttons:zn,modal:Fn,link:Vn,modalOptions:Un,addButton:Yn,deleteButton:Gn},Wn=l=>{const{activeItem:a,setActiveItem:e,popupPosition:s,setIsOpenModal:i,itemsOptions:r}=l,c=r.find(n=>n.id===a.listingId);if(!c)return null;function x(n,o){return n.length>o?`${n.slice(0,o)}...`:n}return t.jsxRuntimeExports.jsxs("div",{className:V.modal,onClick:n=>{n.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{children:x(c.productData.name,20)}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{i(!1),e(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:V.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:c.productData.images.length>0?c.productData.images[0].cfId:void 0,onChange:n=>{const o={...a,image:n[0]};e(o)}})})]})};function Xn(l){const{product:a,children:e}=l,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:x,isDragging:n}=t.useSortable({id:String(a.listingId)}),o={transform:t.CSS.Transform.toString(c),transition:x};return t.jsxRuntimeExports.jsx("div",{ref:r,style:o,className:`${V.product} ${n?V.dragging:""}`,...s,...i,children:e})}const Jn=l=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:x,editable:n=!0,draggable:o=!1,withImage:g=!1,deletable:y=!0,addable:p=!0,itemsType:m,itemsOptions:h}=l,[u,k]=j.useState(null),[P,v]=j.useState({top:0,left:0}),[q,N]=j.useState(!1),S=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const b=()=>{k(null),N(!1)};return document.body.addEventListener("click",b),k(null),N(!1),()=>{k(null),N(!1),document.body.removeEventListener("click",b)}},[]),j.useEffect(()=>{if(u){const b=[...s].map(R=>R.listingId===u.listingId?u:R);i(b)}},[u]);const _=(b,R)=>{b.stopPropagation();const A=b.target.getBoundingClientRect(),U=100,B=window.innerHeight;let L=A.top+window.scrollY;L+U>B&&(L=B-U-20),N(!0),v({top:L-80,left:A.left-30}),k(R)};function O(b){if(g)return b?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${b}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const Y=b=>{const{active:R,over:A}=b;if(A&&R.id!==A.id){const U=s.findIndex(L=>String(L.listingId)===R.id),B=s.findIndex(L=>String(L.listingId)===A.id);if(U!==-1&&B!==-1){const L=[...s],[X]=L.splice(U,1);L.splice(B,0,X),i(L)}}},J=(b,R)=>{const A=h.find(B=>b.listingId===B.id);if(!A)return null;const U=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[o&&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:B=>{const L=[...s],X=h.find(T=>T.productData.name===B);if(!X)return;const et={listingId:X.id,image:X.productData.images.length>0?X.productData.images[0].cfId:""},f=L.map(T=>T.listingId===b.listingId?et:T);k(et),i([...f])},value:A.productData.name,options:[...h.filter(B=>!s.find(L=>L.listingId===B.id)).map(B=>B.productData.name)],leftAddon:O(b.image||A.productData.images.length>0&&A.productData.images[0].cfId||"")},R),t.jsxRuntimeExports.jsxs("div",{className:V.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:B=>_(B,b)})}),y&&t.jsxRuntimeExports.jsx("div",{className:V.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(B=>B!==b))})})]})]});return o?t.jsxRuntimeExports.jsx(Xn,{product:b,children:U},b.listingId):t.jsxRuntimeExports.jsx("div",{className:V.product,children:U},b.listingId)};return t.jsxRuntimeExports.jsxs("div",{className:V.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:V.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:b=>e==null?void 0:e(b)})]}),q&&u&&t.jsxRuntimeExports.jsx(Wn,{activeItem:u,setActiveItem:k,setIsOpenModal:N,popupPosition:P,itemsOptions:h}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[x&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:x}),o?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:S,onDragEnd:Y,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(b=>String(b.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((b,R)=>J(b,R))})}):s.map((b,R)=>J(b,R)),p&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:V.button,size:"s",onClick:()=>{const b=[...s];for(let R=0;R<h.length;R++)if(!s.find(A=>A.listingId===h[R].id)){b.push({listingId:h[R].id,image:h[R].productData.images.length>0?h[R].productData.images[0].cfId:""});break}i(b)},disabled:s.length===h.length,style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:V.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(xt,{items:r})]})},Qn="_options_d1lk6_1",Kn="_price_d1lk6_12",Zn="_oldPrice_d1lk6_19",ti="_newPrice_d1lk6_27",ei="_animate_d1lk6_34",si="_appearAndBounce_d1lk6_1",ni="_meta_d1lk6_52",ii="_info_d1lk6_58",oi="_infoRight_d1lk6_66",ri="_buttons_d1lk6_73",ai="_variants_d1lk6_80",ci="_variant_d1lk6_80",li="_stock_d1lk6_98",ui="_variantInfo_d1lk6_105",di="_quantity_d1lk6_111",xi="_count_d1lk6_118",mi="_focused_d1lk6_135",pi="_button_d1lk6_73",hi="_activeVariant_d1lk6_161",ji="_chargeTypes_d1lk6_165",_i="_charge_d1lk6_165",gi="_chargeActive_d1lk6_190",fi="_title_d1lk6_198",I={options:Qn,price:Kn,oldPrice:Zn,newPrice:ti,animate:ei,appearAndBounce:si,meta:ni,info:ii,infoRight:oi,buttons:ri,variants:ai,variant:ci,stock:li,variantInfo:ui,quantity:di,count:xi,focused:mi,button:pi,activeVariant:hi,chargeTypes:ji,charge:_i,chargeActive:gi,title:fi};var bt=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(bt||{});const bi=l=>{var N,S;const{variants:a}=l,[e,s]=j.useState(a[0]),[i,r]=j.useState(e.chargeTypes[0]),c=t.useNavigate(),[x,n]=j.useState(1),[o,g]=j.useState(!1),{reset:y,addProductToCart:p,getProducts:m}=t.useCart(),[h,u]=j.useState(!1);j.useEffect(()=>{u(!0);const _=setTimeout(()=>u(!1),600);return()=>clearTimeout(_)},[x]);async function k(){await m(),await p({productId:l.id,productVariantId:e.id,quantity:x})}function P(){y(),k(),c("/checkout")}function v(_){if(_>=864e5){const R=Math.floor(_/864e5);return`${R} ${R===1?"day":"days"}`}else if(_>=36e5){const R=Math.floor(_/36e5);return`${R} ${R===1?"hour":"hours"}`}else if(_>=6e4){const R=Math.floor(_/6e4);return`${R} ${R===1?"minute":"minutes"}`}else{const R=Math.floor(_/1e3);return`${R} ${R===1?"second":"seconds"}`}}function q(_,O){return _.length>O?_.slice(0,O)+"...":_}return t.jsxRuntimeExports.jsxs("div",{className:I.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:I.chargeTypes,children:e.chargeTypes.map(_=>t.jsxRuntimeExports.jsx("div",{className:t.clx(I.charge,{[I.chargeActive]:i===_}),onClick:()=>r(_),children:bt[_]},_))}),t.jsxRuntimeExports.jsx("div",{className:I.variants,children:a.map(_=>{var O;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(I.variant,{[I.activeVariant]:e.id===_.id}),onClick:()=>s(_),children:[t.jsxRuntimeExports.jsxs("div",{className:I.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:I.title,children:q(_.name,15)}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?_.price.amount:_.subscriptionSettings?_.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:I.stock,children:[((O=_.quantity.restrictions)==null?void 0:O.max)||_.quantity.available||0," in stock"]})})]},_.id)})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:I.quantity,children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>{x>1?n(_=>_-1):n(1)},className:I.button,disabled:e.quantity.restrictions&&x<=e.quantity.restrictions.min,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("label",{className:t.clx(I.count,{[I.focused]:o}),onFocus:()=>g(!0),onBlur:()=>g(!1),children:t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(x),onChange:_=>n(Number(_)),max:((N=e.quantity.restrictions)==null?void 0:N.max)||e.quantity.available||1/0,min:((S=e.quantity.restrictions)==null?void 0:S.min)||0,style:{backgroundColor:"transparent",border:"none",textAlign:"center"}})}),t.jsxRuntimeExports.jsx("button",{onClick:()=>{n(_=>_+1)},className:I.button,disabled:!!(e.quantity.restrictions&&x>=e.quantity.restrictions.max||e.quantity.available&&x>=e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:I.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:I.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:I.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":v(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:I.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:I.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:I.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:h}),children:["$ ",(e.price.amount||0)*x]}),t.jsxRuntimeExports.jsxs("span",{className:I.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*x]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:h}),children:["$ ",(e.price.amount||0)*x]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:I.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:h}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:I.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(I.newPrice,{[I.animate]:h}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:I.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>P(),children:t.jsxRuntimeExports.jsx("span",{children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>k(),children:"Add to Cart"})]})]})},vi="_button_oyh2y_1",Ei="_login_oyh2y_14",yi="_signUp_oyh2y_18",Ri="_buttons_oyh2y_23",Ii="_modal_oyh2y_32",ki="_closing_oyh2y_61",$i="_info_oyh2y_85",Ni="_top_oyh2y_92",Si="_title_oyh2y_103",wi="_clear_oyh2y_110",Ci="_activeClear_oyh2y_117",Bi="_count_oyh2y_121",Ti="_cart_oyh2y_136",Pi="_empty_oyh2y_144",Ai="_product_oyh2y_170",Oi="_products_oyh2y_179",qi="_image_oyh2y_187",Di="_productInfo_oyh2y_193",Li="_content_oyh2y_200",Mi="_name_oyh2y_206",Hi="_price_oyh2y_212",zi="_productButtons_oyh2y_218",Fi="_productButton_oyh2y_218",Vi="_productCount_oyh2y_238",Ui="_bottom_oyh2y_254",Yi="_subtotal_oyh2y_262",Gi="_block_oyh2y_270",Wi="_shoppingCount_oyh2y_277",Xi="_total_oyh2y_297",Ji="_link_oyh2y_303",Qi="_userInfo_oyh2y_310",$={button:vi,login:Ei,signUp:yi,buttons:Ri,modal:Ii,"slide-in-fade":"_slide-in-fade_oyh2y_1",closing:ki,"slide-out-fade":"_slide-out-fade_oyh2y_1",info:$i,top:Ni,title:Si,clear:wi,activeClear:Ci,count:Bi,cart:Ti,empty:Pi,product:Ai,products:Oi,image:qi,productInfo:Di,content:Li,name:Mi,price:Hi,productButtons:zi,productButton:Fi,productCount:Vi,bottom:Ui,subtotal:Yi,block:Gi,shoppingCount:Wi,total:Xi,link:Ji,userInfo:Qi},Ki="_button_85085_1",Zi="_primary_85085_20",to="_primaryHovered_85085_30",eo="_secondary_85085_34",so="_secondaryHovered_85085_44",no="_tertiary_85085_48",io="_tertiaryHovered_85085_58",oo="_content_85085_62",Z={button:Ki,primary:Zi,primaryHovered:to,secondary:eo,secondaryHovered:so,tertiary:no,tertiaryHovered:io,content:oo},dt=l=>{const{children:a,onClick:e,style:s,className:i,disabled:r=!1,type:c="Primary"}=l,{themeSettings:x}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(Z.button,i,{[Z.primary]:c==="Primary",[Z.secondary]:c==="Secondary",[Z.tertiary]:c==="Tertiary",[Z.primaryHovered]:c==="Primary"&&!r&&x.buttons.primary.hover,[Z.secondaryHovered]:c==="Secondary"&&!r&&x.buttons.secondary.hover,[Z.tertiaryHovered]:c==="Tertiary"&&!r&&x.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:r,children:c==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:Z.content,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"#757575",width:20,height:20}),a]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a})})};class ct extends Error{}ct.prototype.name="InvalidTokenError";function ro(l){return decodeURIComponent(atob(l).replace(/(.)/g,(a,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function ao(l){let a=l.replace(/-/g,"+").replace(/_/g,"/");switch(a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ro(a)}catch{return atob(a)}}function co(l,a){if(typeof l!="string")throw new ct("Invalid token specified: must be a string");a||(a={});const e=a.header===!0?0:1,s=l.split(".")[e];if(typeof s!="string")throw new ct(`Invalid token specified: missing part #${e+1}`);let i;try{i=ao(s)}catch(r){throw new ct(`Invalid token specified: invalid base64 for part #${e+1} (${r.message})`)}try{return JSON.parse(i)}catch(r){throw new ct(`Invalid token specified: invalid json for part #${e+1} (${r.message})`)}}const lo=l=>{const{shopping:a,signUp:e}=l,s=t.useNavigate();function i(c){s(c)}const r=JSON.parse(localStorage.getItem("token")||"{}");return t.jsxRuntimeExports.jsxs("div",{className:$.buttons,children:[a&&t.jsxRuntimeExports.jsx(vt,{}),!r.data&&t.jsxRuntimeExports.jsx(dt,{onClick:()=>i("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),!r.data&&e&&t.jsxRuntimeExports.jsx(dt,{onClick:()=>i("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"}),r.data&&t.jsxRuntimeExports.jsx(Rt,{token:r.data})]})},vt=()=>{const[l,a]=j.useState(!1),[e,s]=j.useState([]),{cart:i,getProducts:r}=t.useCart();function c(p){for(let m=0;m<i.parts.length;m++)for(let h=0;h<p.variants.length;h++)if(i.parts[m].productVariantId===p.variants[m].id)return i.parts[m].productVariantId}function x(p){for(let m=0;m<i.parts.length;m++)for(let h=0;h<p.variants.length;h++)if(i.parts[m].productVariantId===p.variants[m].id)return i.parts[m].quantity}j.useEffect(()=>{(async()=>{const m=i.parts.map(k=>String(k.productId)),u=(await r([...m])).map(k=>({...k,activeVariantId:c(k),quantity:x(k)}));s(u)})()},[i.parts.length]);function n(p){var m;return!p||!(p!=null&&p.variants)?!1:(m=p.variants.find(h=>h.id===p.activeVariantId))==null?void 0:m.subscriptionSettings}const o=i.parts.length>0&&e.length>0&&!n(e[0]),[g,y]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:$.button,onClick:p=>{p.stopPropagation(),a(!0),y(!0)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),o&&t.jsxRuntimeExports.jsx("div",{className:$.shoppingCount,children:i.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{y(!1),setTimeout(()=>{a(!1)},300)},children:t.jsxRuntimeExports.jsx(Et,{activeProducts:e,isCartNotEmpty:o,isOpen:g})})]})},Et=l=>{const{activeProducts:a,isCartNotEmpty:e,isOpen:s}=l,{cart:i,reset:r,getTotalAndDiscount:c,updateQuantityOfProduct:x}=t.useCart(),n=t.useNavigate();function o(p){n(p)}function g(p){x({productId:p.id,productVariantId:p.activeVariantId,quantity:p.quantity+1})}function y(p){x({productId:p.id,productVariantId:p.activeVariantId,quantity:p.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx($.modal,{[$.closing]:!s}),onClick:p=>p.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:$.top,children:[t.jsxRuntimeExports.jsxs("div",{className:$.info,children:[t.jsxRuntimeExports.jsx("span",{className:$.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:$.count,children:i.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx($.clear,{[$.activeClear]:e}),disabled:!e,onClick:r,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:$.cart,children:[t.jsxRuntimeExports.jsx("div",{className:$.products,children:a.map(p=>t.jsxRuntimeExports.jsxs("div",{className:$.product,children:[t.jsxRuntimeExports.jsxs("div",{className:$.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${p.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:$.image}),t.jsxRuntimeExports.jsxs("div",{className:$.content,children:[t.jsxRuntimeExports.jsx("div",{className:$.name,children:p.name}),t.jsxRuntimeExports.jsxs("div",{className:$.price,children:["$",p.variants.find(m=>m.id===p.activeVariantId).price.amount*((p==null?void 0:p.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:$.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{p.quantity!==1&&y(p)},className:$.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:$.productCount,children:p.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>g(p),className:$.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},p.id))}),t.jsxRuntimeExports.jsxs("div",{className:$.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:$.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:$.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:$.total,children:["$",c().total]})]}),t.jsxRuntimeExports.jsx(dt,{onClick:()=>o("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(yt,{})]})},yt=()=>t.jsxRuntimeExports.jsxs("div",{className:$.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-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:$.link,children:"view products"})]})]}),Rt=({token:l})=>{const[a,e]=j.useState("test-email@gmail.com"),s=t.useNavigate();j.useEffect(()=>{(async()=>{const c=co(l);e(c.email)})()},[l]);function i(r){s(r)}return t.jsxRuntimeExports.jsx("div",{className:$.userInfo,onClick:()=>i("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:a||"test-email@gmail.com"})})},uo="_share_11u0d_1",xo="_modal_11u0d_8",mo="_header_11u0d_14",po="_socials_11u0d_24",ho="_social_11u0d_24",jo="_copy_11u0d_34",_o="_title_11u0d_41",go="_copyWrapper_11u0d_47",fo="_copyText_11u0d_56",tt={share:uo,modal:xo,header:mo,socials:po,social:ho,copy:jo,title:_o,copyWrapper:go,copyText:fo},bo=()=>{const{isOpenModal:l,setIsOpenModal:a}=t.useShareLinkStore();function e(){a(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:tt.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:a,children:t.jsxRuntimeExports.jsx(vo,{})})]})},vo=()=>{const{setIsOpenModal:l}=t.useShareLinkStore(),{notification:a,setNotification:e}=t.useNotificationStore(),s=window.location.href;function i(){navigator.clipboard.writeText(s),e({message:"Link copied to clipboard",status:"success"})}return t.jsxRuntimeExports.jsxs("div",{className:tt.modal,onClick:r=>r.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:tt.header,children:[t.jsxRuntimeExports.jsx("div",{className:tt.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:()=>l(!1),hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:tt.copyWrapper,children:[t.jsxRuntimeExports.jsx("div",{className:t.clx(tt.copy,tt.copyText),onClick:i,children:s}),t.jsxRuntimeExports.jsx("div",{onClick:i,className:tt.copy,children:a?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},Eo="_accordion_1s1lq_1",yo="_header_1s1lq_9",Ro="_icon_1s1lq_18",Io="_open_1s1lq_21",ko="_content_1s1lq_25",at={accordion:Eo,header:yo,icon:Ro,open:Io,content:ko},$o=({title:l,content:a})=>{const[e,s]=j.useState(!1),[i,r]=j.useState(0),c=j.useRef(null),x=()=>{s(!e)};return j.useEffect(()=>{c.current&&r(e?c.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:at.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:at.header,onClick:x,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(at.icon,{[at.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:c,className:at.content,style:{height:`${i}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:a})})]})},No="_wrapper_p74l6_1",So="_label_p74l6_9",wo="_input_p74l6_18",Co="_paddingless_p74l6_31",Bo="_content_p74l6_35",To="_contentBorder_p74l6_48",Po="_borderless_p74l6_53",Ao="_rightIcon_p74l6_58",Q={wrapper:No,label:So,input:wo,paddingless:Co,content:Bo,contentBorder:To,borderless:Po,rightIcon:Ao},Oo=l=>{const{onChange:a,style:e,label:s,value:i,type:r,min:c,max:x,placeholder:n,disabled:o=!1,required:g=!1,regex:y,paddingless:p=!1,borderless:m=!1,editable:h=!1,isSearch:u=!1}=l,{themeSettings:k}=t.useThemeSettingsStore(),{inputs:P}=k,[v,q]=j.useState(!1);function N(_){return Number(_)<0?String(c):_}function S(_){return!g||!y?!0:new RegExp(y).test(_)}return t.jsxRuntimeExports.jsxs("div",{className:Q.wrapper,children:[s&&t.jsxRuntimeExports.jsx("label",{className:Q.label,htmlFor:s,children:s}),t.jsxRuntimeExports.jsxs("div",{className:t.clx(Q.content,{[Q.contentBorder]:P.border.active}),style:{paddingRight:P.general.height+15,...e,background:P.field.active?P.field.color:"transparent"},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:r||"text",onChange:_=>{if(r==="text")a(_.target.value);else{const O=N(_.target.value);a(O)}},value:i,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(Q.input,{[Q.required]:v&&g&&!S(i),[Q.paddingless]:p,[Q.borderless]:m}),min:r==="number"?c:void 0,max:r==="number"?x:void 0,disabled:o,onFocus:()=>q(!0)}),u&&t.jsxRuntimeExports.jsx("div",{className:Q.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:P.general.height,height:P.general.height})}),h&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},qo="_wrapper_st58d_1",Do="_label_st58d_10",Lo="_textarea_st58d_18",Mo="_length_st58d_33",ut={wrapper:qo,label:Do,textarea:Lo,length:Mo},Ho=l=>{const{onChange:a,label:e,value:s,maxLength:i,placeholder:r="Type something..."}=l,[c,x]=j.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:ut.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:ut.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{x(n.target.value.length),a(n.target.value)},placeholder:r,className:ut.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:ut.length,children:[c,"/",i]})]})};exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.Icon=t.Icon;exports.InputSettings=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Select=t.Select;exports.Switch=t.Switch;exports.TextareaSettings=t.Textarea;exports.Accordion=$o;exports.Button=dt;exports.ButtonTypeSettings=ft;exports.ButtonsSettings=dn;exports.CategorySettings=Ge;exports.EmptyCart=yt;exports.FormSettings=fs;exports.HeaderButtons=lo;exports.InputUI=Oo;exports.ItemsSettings=gt;exports.LayoutSettings=Lt;exports.ListingSelector=Jn;exports.ProductOptions=bi;exports.RangeSelector=mt;exports.ShareLink=bo;exports.ShoppingButton=vt;exports.ShoppingModalCart=Et;exports.TextSettings=_t;exports.TextareaUI=Ho;exports.TypesText=jt;exports.UserInfo=Rt;