@billgangcom/theme-lib 1.44.3 → 1.44.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.cjs.js +49 -49
- package/dist/builder.es.js +1866 -1840
- package/dist/{index-DFHUslAr.cjs → index-B7M_zl3r.cjs} +30 -30
- package/dist/{index-FNbiNtjB.js → index-_swnDkZg.js} +4806 -4808
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/ui/ButtonTypeSettings/index.d.ts +1 -1
- package/dist/ui/ButtonsSettings/index.d.ts +1 -1
- package/dist/ui/ButtonsSettings/popup.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +861 -850
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),o=require("./index-B7M_zl3r.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.splitTextIntoSpans=o.splitTextIntoSpans;
|
package/dist/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ interface Props {
|
|
|
20
20
|
setIsActiveButtons: (value: boolean) => void;
|
|
21
21
|
buttons: ButtonType[];
|
|
22
22
|
setButtons: (value: ButtonType[]) => void;
|
|
23
|
-
|
|
23
|
+
editableLink?: boolean;
|
|
24
24
|
}
|
|
25
25
|
export declare const ButtonsSettings: React.FC<Props>;
|
|
26
26
|
export {};
|
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DFHUslAr.cjs"),h=require("react");require("@phosphor-icons/react");const wt="_wrapper_1ibay_2",Ct="_alignmentBlock_1ibay_8",Bt="_title_1ibay_15",Tt="_subtitle_1ibay_22",Pt="_alignmentContent_1ibay_29",At="_alignments_1ibay_37",Mt="_alignment_1ibay_8",Ot="_circle_1ibay_60",qt="_paddings_1ibay_67",Dt="_padding_1ibay_67",Ut="_active_1ibay_91",Lt="_input_1ibay_98",J={wrapper:wt,alignmentBlock:Ct,title:Bt,subtitle:Tt,alignmentContent:Pt,alignments:At,alignment:Mt,circle:Ot,paddings:qt,padding:Dt,active:Ut,input:Lt},Ht=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],zt=["left","top","right","bottom"],Ft=u=>{const{alignment:a,padding:e,setPadding:s,setAlignment:i}=u;function r(_){switch(_){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(_){switch(_){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[o,n]=h.useState(null),[d,b]=h.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:J.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:J.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:J.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:J.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:J.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:J.alignments,children:Ht.map(_=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(_)},className:J.alignment,onMouseEnter:()=>{n(_)},onMouseLeave:()=>{n(null)},children:[_!==a&&o!==_&&t.jsxRuntimeExports.jsx("div",{className:J.circle}),_!==a&&o===_&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(o),fill:"#c2c2c2",width:22,height:22}),_===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(a),fill:"#FF3F19",width:22,height:22})]},_))}),t.jsxRuntimeExports.jsx("div",{className:J.paddings,children:zt.map(_=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(J.padding,{[J.active]:d===_}),onFocus:()=>{b(_)},onBlur:()=>{b(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(_),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[_]),onChange:l=>s({...e,[_]:Number(l)}),paddingless:!0,borderless:!0})]},_))})]})]})]})},Vt="_title_1jkiw_1",Yt="_subtitle_1jkiw_5",Gt="_header_1jkiw_12",Xt="_text_1jkiw_13",Wt="_top_1jkiw_20",Jt="_itemsBlock_1jkiw_29",ct={title:Vt,subtitle:Yt,header:Gt,text:Xt,top:Wt,itemsBlock:Jt},Qt="_typeTexts_167ez_1",Kt="_block_167ez_8",Zt="_active_167ez_25",ht={typeTexts:Qt,block:Kt,active:Zt},te=["bold","italic","underline","strike-through","code"],gt=u=>{const{typesText:a,setTypesText:e}=u;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:ht.typeTexts,children:te.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(ht.block,{[ht.active]:a.includes(i)}),onClick:()=>{const r=[...a];if(r.includes(i)){const c=r.filter(o=>o!==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)))})},lt={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",p:"Paragraph"},ft=u=>{const{typesText:a,isActiveText:e,setIsActiveText:s,text:i,setText:r,setTypesText:c,title:o,subtitle:n="Items",typeFont:d,setTypeFont:b}=u;return t.jsxRuntimeExports.jsxs("div",{className:ct.text,children:[(o||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:ct.top,children:[o&&t.jsxRuntimeExports.jsx("h3",{className:ct.title,children:o}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:_=>s(_)})]}),t.jsxRuntimeExports.jsxs("div",{className:ct.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:ct.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:_=>r(_),value:i,maxLength:150}),t.jsxRuntimeExports.jsx(gt,{typesText:a,setTypesText:c}),t.jsxRuntimeExports.jsx(t.Select,{label:"Type Text",options:Object.values(lt).filter(_=>_!==lt[d]),onChange:_=>b(Object.keys(lt).find(l=>lt[l]===_)),value:lt[d]})]})]})},ee="_title_pef24_1",se="_subtitle_pef24_5",ne="_header_pef24_12",ie="_text_pef24_13",oe="_productsBlock_pef24_14",ae="_top_pef24_26",re="_itemsBlock_pef24_35",ce="_typeTexts_pef24_41",le="_block_pef24_48",de="_active_pef24_61",ue="_products_pef24_14",xe="_product_pef24_14",me="_button_pef24_80",pe="_disabled_pef24_91",_e="_image_pef24_95",he="_info_pef24_102",je="_name_pef24_114",ge="_buttons_pef24_118",fe="_modal_pef24_125",be="_link_pef24_145",ve="_modalOptions_pef24_151",Ee="_addButton_pef24_164",Re="_deleteButton_pef24_179",ye="_closeIcon_pef24_191",H={title:ee,subtitle:se,header:ne,text:ie,productsBlock:oe,top:ae,itemsBlock:re,typeTexts:ce,block:le,active:de,products:ue,product:xe,button:me,disabled:pe,image:_e,info:he,name:je,buttons:ge,modal:fe,link:be,modalOptions:ve,addButton:Ee,deleteButton:Re,closeIcon:ye},Ie=h.forwardRef((u,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=u;function o(n,d){return n.length>d?`${n.slice(0,d)}...`: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:o(e.name["en-US"],20)}),t.jsxRuntimeExports.jsx("div",{className:H.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,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:d=>{const b={...e,[n.field]:d};s(b)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(ft,{typesText:e[n.field.type],setTypesText:d=>{const b={...e,[n.field.type]:d};s(b)},text:e[n.field.text]["en-US"]||"",setText:d=>{const b={...e,[n.field.text]:{"en-US":d}};s(b)},typeFont:e[n.field.typeFont],setTypeFont:d=>{const b={...e,[n.field.typeFont]:d};s(b)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:d=>{const b={...e,[n.field]:d};s(b)},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:d=>{const b={...e,[n.field.text]:d};s(b)},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:d=>{const b={...e,[n.field.switch]:d};s(b)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(vt,{items:e[n.field]||[],setItems:d=>{const b={...e,[n.field]:d};s(b)},itemsType:"select",draggable:n.draggable||!1,itemsOptions:n.itemsOptions,deletable:n.deletable||!1,editable:n.editable||!1,subtitle:n.label,addableOptions:n.addableOptions,modalOptions:n.modalOptions});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:d=>{const b={...e,[n.field]:d};s(b)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]}),switcher:n.switcher?{value:!!e[n.switcher],onChange:d=>{if(n.switcher==="isActive"){const b={...e,[n.switcher]:d};s(b)}}}:void 0})})})]})}),ke="_other_g74jx_1",Se="_subtitle_g74jx_7",$e="_items_g74jx_14",jt={other:ke,subtitle:Se,items:$e},pt=u=>{const{items:a,title:e="Other"}=u;return t.jsxRuntimeExports.jsxs("div",{className:jt.other,children:[t.jsxRuntimeExports.jsx("h5",{className:jt.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:jt.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 Ne({product:u,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:o}=t.useSortable({id:u.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${H.product} ${o?H.dragging:""}`,...e,...s,children:a})}const vt=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:d=!1,withImage:b=!1,deletable:_=!0,addable:l=!0,itemsType:v,itemsPlaceholder:p="",itemsOptions:x,hasRangeSelector:k=!1,rangeSelectorOptions:D,modalOptions:R,addableOptions:j={},limit:N,autoInterval:M}=u,[z,w]=h.useState(null),[f,B]=h.useState({top:0,left:0}),[g,y]=h.useState(null),S=h.useRef(null),[U,T]=h.useState(!1),q=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const m=()=>{w(null),T(!1)};return document.body.addEventListener("click",m),w(null),T(!1),()=>{w(null),T(!1),document.body.removeEventListener("click",m)}},[]),h.useEffect(()=>{if(z){const m=[...s].map(I=>I.id===z.id?z:I);i(m)}},[z]),h.useEffect(()=>{if(S.current&&g){const m=S.current.getBoundingClientRect().height,I=window.innerHeight;let P=g.top;P+m>I+window.scrollY-200&&(P=I+window.scrollY-m-200),P<0&&(P=10),B({top:P,left:g.left})}},[S.current,g]);const K=(m,I)=>{m.stopPropagation();const P=m.target.getBoundingClientRect();y({top:P.top+window.scrollY-70,left:P.left-(l?30:65)}),w(I),T(!0)};function it(m){if(b)return m?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${m[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const E=m=>{const{active:I,over:P}=m;if(P&&I.id!==P.id){const L=s.findIndex(A=>A.id===I.id),Y=s.findIndex(A=>A.id===P.id);if(L!==-1&&Y!==-1){const A=[...s],[ot]=A.splice(L,1);A.splice(Y,0,ot),i(A)}}},O=(m,I)=>{var L,Y;const P=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),v==="select"&&x&&t.jsxRuntimeExports.jsx(t.Select,{onChange:A=>{const ot=[...s],rt=x.find(xt=>xt.name["en-US"]===A);if(!rt)return;const at=ot.map(xt=>xt.id===m.id?{...rt,name:{"en-US":A}}:xt);w({...m,name:{"en-US":A}}),i([...at])},value:m.name["en-US"],options:x.filter(A=>!s.find(ot=>ot.name["en-US"]===A.name["en-US"])).map(A=>A.name["en-US"]),leftAddon:it(m.images)}),v==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:A=>{const rt=[...s].map(at=>at.id===m.id?{...m,name:{"en-US":A}}:at);i([...rt])},value:m.name["en-US"],placeholder:p}),v==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:A=>{const rt=[...s].map(at=>at.id===m.id?{...m,images:A}:at);i([...rt])},activeImage:(L=s.find(A=>A.id===m.id))!=null&&L.images?(Y=s.find(A=>A.id===m.id))==null?void 0:Y.images[0]:void 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:A=>{console.log(A,m),K(A,m)}})}),_&&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(A=>A.id!==m.id))})})]})]});return d?t.jsxRuntimeExports.jsx(Ne,{product:m,index:I,children:P},m.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:P},m.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:m=>e==null?void 0:e(m)})]}),z&&n&&R&&U&&t.jsxRuntimeExports.jsx(Ie,{ref:S,activeItem:z,setActiveItem:w,popupPosition:f,modalOptions:R,setIsOpenModal:T}),k&&D&&t.jsxRuntimeExports.jsx(_t,{...D}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:o}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:q,onDragEnd:E,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(m=>m.id),strategy:t.verticalListSortingStrategy,children:s.map((m,I)=>O(m,I))})}):s.map((m,I)=>O(m,I)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!(N&&N<=s.length||s.length===(x==null?void 0:x.length))}),size:"s",disabled:!!(N&&N<=s.length||s.length===(x==null?void 0:x.length)),onClick:()=>{const m=[...s];let I=null;if(x){for(let P=0;P<x.length;P++)if(!s.find(L=>L.id===x[P].id)){I=x[P];break}}v==="select"&&x?m.push({name:I?I.name:x[0].name,id:(I==null?void 0:I.id)||x[0].id,...j}):v==="input"?m.push({name:{"en-US":""},id:t.v4(),...j}):m.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...j}),i(m)},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(pt,{items:r}),M!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:M.title||"Auto scroll interval",type:"number",value:String(M.autoInterval),onChange:m=>M.setAutoInterval(Number(m)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},we="_title_82zux_1",Ce="_subtitle_82zux_5",Be="_header_82zux_12",Te="_text_82zux_13",Pe="_productsBlock_82zux_14",Ae="_top_82zux_26",Me="_itemsBlock_82zux_35",Oe="_typeTexts_82zux_41",qe="_block_82zux_48",De="_active_82zux_61",Ue="_products_82zux_14",Le="_product_82zux_14",He="_button_82zux_80",ze="_disabled_82zux_91",Fe="_image_82zux_95",Ve="_info_82zux_102",Ye="_name_82zux_114",Ge="_buttons_82zux_118",Xe="_modal_82zux_125",We="_link_82zux_145",Je="_modalOptions_82zux_151",Qe="_addButton_82zux_157",Ke="_deleteButton_82zux_179",Q={title:we,subtitle:Ce,header:Be,text:Te,productsBlock:Pe,top:Ae,itemsBlock:Me,typeTexts:Oe,block:qe,active:De,products:Ue,product:Le,button:He,disabled:ze,image:Fe,info:Ve,name:Ye,buttons:Ge,modal:Xe,link:We,modalOptions:Je,addButton:Qe,deleteButton:Ke},Ze=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,draggable:n=!1,withImage:d=!1,addable:b=!0,itemsOptions:_,hasRangeSelector:l=!1,rangeSelectorOptions:v,limit:p,autoScrollInterval:x,deletable:k}=u;function D(j){if(d)return j?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${j[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const R=(j,N=!1)=>{const M=_.find(w=>w.id===j);if(!M)return;const z=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:w=>{const f=[...s],B=_.find(S=>S.name===w);if(!B)return;const g=B.id,y=f.map(S=>S===j?g:S);i([...y])},value:M.name,options:_.filter(w=>!s.find(f=>f===w.id)).map(w=>w.name),leftAddon:D(M.images)}),N&&t.jsxRuntimeExports.jsx("div",{className:Q.buttons,children:t.jsxRuntimeExports.jsx("div",{className:Q.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(w=>w!==j))})})})]});return t.jsxRuntimeExports.jsx("div",{className:Q.product,children:z},j)};return t.jsxRuntimeExports.jsxs("div",{className:Q.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:Q.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:Q.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:j=>e==null?void 0:e(j)})]}),l&&v&&t.jsxRuntimeExports.jsx(_t,{...v}),t.jsxRuntimeExports.jsxs("div",{className:Q.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:Q.subtitle,children:o}),s.map(j=>R(j,k)),b&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(Q.button,{[Q.disabled]:!!(p&&p<=s.length||s.length===_.length)}),size:"s",disabled:!!(p&&p<=s.length||s.length===_.length),onClick:()=>{const j=[...s];let N=null;if(_){for(let M=0;M<_.length;M++)if(!s.find(z=>z===_[M].id)){N=_[M];break}}j.push((N==null?void 0:N.id)||_[0].id),i(j)},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})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(pt,{items:r}),x!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(x.scrollInterval),onChange:j=>x.setScrollInterval(Number(j)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},ts="_title_roi3a_1",es="_subtitle_roi3a_5",ss="_header_roi3a_12",ns="_text_roi3a_13",is="_productsBlock_roi3a_14",os="_top_roi3a_26",as="_itemsBlock_roi3a_35",rs="_typeTexts_roi3a_41",cs="_block_roi3a_48",ls="_active_roi3a_61",ds="_products_roi3a_14",us="_product_roi3a_14",xs="_button_roi3a_80",ms="_disabled_roi3a_91",ps="_image_roi3a_95",_s="_info_roi3a_102",hs="_name_roi3a_114",js="_buttons_roi3a_118",gs="_modal_roi3a_125",fs="_link_roi3a_145",bs="_modalOptions_roi3a_151",vs="_addButton_roi3a_164",Es="_deleteButton_roi3a_179",Rs="_closeIcon_roi3a_191",X={title:ts,subtitle:es,header:ss,text:ns,productsBlock:is,top:os,itemsBlock:as,typeTexts:rs,block:cs,active:ls,products:ds,product:us,button:xs,disabled:ms,image:ps,info:_s,name:hs,buttons:js,modal:gs,link:fs,modalOptions:bs,addButton:vs,deleteButton:Es,closeIcon:Rs};function ys({product:u,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:o}=t.useSortable({id:u.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${X.product} ${o?X.dragging:""}`,...e,...s,children:a})}const Is=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,title:r,subtitle:c,editable:o=!0,draggable:n=!1,deletable:d=!0,addable:b=!0,itemsType:_,itemsOptions:l,addableOptions:v={},limit:p}=u,[x,k]=h.useState(null),[D,R]=h.useState(null),j=h.useRef(null),N=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{if(x){const f=[...s].map(B=>B.id===x.id?x:B);i(f)}},[x]),h.useEffect(()=>{j.current&&D&&(j.current.getBoundingClientRect().height,D.top)},[j.current,D]);const M=(f,B)=>{f.stopPropagation();const g=f.target.getBoundingClientRect();R({top:g.top+window.scrollY,left:g.left-30}),k(B)},z=f=>{const{active:B,over:g}=f;if(g&&B.id!==g.id){const y=s.findIndex(U=>U.id===B.id),S=s.findIndex(U=>U.id===g.id);if(y!==-1&&S!==-1){const U=[...s],[T]=U.splice(y,1);U.splice(S,0,T),i(U)}}},w=(f,B)=>{const g=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})}),_==="select"&&l&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const S=[...s],U=l.find(q=>q.name===y);if(!U)return;const T=S.map(q=>q.id===f.id?{...U,name:{"en-US":y}}:q);k({...f,name:{"en-US":y}}),i([...T])},value:f.name,options:l.filter(y=>!s.find(S=>S.name===y.name)).map(y=>y.name)}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[o&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>M(y,f)})}),d&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(y=>y.id!==f.id))})})]})]});return n?t.jsxRuntimeExports.jsx(ys,{product:f,index:B,children:g},f.id):t.jsxRuntimeExports.jsx("div",{className:X.product,children:g},f.id)};return t.jsxRuntimeExports.jsxs("div",{className:X.productsBlock,children:[(r||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:X.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:X.title,children:r}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:f=>e==null?void 0:e(f)})]}),t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:c}),n?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:N,onDragEnd:z,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(f=>f.id),strategy:t.verticalListSortingStrategy,children:s.map((f,B)=>w(f,B))})}):s.map((f,B)=>w(f,B)),b&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(X.button,{[X.disabled]:!!(p&&p<=s.length||s.length===(l==null?void 0:l.length))}),size:"s",disabled:!!(p&&p<=s.length||s.length===(l==null?void 0:l.length)),onClick:()=>{const f=[...s];let B=null;if(l){for(let g=0;g<l.length;g++)if(!s.find(y=>y.id===l[g].id)){B=l[g];break}}_==="select"&&l&&f.push({name:B?B.name:l[0].name,id:(B==null?void 0:B.id)||l[0].id,...v}),i(f)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:X.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})},ks="_title_1vfw9_1",Ss="_subtitle_1vfw9_5",$s="_header_1vfw9_12",Ns="_text_1vfw9_13",ws="_productsBlock_1vfw9_14",Cs="_top_1vfw9_26",Bs="_itemsBlock_1vfw9_35",Ts="_typeTexts_1vfw9_41",Ps="_block_1vfw9_48",As="_active_1vfw9_61",Ms="_products_1vfw9_14",Os="_product_1vfw9_14",qs="_button_1vfw9_80",Ds="_disabled_1vfw9_91",Us="_image_1vfw9_95",Ls="_info_1vfw9_102",Hs="_name_1vfw9_114",zs="_buttons_1vfw9_118",Fs="_modal_1vfw9_125",Vs="_link_1vfw9_145",Ys="_modalOptions_1vfw9_151",Gs="_addButton_1vfw9_164",Xs="_deleteButton_1vfw9_179",Ws="_closeIcon_1vfw9_191",F={title:ks,subtitle:Ss,header:$s,text:Ns,productsBlock:ws,top:Cs,itemsBlock:Bs,typeTexts:Ts,block:Ps,active:As,products:Ms,product:Os,button:qs,disabled:Ds,image:Us,info:Ls,name:Hs,buttons:zs,modal:Fs,link:Vs,modalOptions:Ys,addButton:Gs,deleteButton:Xs,closeIcon:Ws},Js=h.forwardRef((u,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=u;return t.jsxRuntimeExports.jsxs("div",{ref:a,className:F.modal,onClick:o=>{o.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[t.jsxRuntimeExports.jsx("h3",{className:F.title,children:e.name["en-US"]}),t.jsxRuntimeExports.jsx("div",{className:F.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:F.modalOptions,children:r.map(o=>{if(o.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[o.field],onChange:n=>{const d={...e,[o.field]:n};s(d)}},String(o.field));if(o.type==="text")return t.jsxRuntimeExports.jsx(ft,{typesText:e[o.field.type],setTypesText:n=>{const d={...e,[o.field.type]:n};s(d)},text:e[o.field.text]["en-US"]||"",setText:n=>{const d={...e,[o.field.text]:{"en-US":n}};s(d)},typeFont:e[o.field.type],setTypeFont:n=>{const d={...e,[o.field.type]:n};s(d)},subtitle:o.label});if(o.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:n=>{const d={...e,[o.field]:n};s(d)},value:e[o.field]||"",label:o.label,placeholder:o.placeholder});if(o.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:F.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:n=>{const d={...e,[o.field.text]:n};s(d)},value:e[o.field.text]||"",label:o.inputLabel,placeholder:o.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[o.field.switch]||!1,label:o.switchLabel,onChange:n=>{const d={...e,[o.field.switch]:n};s(d)}})]});if(o.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:o.itemsOptions,onChange:n=>{const d={...e,[o.field]:n};s(d)},label:o.label,value:e[o.field]||"String",leftAddon:o.leftAddon&&o.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[o.field]})})})})]})});function Qs(u){const{product:a,children:e}=u,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:o,isDragging:n}=t.useSortable({id:a.id}),d={transform:t.CSS.Transform.toString(c),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:r,style:d,className:`${F.product} ${n?F.dragging:""}`,...s,...i,children:e})}const Ks=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:d=!1,withImage:b=!1,deletable:_=!0,addable:l=!0,itemsType:v,itemsPlaceholder:p="",itemsOptions:x,hasRangeSelector:k=!1,rangeSelectorOptions:D,modalOptions:R,addableOptions:j={}}=u,[N,M]=h.useState(null),[z,w]=h.useState({top:0,left:0}),[f,B]=h.useState(null),g=h.useRef(null),[y,S]=h.useState(!1),U=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const E=()=>{M(null),S(!1)};return document.body.addEventListener("click",E),M(null),S(!1),()=>{M(null),S(!1),document.body.removeEventListener("click",E)}},[]),h.useEffect(()=>{if(N){const E=[...s].map(O=>O.id===N.id?N:O);i(E)}},[N]),h.useEffect(()=>{if(g.current&&f){const E=g.current.getBoundingClientRect().height,O=window.innerHeight;let m=f.top;m+E>O+window.scrollY-200&&(m=O+window.scrollY-E-200),m<0&&(m=10),w({top:m,left:f.left})}},[g.current,f]);const T=(E,O)=>{E.stopPropagation();const m=E.target.getBoundingClientRect();B({top:m.top+window.scrollY,left:m.left-30}),M(O),S(!0)};function q(E){if(b)return E?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${E[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const K=E=>{const{active:O,over:m}=E;if(m&&O.id!==m.id){const I=s.findIndex(L=>L.id===O.id),P=s.findIndex(L=>L.id===m.id);if(I!==-1&&P!==-1){const L=[...s],[Y]=L.splice(I,1);L.splice(P,0,Y),i(L)}}},it=E=>{var m;const O=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),v==="select"&&x&&t.jsxRuntimeExports.jsx(t.Select,{onChange:I=>{const L=[...s].map(Y=>Y.id===E.id?{...E,name:{"en-US":I}}:Y);M({...E,name:{"en-US":I}}),i([...L])},value:E.name["en-US"],options:x.filter(I=>!s.find(P=>P.name["en-US"]===I)),leftAddon:q(E.images)}),v==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:I=>{const L=[...s].map(Y=>Y.id===E.id?{...E,name:{"en-US":I}}:Y);i([...L])},value:E.name["en-US"],placeholder:p}),v==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:I=>{const L=[...s].map(Y=>Y.id===E.id?{...E,images:I}:Y);i([...L])},activeImage:(m=s.find(I=>I.id===E.id))==null?void 0:m.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:F.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:I=>T(I,E)})}),_&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(I=>I.id!==E.id))})})]})]});return d?t.jsxRuntimeExports.jsx(Qs,{product:E,children:O},E.id):t.jsxRuntimeExports.jsx("div",{className:F.product,children:O},E.id)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:E=>e==null?void 0:e(E)})]}),N&&n&&R&&y&&t.jsxRuntimeExports.jsx(Js,{ref:g,activeItem:N,setActiveItem:M,popupPosition:z,modalOptions:R,setIsOpenModal:S}),k&&D&&t.jsxRuntimeExports.jsx(_t,{...D}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:o}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:U,onDragEnd:K,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(E=>E.id),strategy:t.verticalListSortingStrategy,children:s.map(E=>it(E))})}):s.map(E=>it(E)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:F.button,size:"s",onClick:()=>{const E=[...s];let O=null;if(x){for(let m=0;m<x.length;m++)if(!s.find(I=>I.name["en-US"]===x[m])){O=x[m];break}}v==="select"&&x?E.push({name:{"en-US":O||x[0]},id:t.v4(),...j,maxSymbols:100}):v==="input"?E.push({name:{"en-US":""},id:t.v4(),...j,maxSymbols:100}):E.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...j,maxSymbols:100}),i(E)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(pt,{items:r})]})},Zs="_title_bn7sv_1",tn="_subtitle_bn7sv_5",en="_header_bn7sv_12",sn="_text_bn7sv_13",nn="_productsBlock_bn7sv_14",on="_buttonsBlock_bn7sv_15",an="_top_bn7sv_26",rn="_itemsBlock_bn7sv_35",cn="_typeTexts_bn7sv_41",ln="_block_bn7sv_48",dn="_active_bn7sv_60",un="_products_bn7sv_14",xn="_product_bn7sv_14",mn="_button_bn7sv_15",pn="_image_bn7sv_90",_n="_info_bn7sv_97",hn="_name_bn7sv_109",jn="_buttons_bn7sv_15",gn="_modal_bn7sv_120",fn="_other_bn7sv_139",bn="_options_bn7sv_145",vn="_closeIcon_bn7sv_153",nt={title:Zs,subtitle:tn,header:en,text:sn,productsBlock:nn,buttonsBlock:on,top:an,itemsBlock:rn,typeTexts:cn,block:ln,active:dn,products:un,product:xn,button:mn,image:pn,info:_n,name:hn,buttons:jn,modal:gn,other:fn,options:bn,closeIcon:vn},En=h.forwardRef((u,a)=>{const{activeButton:e,setActiveButton:s,popupPosition:i}=u,[r,c]=h.useState(e.typesText),[o,n]=h.useState(e.destination),[d,b]=h.useState(e.page),[_,l]=h.useState(e.link||""),[v,p]=h.useState(e.text||{"en-US":""}),[x,k]=h.useState(e.openInNewTab),{pages:D}=t.usePagesStore();return h.useEffect(()=>{s({...e,...{text:v,link:_,destination:o,typesText:r,page:d,openInNewTab:x}})},[r,o,_,v,d,x]),console.log(v),t.jsxRuntimeExports.jsxs("div",{className:nt.modal,onClick:R=>{R.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},ref:a,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.top,children:[t.jsxRuntimeExports.jsx("h3",{className:nt.title,children:e.type}),t.jsxRuntimeExports.jsx("div",{className:nt.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})})]}),t.jsxRuntimeExports.jsxs("div",{className:nt.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:R=>n(R),options:["Go to Page","Open Link"].filter(R=>R!==o),value:o}),o==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:R=>b(R),options:D?Object.values(D).filter(R=>R.name!==d).map(R=>R.name):[],value:d}):t.jsxRuntimeExports.jsx(t.Input,{onChange:R=>l(R),value:_,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:R=>k(R)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>p({"en-US":R}),value:v["en-US"],label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(gt,{typesText:r,setTypesText:c})]})]})}),Rn="_subtitle_jql1y_1",yn="_header_jql1y_8",In="_text_jql1y_9",kn="_productsBlock_jql1y_10",Sn="_buttonsBlock_jql1y_11",$n="_top_jql1y_23",Nn="_itemsBlock_jql1y_32",wn="_typeTexts_jql1y_38",Cn="_block_jql1y_45",Bn="_active_jql1y_58",Tn="_products_jql1y_10",Pn="_product_jql1y_10",An="_button_jql1y_11",Mn="_image_jql1y_88",On="_info_jql1y_95",qn="_name_jql1y_107",Dn="_buttons_jql1y_11",Un="_modal_jql1y_118",Ln="_other_jql1y_138",Hn="_options_jql1y_144",zn="_addButton_jql1y_150",Fn="_deleteButton_jql1y_165",tt={subtitle:Rn,header:yn,text:In,productsBlock:kn,buttonsBlock:Sn,top:$n,itemsBlock:Nn,typeTexts:wn,block:Cn,active:Bn,products:Tn,product:Pn,button:An,image:Mn,info:On,name:qn,buttons:Dn,modal:Un,other:Ln,options:Hn,addButton:zn,deleteButton:Fn},Et=u=>{const{buttons:a,setButtons:e,deletable:s=!0,addable:i=!0,editable:r=!0}=u,[c,o]=h.useState(null),[n,d]=h.useState({top:0,left:0}),[b,_]=h.useState(null),l=h.useRef(null);h.useEffect(()=>{const p=()=>{o(null)};return document.body.addEventListener("click",p),o(null),()=>{o(null),document.body.removeEventListener("click",p)}},[]),h.useEffect(()=>{if(c){const p=[...a].map(x=>x.id===c.id?c:x);e(p)}},[c]),h.useEffect(()=>{if(l.current&&b){const p=l.current.getBoundingClientRect().height,x=window.innerHeight;let k=b.top;k+p>x+window.scrollY-200&&(k=x+window.scrollY-p-200),k<0&&(k=10),d({top:k,left:b.left})}},[l.current,b]);const v=(p,x)=>{p.stopPropagation();const k=p.target.getBoundingClientRect();_({top:k.top+window.scrollY-70,left:k.left-(i?30:65)}),o(x)};return t.jsxRuntimeExports.jsxs("div",{className:tt.products,children:[t.jsxRuntimeExports.jsx("h5",{className:tt.subtitle,children:"Button Type"}),a.map(p=>t.jsxRuntimeExports.jsxs("div",{className:tt.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:x=>{const D=[...a].map(R=>R.id===p.id?{...p,type:x}:R);e(D)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:tt.buttons,children:[r&&t.jsxRuntimeExports.jsx("div",{className:tt.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:x=>{v(x,p)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:tt.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const x=a.filter(k=>k.id!==p.id);e(x)},width:20,height:20,fill:"#C12A2A"})})]})]},p.id)),c&&t.jsxRuntimeExports.jsx(En,{ref:l,activeButton:c,setActiveButton:o,popupPosition:n}),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:tt.button,size:"s",onClick:()=>{const p=[...a];p.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:{"en-US":"Button Name"},page:"home",openInNewTab:!0}),e(p)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:tt.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Vn=u=>{const{isActiveButtons:a,setIsActiveButtons:e,buttons:s,setButtons:i,editable:r=!0}=u;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:nt.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.top,children:[t.jsxRuntimeExports.jsx("h3",{className:nt.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:c=>e(c)})]}),t.jsxRuntimeExports.jsx(Et,{buttons:s,setButtons:i,editable:r})]})})},Yn="_wrapper_m18qi_1",Gn="_subtitle_m18qi_7",Xn="_content_m18qi_14",Wn="_range_m18qi_22",Jn="_track_m18qi_27",Qn="_progress_m18qi_36",Kn="_dots_m18qi_46",Zn="_dot_m18qi_46",ti="_active_m18qi_65",ei="_input_m18qi_77",si="_countBlock_m18qi_91",ni="_count_m18qi_91",ii="_controls_m18qi_107",oi="_button_m18qi_113",G={wrapper:Yn,subtitle:Gn,content:Xn,range:Wn,track:Jn,progress:Qn,dots:Kn,dot:Zn,active:ti,input:ei,countBlock:si,count:ni,controls:ii,button:oi},_t=u=>{const{label:a,min:e=1,max:s=4,step:i=1,count:r,setCount:c}=u,[o,n]=h.useState(!1),d=Array.from({length:(s-e)/i+1}),b=(r-e)/(s-e)*100,_=()=>{r<s&&c(r+i)},l=()=>{r>e&&c(r-i)},v=p=>{const x=e+p*i;c(x)};return t.jsxRuntimeExports.jsxs("div",{className:G.wrapper,children:[a&&t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:a}),t.jsxRuntimeExports.jsxs("div",{className:G.content,children:[t.jsxRuntimeExports.jsxs("div",{className:G.range,children:[t.jsxRuntimeExports.jsx("div",{className:G.track}),t.jsxRuntimeExports.jsx("div",{className:G.progress,style:{width:`${b}%`}}),t.jsxRuntimeExports.jsx("div",{className:G.dots,children:d.map((p,x)=>{const k=x<=(r-e)/i;return t.jsxRuntimeExports.jsx("button",{onClick:()=>v(x),className:t.clx(G.dot,{[G.active]:k,[G.inactive]:!k,[G.dragging]:o}),"aria-label":`Set value to ${e+x*i}`},x)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:i,value:r,onChange:p=>c(Number(p.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:G.input})]}),t.jsxRuntimeExports.jsxs("div",{className:G.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:p=>{const x=Number(p);x>s?c(s):x<e?c(e):c(x)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:G.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:_,disabled:r>=s,className:G.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:l,disabled:r<=e,className:G.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},ai="_title_ix5ax_1",ri="_subtitle_ix5ax_5",ci="_header_ix5ax_12",li="_text_ix5ax_13",di="_productsBlock_ix5ax_14",ui="_top_ix5ax_26",xi="_itemsBlock_ix5ax_35",mi="_typeTexts_ix5ax_41",pi="_block_ix5ax_48",_i="_active_ix5ax_61",hi="_products_ix5ax_14",ji="_product_ix5ax_14",gi="_button_ix5ax_80",fi="_image_ix5ax_91",bi="_info_ix5ax_98",vi="_name_ix5ax_110",Ei="_buttons_ix5ax_114",Ri="_modal_ix5ax_121",yi="_link_ix5ax_141",Ii="_modalOptions_ix5ax_147",ki="_addButton_ix5ax_160",Si="_deleteButton_ix5ax_175",$i="_closeIcon_ix5ax_187",V={title:ai,subtitle:ri,header:ci,text:li,productsBlock:di,top:ui,itemsBlock:xi,typeTexts:mi,block:pi,active:_i,products:hi,product:ji,button:gi,image:fi,info:bi,name:vi,buttons:Ei,modal:Ri,link:yi,modalOptions:Ii,addButton:ki,deleteButton:Si,closeIcon:$i},Ni=u=>{const{activeItem:a,setActiveItem:e,popupPosition:s,setIsOpenModal:i,itemsOptions:r}=u,c=r.find(o=>o.id===a.listingId);return c?t.jsxRuntimeExports.jsxs("div",{className:V.modal,onClick:o=>{o.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{children:t.splitTextIntoSpans(c.productData.name)}),t.jsxRuntimeExports.jsx("div",{className:V.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,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:o=>{const n={...a,image:o[0]};e(n)}})})]}):null};function wi(u){const{product:a,children:e}=u,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:o,isDragging:n}=t.useSortable({id:String(a.listingId)}),d={transform:t.CSS.Transform.toString(c),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:r,style:d,className:`${V.product} ${n?V.dragging:""}`,...s,...i,children:e})}const Ci=u=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:d=!1,withImage:b=!1,deletable:_=!0,addable:l=!0,itemsType:v,itemsOptions:p}=u,[x,k]=h.useState(null),[D,R]=h.useState({top:0,left:0}),[j,N]=h.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const g=()=>{k(null),N(!1)};return document.body.addEventListener("click",g),k(null),N(!1),()=>{k(null),N(!1),document.body.removeEventListener("click",g)}},[]),h.useEffect(()=>{if(x){const g=[...s].map(y=>y.listingId===x.listingId?x:y);i(g)}},[x]);const z=(g,y)=>{g.stopPropagation();const S=g.target.getBoundingClientRect(),U=100,T=window.innerHeight;let q=S.top+window.scrollY;q+U>T&&(q=T-U-20),N(!0),R({top:q-80,left:S.left-30}),k(y)};function w(g){if(b)return g?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${g}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const f=g=>{const{active:y,over:S}=g;if(S&&y.id!==S.id){const U=s.findIndex(q=>String(q.listingId)===y.id),T=s.findIndex(q=>String(q.listingId)===S.id);if(U!==-1&&T!==-1){const q=[...s],[K]=q.splice(U,1);q.splice(T,0,K),i(q)}}},B=(g,y)=>{const S=p.find(T=>g.listingId===T.id);if(!S)return null;const U=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),v==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:T=>{const q=[...s],K=p.find(O=>O.productData.name===T);if(!K)return;const it={listingId:K.id,image:K.productData.images.length>0?K.productData.images[0].cfId:""},E=q.map(O=>O.listingId===g.listingId?it:O);k(it),i([...E])},value:S.productData.name,options:[...p.filter(T=>!s.find(q=>q.listingId===T.id)).map(T=>T.productData.name)],leftAddon:w(g.image||S.productData.images.length>0&&S.productData.images[0].cfId||"")},y),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:T=>z(T,g)})}),_&&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(T=>T!==g))})})]})]});return d?t.jsxRuntimeExports.jsx(wi,{product:g,children:U},g.listingId):t.jsxRuntimeExports.jsx("div",{className:V.product,children:U},g.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:g=>e==null?void 0:e(g)})]}),j&&x&&t.jsxRuntimeExports.jsx(Ni,{activeItem:x,setActiveItem:k,setIsOpenModal:N,popupPosition:D,itemsOptions:p}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:o}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:f,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>String(g.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((g,y)=>B(g,y))})}):s.map((g,y)=>B(g,y)),l&&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 g=[...s];for(let y=0;y<p.length;y++)if(!s.find(S=>S.listingId===p[y].id)){g.push({listingId:p[y].id,image:p[y].productData.images.length>0?p[y].productData.images[0].cfId:""});break}i(g)},disabled:s.length===p.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(pt,{items:r})]})},Bi="_options_6cemk_1",Ti="_price_6cemk_12",Pi="_oldPrice_6cemk_19",Ai="_newPrice_6cemk_27",Mi="_animate_6cemk_34",Oi="_appearAndBounce_6cemk_1",qi="_meta_6cemk_52",Di="_info_6cemk_58",Ui="_infoRight_6cemk_66",Li="_buttons_6cemk_73",Hi="_variants_6cemk_80",zi="_variant_6cemk_80",Fi="_stock_6cemk_98",Vi="_variantInfo_6cemk_105",Yi="_quantity_6cemk_111",Gi="_count_6cemk_118",Xi="_focused_6cemk_135",Wi="_button_6cemk_73",Ji="_activeVariant_6cemk_161",Qi="_chargeTypes_6cemk_165",Ki="_charge_6cemk_165",Zi="_chargeActive_6cemk_190",to="_title_6cemk_198",C={options:Bi,price:Ti,oldPrice:Pi,newPrice:Ai,animate:Mi,appearAndBounce:Oi,meta:qi,info:Di,infoRight:Ui,buttons:Li,variants:Hi,variant:zi,stock:Fi,variantInfo:Vi,quantity:Yi,count:Gi,focused:Xi,button:Wi,activeVariant:Ji,chargeTypes:Qi,charge:Ki,chargeActive:Zi,title:to},eo="_wrapper_c1dht_1",so="_label_c1dht_9",no="_input_c1dht_18",io="_paddingless_c1dht_31",oo="_content_c1dht_35",ao="_contentBorder_c1dht_47",ro="_borderless_c1dht_52",co="_rightIcon_c1dht_57",Z={wrapper:eo,label:so,input:no,paddingless:io,content:oo,contentBorder:ao,borderless:ro,rightIcon:co},Rt=u=>{const{onChange:a,style:e,label:s,value:i,type:r,min:c,max:o,placeholder:n,disabled:d=!1,required:b=!1,regex:_,paddingless:l=!1,borderless:v=!1,editable:p=!1,isSearch:x=!1,centered:k=!1}=u,{themeSettings:D}=t.useThemeSettingsStore(),{inputs:R}=D,[j,N]=h.useState(!1);function M(w){return Number(w)<0?String(c):w}function z(w){return!b||!_?!0:new RegExp(_).test(w)}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:t.clx(Z.content,{[Z.contentBorder]:R.border.active}),style:{...e,background:R.field.active?R.field.color:"transparent",padding:x?`7px ${Number(R.general.size)+20}px 7px 11px`:"7px 11px"},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:r||"text",onChange:w=>{if(r==="text")a(w.target.value);else{const f=M(w.target.value);a(f)}},value:i,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(Z.input,{[Z.required]:j&&b&&!z(i),[Z.paddingless]:l,[Z.borderless]:v}),min:r==="number"?c:void 0,max:r==="number"?o:void 0,disabled:d,onFocus:()=>N(!0),style:{textAlign:k?"center":"left"}}),x&&t.jsxRuntimeExports.jsx("div",{className:Z.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:R.general.size,height:R.general.size})}),p&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},lo="_button_85085_1",uo="_primary_85085_20",xo="_primaryHovered_85085_30",mo="_secondary_85085_34",po="_secondaryHovered_85085_44",_o="_tertiary_85085_48",ho="_tertiaryHovered_85085_58",jo="_content_85085_62",et={button:lo,primary:uo,primaryHovered:xo,secondary:mo,secondaryHovered:po,tertiary:_o,tertiaryHovered:ho,content:jo},W=u=>{const{children:a,onClick:e,style:s,className:i,disabled:r=!1,type:c="Primary"}=u,{themeSettings:o}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(et.button,i,{[et.primary]:c==="Primary",[et.secondary]:c==="Secondary",[et.tertiary]:c==="Tertiary",[et.primaryHovered]:c==="Primary"&&!r&&o.buttons.primary.hover,[et.secondaryHovered]:c==="Secondary"&&!r&&o.buttons.secondary.hover,[et.tertiaryHovered]:c==="Tertiary"&&!r&&o.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:r,children:c==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:et.content,children:[a,t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"var(--icon-tertiary)",width:20,height:20})]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a})})};var yt=(u=>(u.ONE_TIME="One-Time",u.RECURRING="Subscribe & Save",u))(yt||{});const go=u=>{var D,R;const{variants:a}=u,[e,s]=h.useState(a[0]),[i,r]=h.useState(e.chargeTypes[0]),c=t.useNavigate(),[o,n]=h.useState(1),{reset:d,addProductToCart:b,getProducts:_}=t.useCart(),[l,v]=h.useState(!1);h.useEffect(()=>{v(!0);const j=setTimeout(()=>v(!1),600);return()=>clearTimeout(j)},[o]);async function p(){await _(),await b({productId:u.id,productVariantId:e.id,quantity:o})}function x(){d(),p(),c("/checkout")}function k(j){if(j>=864e5){const f=Math.floor(j/864e5);return`${f} ${f===1?"day":"days"}`}else if(j>=36e5){const f=Math.floor(j/36e5);return`${f} ${f===1?"hour":"hours"}`}else if(j>=6e4){const f=Math.floor(j/6e4);return`${f} ${f===1?"minute":"minutes"}`}else{const f=Math.floor(j/1e3);return`${f} ${f===1?"second":"seconds"}`}}return h.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&n(0)},[e.quantity.available]),console.log(e.quantity),t.jsxRuntimeExports.jsxs("div",{className:C.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:C.chargeTypes,children:e.chargeTypes.map(j=>t.jsxRuntimeExports.jsx("div",{className:t.clx(C.charge,{[C.chargeActive]:i===j}),onClick:()=>r(j),children:yt[j]},j))}),t.jsxRuntimeExports.jsx("div",{className:C.variants,children:a.map(j=>{var N;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(C.variant,{[C.activeVariant]:e.id===j.id}),onClick:()=>s(j),children:[t.jsxRuntimeExports.jsxs("div",{className:C.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:C.title,children:j.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?j.price.amount:j.subscriptionSettings?j.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:C.stock,children:[((N=j.quantity.restrictions)==null?void 0:N.max)||j.quantity.available||0," in stock"]})})]},j.id)})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:C.quantity,children:[t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>{o>1?n(j=>j-1):n(1)},className:C.button,disabled:e.quantity.available===0||e.quantity.restrictions&&o<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(Rt,{type:"number",value:String(o),onChange:j=>n(Number(j)),max:((D=e.quantity.restrictions)==null?void 0:D.max)||e.quantity.available||1/0,min:((R=e.quantity.restrictions)==null?void 0:R.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>{n(j=>j+1)},className:C.button,disabled:!!(e.quantity.restrictions&&o>=e.quantity.restrictions.max||e.quantity.available!==void 0&&o>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:C.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:C.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:!e.deliveryTime||e.deliveryTime===0?"Instant":k(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:C.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",(e.price.amount||0)*o]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*o]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",(e.price.amount||0)*o]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:C.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:C.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(C.newPrice,{[C.animate]:l}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:C.buttons,children:[t.jsxRuntimeExports.jsx(W,{type:"Primary",onClick:()=>x(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>p(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},fo="_button_1tdo3_1",bo="_login_1tdo3_14",vo="_signUp_1tdo3_18",Eo="_buttons_1tdo3_23",Ro="_modal_1tdo3_32",yo="_closing_1tdo3_64",Io="_info_1tdo3_113",ko="_top_1tdo3_120",So="_title_1tdo3_131",$o="_clear_1tdo3_138",No="_activeClear_1tdo3_145",wo="_count_1tdo3_149",Co="_cart_1tdo3_164",Bo="_empty_1tdo3_172",To="_product_1tdo3_198",Po="_products_1tdo3_207",Ao="_image_1tdo3_215",Mo="_productInfo_1tdo3_221",Oo="_content_1tdo3_228",qo="_name_1tdo3_234",Do="_price_1tdo3_240",Uo="_productButtons_1tdo3_246",Lo="_productButton_1tdo3_246",Ho="_productCount_1tdo3_266",zo="_bottom_1tdo3_282",Fo="_subtotal_1tdo3_290",Vo="_block_1tdo3_298",Yo="_shoppingCount_1tdo3_305",Go="_total_1tdo3_325",Xo="_link_1tdo3_331",Wo="_userInfo_1tdo3_338",Jo="_pagesMobileModal_1tdo3_349",Qo="_pagesMobileModalContent_1tdo3_363",Ko="_pagesMobileModalHeader_1tdo3_369",Zo="_pagesMobileModalFooter_1tdo3_379",$={button:fo,login:bo,signUp:vo,buttons:Eo,modal:Ro,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:yo,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:Io,top:ko,title:So,clear:$o,activeClear:No,count:wo,cart:Co,empty:Bo,product:To,products:Po,image:Ao,productInfo:Mo,content:Oo,name:qo,price:Do,productButtons:Uo,productButton:Lo,productCount:Ho,bottom:zo,subtotal:Fo,block:Vo,shoppingCount:Yo,total:Go,link:Xo,userInfo:Wo,pagesMobileModal:Jo,pagesMobileModalContent:Qo,pagesMobileModalHeader:Ko,pagesMobileModalFooter:Zo};class ut extends Error{}ut.prototype.name="InvalidTokenError";function ta(u){return decodeURIComponent(atob(u).replace(/(.)/g,(a,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function ea(u){let a=u.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 ta(a)}catch{return atob(a)}}function sa(u,a){if(typeof u!="string")throw new ut("Invalid token specified: must be a string");a||(a={});const e=a.header===!0?0:1,s=u.split(".")[e];if(typeof s!="string")throw new ut(`Invalid token specified: missing part #${e+1}`);let i;try{i=ea(s)}catch(r){throw new ut(`Invalid token specified: invalid base64 for part #${e+1} (${r.message})`)}try{return JSON.parse(i)}catch(r){throw new ut(`Invalid token specified: invalid json for part #${e+1} (${r.message})`)}}const na=u=>{const{shopping:a,signUp:e,isShowUserInfo:s=!0}=u;return t.jsxRuntimeExports.jsxs("div",{className:$.buttons,children:[a&&t.jsxRuntimeExports.jsx(It,{}),s&&t.jsxRuntimeExports.jsx(bt,{signUp:e})]})},It=()=>{const[u,a]=h.useState(!1),[e,s]=h.useState([]),{cart:i,getProducts:r}=t.useCart();function c(l){for(let v=0;v<i.parts.length;v++)for(let p=0;p<l.variants.length;p++)if(i.parts[v].productVariantId===l.variants[v].id)return i.parts[v].productVariantId}function o(l){for(let v=0;v<i.parts.length;v++)for(let p=0;p<l.variants.length;p++)if(i.parts[v].productVariantId===l.variants[v].id)return i.parts[v].quantity}h.useEffect(()=>{(async()=>{const v=i.parts.map(k=>String(k.productId)),x=(await r([...v])).map(k=>({...k,activeVariantId:c(k),quantity:o(k)}));s(x)})()},[i.parts.length]);function n(l){var v;return!l||!(l!=null&&l.variants)?!1:(v=l.variants.find(p=>p.id===l.activeVariantId))==null?void 0:v.subscriptionSettings}const d=i.parts.length>0&&e.length>0&&!n(e[0]),[b,_]=h.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(W,{type:"Secondary",style:{padding:10},onClick:l=>{l.stopPropagation(),window.location.pathname!=="/admin/builder"&&(a(!0),_(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),d&&t.jsxRuntimeExports.jsx("div",{className:$.shoppingCount,children:i.parts.length})]}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{_(!1),setTimeout(()=>{a(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(kt,{activeProducts:e,isCartNotEmpty:d,isOpen:b})})]})},kt=u=>{const{activeProducts:a,isCartNotEmpty:e,isOpen:s}=u,{cart:i,reset:r,getTotalAndDiscount:c,updateQuantityOfProduct:o}=t.useCart(),n=t.useNavigate();function d(l){n(l)}function b(l){o({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity+1})}function _(l){o({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx($.modal,{[$.closing]:!s}),onClick:l=>l.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(l=>t.jsxRuntimeExports.jsxs("div",{className:$.product,children:[t.jsxRuntimeExports.jsxs("div",{className:$.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${l.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:l.name}),t.jsxRuntimeExports.jsxs("div",{className:$.price,children:["$",l.variants.find(v=>v.id===l.activeVariantId).price.amount*((l==null?void 0:l.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:$.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{l.quantity!==1&&_(l)},className:$.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:$.productCount,children:l.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>b(l),className:$.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},l.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(W,{onClick:()=>d("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(St,{})]})},St=()=>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"})]})]}),bt=({signUp:u})=>{const a=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=a,s=t.useNavigate();function i(o){s(o)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(W,{onClick:()=>i("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),u&&t.jsxRuntimeExports.jsx(W,{onClick:()=>i("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"})]});const[r,c]=h.useState("test-email@gmail.com");return h.useEffect(()=>{(async()=>{const n=sa(e);c(n.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:$.userInfo,onClick:()=>i("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:r||"test-email@gmail.com"})})},$t=({children:u,logo:a,setIsOpen:e,signUp:s})=>{const{setIsOpen:i}=t.useModalStore(),r=()=>{i(!1),setTimeout(()=>{e(!1),i(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:$.pagesMobileModal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:$.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:a}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:r,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:$.pagesMobileModalContent,children:u}),t.jsxRuntimeExports.jsx("div",{className:$.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(bt,{signUp:s})})]})},ia=({children:u,logo:a,signUp:e})=>{const[s,i]=h.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Nt,{setIsOpenModal:i}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx($t,{logo:a,setIsOpen:i,signUp:e,children:u})})]})},Nt=u=>{const{setIsOpenModal:a}=u;return t.jsxRuntimeExports.jsx(W,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),a(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},oa="_share_xddz7_1",aa="_modal_xddz7_8",ra="_header_xddz7_20",ca="_socials_xddz7_30",la="_social_xddz7_30",da="_copy_xddz7_40",ua="_title_xddz7_47",xa="_copyWrapper_xddz7_53",ma="_copyText_xddz7_62",pa="_copyTextMobile_xddz7_75",_a="_copyTextMiniMobile_xddz7_94",st={share:oa,modal:aa,header:ra,socials:ca,social:la,copy:da,title:ua,copyWrapper:xa,copyText:ma,copyTextMobile:pa,copyTextMiniMobile:_a},ha=()=>{const{isOpenModal:u,setIsOpenModal:a}=t.useShareLinkStore();function e(){a(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:st.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),u&&t.jsxRuntimeExports.jsx(t.Modal,{close:a,children:t.jsxRuntimeExports.jsx(ja,{})})]})},ja=()=>{const{setIsOpenModal:u}=t.useShareLinkStore(),{notification:a,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),i=window.location.href;function r(){navigator.clipboard.writeText(i),e({message:"Link copied to clipboard",status:"success"})}function c(){s(!1),setTimeout(()=>{u(!1),s(!0)},300)}function o(n,d){return n.length>d?n.slice(0,d)+"...":n}return t.jsxRuntimeExports.jsxs("div",{className:st.modal,onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:st.header,children:[t.jsxRuntimeExports.jsx("div",{className:st.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:c,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:st.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:r,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:st.copyText,children:o(i,100)}),t.jsxRuntimeExports.jsx("div",{className:st.copyTextMobile,children:o(i,40)}),t.jsxRuntimeExports.jsx("div",{className:st.copyTextMiniMobile,children:o(i,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:r,children:a?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},ga="_accordion_1s1lq_1",fa="_header_1s1lq_9",ba="_icon_1s1lq_18",va="_open_1s1lq_21",Ea="_content_1s1lq_25",dt={accordion:ga,header:fa,icon:ba,open:va,content:Ea},Ra=({title:u,content:a,defaultOpen:e=!1})=>{const[s,i]=h.useState(e),[r,c]=h.useState(0),o=h.useRef(null),n=()=>{i(!s)};return h.useEffect(()=>{o.current&&c(s?o.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:dt.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:dt.header,onClick:n,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:u}),t.jsxRuntimeExports.jsx("div",{className:t.clx(dt.icon,{[dt.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:o,className:dt.content,style:{height:`${r}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:a})})]})},ya=({children:u,path:a,className:e,target:s="_self",id:i})=>{const r=t.useNavigate(),c=/^https?:\/\//.test(a),o=n=>{c||s==="_blank"?s==="_blank"?window.open(a,"_blank"):window.location.href=a:(n.preventDefault(),r(a,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:o,className:e,role:"link",style:{cursor:"pointer"},id:i,children:u})},Ia="_buttonsBlock_1b2rb_1",ka="_slideUp_1b2rb_1",Sa={buttonsBlock:Ia,slideUp:ka},$a=()=>t.jsxRuntimeExports.jsxs("div",{className:Sa.buttonsBlock,children:[t.jsxRuntimeExports.jsx(W,{type:"Primary",style:{width:"100%"},onClick:()=>{console.log("add to cart")},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",children:"Buy"})]}),Na="_wrapper_st58d_1",wa="_label_st58d_10",Ca="_textarea_st58d_18",Ba="_length_st58d_33",mt={wrapper:Na,label:wa,textarea:Ca,length:Ba},Ta=u=>{const{onChange:a,label:e,value:s,maxLength:i,placeholder:r="Type something..."}=u,[c,o]=h.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:mt.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:mt.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{o(n.target.value.length),a(n.target.value)},placeholder:r,className:mt.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:mt.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=Ra;exports.BurgerMenuButton=Nt;exports.Button=W;exports.ButtonTypeSettings=Et;exports.ButtonsSettings=Vn;exports.CategorySettings=Ze;exports.EmptyCart=St;exports.FormSettings=Ks;exports.HeaderButtons=na;exports.InputUI=Rt;exports.ItemsSettings=vt;exports.LayoutSettings=Ft;exports.Link=ya;exports.ListingSelector=Ci;exports.PagesMobileMenu=ia;exports.PagesMobileModal=$t;exports.PagesSettings=Is;exports.ProductCardButtons=$a;exports.ProductOptions=go;exports.RangeSelector=_t;exports.ShareLink=ha;exports.ShoppingButton=It;exports.ShoppingModalCart=kt;exports.TextSettings=ft;exports.TextareaUI=Ta;exports.TypesText=gt;exports.UserInfo=bt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-B7M_zl3r.cjs"),h=require("react");require("@phosphor-icons/react");const wt="_wrapper_1ibay_2",Ct="_alignmentBlock_1ibay_8",Bt="_title_1ibay_15",Tt="_subtitle_1ibay_22",Pt="_alignmentContent_1ibay_29",At="_alignments_1ibay_37",Mt="_alignment_1ibay_8",Ot="_circle_1ibay_60",qt="_paddings_1ibay_67",Lt="_padding_1ibay_67",Dt="_active_1ibay_91",Ut="_input_1ibay_98",J={wrapper:wt,alignmentBlock:Ct,title:Bt,subtitle:Tt,alignmentContent:Pt,alignments:At,alignment:Mt,circle:Ot,paddings:qt,padding:Lt,active:Dt,input:Ut},Ht=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],zt=["left","top","right","bottom"],Ft=d=>{const{alignment:a,padding:e,setPadding:s,setAlignment:i}=d;function r(j){switch(j){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(j){switch(j){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[o,n]=h.useState(null),[x,f]=h.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:J.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:J.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:J.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:J.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:J.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:J.alignments,children:Ht.map(j=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{i(j)},className:J.alignment,onMouseEnter:()=>{n(j)},onMouseLeave:()=>{n(null)},children:[j!==a&&o!==j&&t.jsxRuntimeExports.jsx("div",{className:J.circle}),j!==a&&o===j&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(o),fill:"#c2c2c2",width:22,height:22}),j===a&&t.jsxRuntimeExports.jsx(t.Icon,{name:r(a),fill:"#FF3F19",width:22,height:22})]},j))}),t.jsxRuntimeExports.jsx("div",{className:J.paddings,children:zt.map(j=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(J.padding,{[J.active]:x===j}),onFocus:()=>{f(j)},onBlur:()=>{f(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:c(j),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[j]),onChange:l=>s({...e,[j]:Number(l)}),paddingless:!0,borderless:!0})]},j))})]})]})]})},Vt="_title_1jkiw_1",Yt="_subtitle_1jkiw_5",Gt="_header_1jkiw_12",Xt="_text_1jkiw_13",Wt="_top_1jkiw_20",Jt="_itemsBlock_1jkiw_29",ct={title:Vt,subtitle:Yt,header:Gt,text:Xt,top:Wt,itemsBlock:Jt},Qt="_typeTexts_167ez_1",Kt="_block_167ez_8",Zt="_active_167ez_25",ht={typeTexts:Qt,block:Kt,active:Zt},te=["bold","italic","underline","strike-through","code"],gt=d=>{const{typesText:a,setTypesText:e}=d;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:ht.typeTexts,children:te.map(i=>t.jsxRuntimeExports.jsx("div",{className:t.clx(ht.block,{[ht.active]:a.includes(i)}),onClick:()=>{const r=[...a];if(r.includes(i)){const c=r.filter(o=>o!==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)))})},lt={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",p:"Paragraph"},ft=d=>{const{typesText:a,isActiveText:e,setIsActiveText:s,text:i,setText:r,setTypesText:c,title:o,subtitle:n="Items",typeFont:x,setTypeFont:f}=d;return t.jsxRuntimeExports.jsxs("div",{className:ct.text,children:[(o||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:ct.top,children:[o&&t.jsxRuntimeExports.jsx("h3",{className:ct.title,children:o}),e!==void 0&&s&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:j=>s(j)})]}),t.jsxRuntimeExports.jsxs("div",{className:ct.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:ct.subtitle,children:n}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:j=>r(j),value:i,maxLength:150}),t.jsxRuntimeExports.jsx(gt,{typesText:a,setTypesText:c}),t.jsxRuntimeExports.jsx(t.Select,{label:"Type Text",options:Object.values(lt).filter(j=>j!==lt[x]),onChange:j=>f(Object.keys(lt).find(l=>lt[l]===j)),value:lt[x]})]})]})},ee="_title_pef24_1",se="_subtitle_pef24_5",ne="_header_pef24_12",ie="_text_pef24_13",oe="_productsBlock_pef24_14",ae="_top_pef24_26",re="_itemsBlock_pef24_35",ce="_typeTexts_pef24_41",le="_block_pef24_48",de="_active_pef24_61",ue="_products_pef24_14",xe="_product_pef24_14",me="_button_pef24_80",pe="_disabled_pef24_91",_e="_image_pef24_95",he="_info_pef24_102",je="_name_pef24_114",ge="_buttons_pef24_118",fe="_modal_pef24_125",be="_link_pef24_145",ve="_modalOptions_pef24_151",Ee="_addButton_pef24_164",Re="_deleteButton_pef24_179",ye="_closeIcon_pef24_191",H={title:ee,subtitle:se,header:ne,text:ie,productsBlock:oe,top:ae,itemsBlock:re,typeTexts:ce,block:le,active:de,products:ue,product:xe,button:me,disabled:pe,image:_e,info:he,name:je,buttons:ge,modal:fe,link:be,modalOptions:ve,addButton:Ee,deleteButton:Re,closeIcon:ye},Ie=h.forwardRef((d,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=d;function o(n,x){return n.length>x?`${n.slice(0,x)}...`: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:o(e.name["en-US"],20)}),t.jsxRuntimeExports.jsx("div",{className:H.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,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:x=>{const f={...e,[n.field]:x};s(f)}},String(n.field));if(n.type==="text")return t.jsxRuntimeExports.jsx(ft,{typesText:e[n.field.type],setTypesText:x=>{const f={...e,[n.field.type]:x};s(f)},text:e[n.field.text]["en-US"]||"",setText:x=>{const f={...e,[n.field.text]:{"en-US":x}};s(f)},typeFont:e[n.field.typeFont],setTypeFont:x=>{const f={...e,[n.field.typeFont]:x};s(f)},subtitle:n.label});if(n.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:x=>{const f={...e,[n.field]:x};s(f)},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:x=>{const f={...e,[n.field.text]:x};s(f)},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:x=>{const f={...e,[n.field.switch]:x};s(f)}})]});if(n.type==="list")return t.jsxRuntimeExports.jsx(vt,{items:e[n.field]||[],setItems:x=>{const f={...e,[n.field]:x};s(f)},itemsType:"select",draggable:n.draggable||!1,itemsOptions:n.itemsOptions,deletable:n.deletable||!1,editable:n.editable||!1,subtitle:n.label,addableOptions:n.addableOptions,modalOptions:n.modalOptions});if(n.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:n.itemsOptions,onChange:x=>{const f={...e,[n.field]:x};s(f)},label:n.label,value:e[n.field]||"String",leftAddon:n.leftAddon&&n.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[n.field]}),switcher:n.switcher?{value:!!e[n.switcher],onChange:x=>{if(n.switcher==="isActive"){const f={...e,[n.switcher]:x};s(f)}}}:void 0})})})]})}),ke="_other_g74jx_1",Se="_subtitle_g74jx_7",$e="_items_g74jx_14",jt={other:ke,subtitle:Se,items:$e},pt=d=>{const{items:a,title:e="Other"}=d;return t.jsxRuntimeExports.jsxs("div",{className:jt.other,children:[t.jsxRuntimeExports.jsx("h5",{className:jt.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:jt.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 Ne({product:d,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:o}=t.useSortable({id:d.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${H.product} ${o?H.dragging:""}`,...e,...s,children:a})}const vt=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:x=!1,withImage:f=!1,deletable:j=!0,addable:l=!0,itemsType:E,itemsPlaceholder:p="",itemsOptions:m,hasRangeSelector:R=!1,rangeSelectorOptions:D,modalOptions:A,addableOptions:u={},limit:$,autoInterval:M}=d,[z,N]=h.useState(null),[b,C]=h.useState({top:0,left:0}),[g,y]=h.useState(null),k=h.useRef(null),[L,B]=h.useState(!1),q=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const _=()=>{N(null),B(!1)};return document.body.addEventListener("click",_),N(null),B(!1),()=>{N(null),B(!1),document.body.removeEventListener("click",_)}},[]),h.useEffect(()=>{if(z){const _=[...s].map(I=>I.id===z.id?z:I);i(_)}},[z]),h.useEffect(()=>{if(k.current&&g){const _=k.current.getBoundingClientRect().height,I=window.innerHeight;let T=g.top;T+_>I+window.scrollY-200&&(T=I+window.scrollY-_-200),T<0&&(T=10),C({top:T,left:g.left})}},[k.current,g]);const K=(_,I)=>{_.stopPropagation();const T=_.target.getBoundingClientRect();y({top:T.top+window.scrollY-70,left:T.left-(l?30:65)}),N(I),B(!0)};function it(_){if(f)return _?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${_[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const v=_=>{const{active:I,over:T}=_;if(T&&I.id!==T.id){const U=s.findIndex(P=>P.id===I.id),Y=s.findIndex(P=>P.id===T.id);if(U!==-1&&Y!==-1){const P=[...s],[ot]=P.splice(U,1);P.splice(Y,0,ot),i(P)}}},O=(_,I)=>{var U,Y;const T=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),E==="select"&&m&&t.jsxRuntimeExports.jsx(t.Select,{onChange:P=>{const ot=[...s],rt=m.find(xt=>xt.name["en-US"]===P);if(!rt)return;const at=ot.map(xt=>xt.id===_.id?{...rt,name:{"en-US":P}}:xt);N({..._,name:{"en-US":P}}),i([...at])},value:_.name["en-US"],options:m.filter(P=>!s.find(ot=>ot.name["en-US"]===P.name["en-US"])).map(P=>P.name["en-US"]),leftAddon:it(_.images)}),E==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:P=>{const rt=[...s].map(at=>at.id===_.id?{..._,name:{"en-US":P}}:at);i([...rt])},value:_.name["en-US"],placeholder:p}),E==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:P=>{const rt=[...s].map(at=>at.id===_.id?{..._,images:P}:at);i([...rt])},activeImage:(U=s.find(P=>P.id===_.id))!=null&&U.images?(Y=s.find(P=>P.id===_.id))==null?void 0:Y.images[0]:void 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:P=>{console.log(P,_),K(P,_)}})}),j&&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(P=>P.id!==_.id))})})]})]});return x?t.jsxRuntimeExports.jsx(Ne,{product:_,index:I,children:T},_.id):t.jsxRuntimeExports.jsx("div",{className:H.product,children:T},_.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:_=>e==null?void 0:e(_)})]}),z&&n&&A&&L&&t.jsxRuntimeExports.jsx(Ie,{ref:k,activeItem:z,setActiveItem:N,popupPosition:b,modalOptions:A,setIsOpenModal:B}),R&&D&&t.jsxRuntimeExports.jsx(_t,{...D}),t.jsxRuntimeExports.jsxs("div",{className:H.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:o}),x?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:q,onDragEnd:v,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(_=>_.id),strategy:t.verticalListSortingStrategy,children:s.map((_,I)=>O(_,I))})}):s.map((_,I)=>O(_,I)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(H.button,{[H.disabled]:!!($&&$<=s.length||s.length===(m==null?void 0:m.length))}),size:"s",disabled:!!($&&$<=s.length||s.length===(m==null?void 0:m.length)),onClick:()=>{const _=[...s];let I=null;if(m){for(let T=0;T<m.length;T++)if(!s.find(U=>U.id===m[T].id)){I=m[T];break}}E==="select"&&m?_.push({name:I?I.name:m[0].name,id:(I==null?void 0:I.id)||m[0].id,...u}):E==="input"?_.push({name:{"en-US":""},id:t.v4(),...u}):_.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...u}),i(_)},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(pt,{items:r}),M!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:M.title||"Auto scroll interval",type:"number",value:String(M.autoInterval),onChange:_=>M.setAutoInterval(Number(_)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},we="_title_82zux_1",Ce="_subtitle_82zux_5",Be="_header_82zux_12",Te="_text_82zux_13",Pe="_productsBlock_82zux_14",Ae="_top_82zux_26",Me="_itemsBlock_82zux_35",Oe="_typeTexts_82zux_41",qe="_block_82zux_48",Le="_active_82zux_61",De="_products_82zux_14",Ue="_product_82zux_14",He="_button_82zux_80",ze="_disabled_82zux_91",Fe="_image_82zux_95",Ve="_info_82zux_102",Ye="_name_82zux_114",Ge="_buttons_82zux_118",Xe="_modal_82zux_125",We="_link_82zux_145",Je="_modalOptions_82zux_151",Qe="_addButton_82zux_157",Ke="_deleteButton_82zux_179",Q={title:we,subtitle:Ce,header:Be,text:Te,productsBlock:Pe,top:Ae,itemsBlock:Me,typeTexts:Oe,block:qe,active:Le,products:De,product:Ue,button:He,disabled:ze,image:Fe,info:Ve,name:Ye,buttons:Ge,modal:Xe,link:We,modalOptions:Je,addButton:Qe,deleteButton:Ke},Ze=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,draggable:n=!1,withImage:x=!1,addable:f=!0,itemsOptions:j,hasRangeSelector:l=!1,rangeSelectorOptions:E,limit:p,autoScrollInterval:m,deletable:R}=d;function D(u){if(x)return u?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${u[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const A=(u,$=!1)=>{const M=j.find(N=>N.id===u);if(!M)return;const z=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:N=>{const b=[...s],C=j.find(k=>k.name===N);if(!C)return;const g=C.id,y=b.map(k=>k===u?g:k);i([...y])},value:M.name,options:j.filter(N=>!s.find(b=>b===N.id)).map(N=>N.name),leftAddon:D(M.images)}),$&&t.jsxRuntimeExports.jsx("div",{className:Q.buttons,children:t.jsxRuntimeExports.jsx("div",{className:Q.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(N=>N!==u))})})})]});return t.jsxRuntimeExports.jsx("div",{className:Q.product,children:z},u)};return t.jsxRuntimeExports.jsxs("div",{className:Q.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:Q.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:Q.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:u=>e==null?void 0:e(u)})]}),l&&E&&t.jsxRuntimeExports.jsx(_t,{...E}),t.jsxRuntimeExports.jsxs("div",{className:Q.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:Q.subtitle,children:o}),s.map(u=>A(u,R)),f&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(Q.button,{[Q.disabled]:!!(p&&p<=s.length||s.length===j.length)}),size:"s",disabled:!!(p&&p<=s.length||s.length===j.length),onClick:()=>{const u=[...s];let $=null;if(j){for(let M=0;M<j.length;M++)if(!s.find(z=>z===j[M].id)){$=j[M];break}}u.push(($==null?void 0:$.id)||j[0].id),i(u)},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})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(pt,{items:r}),m!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(m.scrollInterval),onChange:u=>m.setScrollInterval(Number(u)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},ts="_title_roi3a_1",es="_subtitle_roi3a_5",ss="_header_roi3a_12",ns="_text_roi3a_13",is="_productsBlock_roi3a_14",os="_top_roi3a_26",as="_itemsBlock_roi3a_35",rs="_typeTexts_roi3a_41",cs="_block_roi3a_48",ls="_active_roi3a_61",ds="_products_roi3a_14",us="_product_roi3a_14",xs="_button_roi3a_80",ms="_disabled_roi3a_91",ps="_image_roi3a_95",_s="_info_roi3a_102",hs="_name_roi3a_114",js="_buttons_roi3a_118",gs="_modal_roi3a_125",fs="_link_roi3a_145",bs="_modalOptions_roi3a_151",vs="_addButton_roi3a_164",Es="_deleteButton_roi3a_179",Rs="_closeIcon_roi3a_191",X={title:ts,subtitle:es,header:ss,text:ns,productsBlock:is,top:os,itemsBlock:as,typeTexts:rs,block:cs,active:ls,products:ds,product:us,button:xs,disabled:ms,image:ps,info:_s,name:hs,buttons:js,modal:gs,link:fs,modalOptions:bs,addButton:vs,deleteButton:Es,closeIcon:Rs};function ys({product:d,children:a}){const{attributes:e,listeners:s,setNodeRef:i,transform:r,transition:c,isDragging:o}=t.useSortable({id:d.id}),n={transform:t.CSS.Transform.toString(r),transition:c};return t.jsxRuntimeExports.jsx("div",{ref:i,style:n,className:`${X.product} ${o?X.dragging:""}`,...e,...s,children:a})}const Is=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,title:r,subtitle:c,editable:o=!0,draggable:n=!1,deletable:x=!0,addable:f=!0,itemsType:j,itemsOptions:l,addableOptions:E={},limit:p}=d,[m,R]=h.useState(null),[D,A]=h.useState(null),u=h.useRef(null),$=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{if(m){const b=[...s].map(C=>C.id===m.id?m:C);i(b)}},[m]),h.useEffect(()=>{u.current&&D&&(u.current.getBoundingClientRect().height,D.top)},[u.current,D]);const M=(b,C)=>{b.stopPropagation();const g=b.target.getBoundingClientRect();A({top:g.top+window.scrollY,left:g.left-30}),R(C)},z=b=>{const{active:C,over:g}=b;if(g&&C.id!==g.id){const y=s.findIndex(L=>L.id===C.id),k=s.findIndex(L=>L.id===g.id);if(y!==-1&&k!==-1){const L=[...s],[B]=L.splice(y,1);L.splice(k,0,B),i(L)}}},N=(b,C)=>{const g=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})}),j==="select"&&l&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const k=[...s],L=l.find(q=>q.name===y);if(!L)return;const B=k.map(q=>q.id===b.id?{...L,name:{"en-US":y}}:q);R({...b,name:{"en-US":y}}),i([...B])},value:b.name,options:l.filter(y=>!s.find(k=>k.name===y.name)).map(y=>y.name)}),t.jsxRuntimeExports.jsxs("div",{className:X.buttons,children:[o&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>M(y,b)})}),x&&t.jsxRuntimeExports.jsx("div",{className:X.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(y=>y.id!==b.id))})})]})]});return n?t.jsxRuntimeExports.jsx(ys,{product:b,index:C,children:g},b.id):t.jsxRuntimeExports.jsx("div",{className:X.product,children:g},b.id)};return t.jsxRuntimeExports.jsxs("div",{className:X.productsBlock,children:[(r||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:X.top,children:[r&&t.jsxRuntimeExports.jsx("h3",{className:X.title,children:r}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:b=>e==null?void 0:e(b)})]}),t.jsxRuntimeExports.jsxs("div",{className:X.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:X.subtitle,children:c}),n?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:$,onDragEnd:z,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(b=>b.id),strategy:t.verticalListSortingStrategy,children:s.map((b,C)=>N(b,C))})}):s.map((b,C)=>N(b,C)),f&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(X.button,{[X.disabled]:!!(p&&p<=s.length||s.length===(l==null?void 0:l.length))}),size:"s",disabled:!!(p&&p<=s.length||s.length===(l==null?void 0:l.length)),onClick:()=>{const b=[...s];let C=null;if(l){for(let g=0;g<l.length;g++)if(!s.find(y=>y.id===l[g].id)){C=l[g];break}}j==="select"&&l&&b.push({name:C?C.name:l[0].name,id:(C==null?void 0:C.id)||l[0].id,...E}),i(b)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:X.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})},ks="_title_1vfw9_1",Ss="_subtitle_1vfw9_5",$s="_header_1vfw9_12",Ns="_text_1vfw9_13",ws="_productsBlock_1vfw9_14",Cs="_top_1vfw9_26",Bs="_itemsBlock_1vfw9_35",Ts="_typeTexts_1vfw9_41",Ps="_block_1vfw9_48",As="_active_1vfw9_61",Ms="_products_1vfw9_14",Os="_product_1vfw9_14",qs="_button_1vfw9_80",Ls="_disabled_1vfw9_91",Ds="_image_1vfw9_95",Us="_info_1vfw9_102",Hs="_name_1vfw9_114",zs="_buttons_1vfw9_118",Fs="_modal_1vfw9_125",Vs="_link_1vfw9_145",Ys="_modalOptions_1vfw9_151",Gs="_addButton_1vfw9_164",Xs="_deleteButton_1vfw9_179",Ws="_closeIcon_1vfw9_191",F={title:ks,subtitle:Ss,header:$s,text:Ns,productsBlock:ws,top:Cs,itemsBlock:Bs,typeTexts:Ts,block:Ps,active:As,products:Ms,product:Os,button:qs,disabled:Ls,image:Ds,info:Us,name:Hs,buttons:zs,modal:Fs,link:Vs,modalOptions:Ys,addButton:Gs,deleteButton:Xs,closeIcon:Ws},Js=h.forwardRef((d,a)=>{const{activeItem:e,setActiveItem:s,popupPosition:i,modalOptions:r,setIsOpenModal:c}=d;return t.jsxRuntimeExports.jsxs("div",{ref:a,className:F.modal,onClick:o=>{o.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[t.jsxRuntimeExports.jsx("h3",{className:F.title,children:e.name["en-US"]}),t.jsxRuntimeExports.jsx("div",{className:F.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{s(null),c(!1)}})})]}),t.jsxRuntimeExports.jsx("div",{className:F.modalOptions,children:r.map(o=>{if(o.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",activeImage:e[o.field],onChange:n=>{const x={...e,[o.field]:n};s(x)}},String(o.field));if(o.type==="text")return t.jsxRuntimeExports.jsx(ft,{typesText:e[o.field.type],setTypesText:n=>{const x={...e,[o.field.type]:n};s(x)},text:e[o.field.text]["en-US"]||"",setText:n=>{const x={...e,[o.field.text]:{"en-US":n}};s(x)},typeFont:e[o.field.type],setTypeFont:n=>{const x={...e,[o.field.type]:n};s(x)},subtitle:o.label});if(o.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:n=>{const x={...e,[o.field]:n};s(x)},value:e[o.field]||"",label:o.label,placeholder:o.placeholder});if(o.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:F.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:n=>{const x={...e,[o.field.text]:n};s(x)},value:e[o.field.text]||"",label:o.inputLabel,placeholder:o.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!e[o.field.switch]||!1,label:o.switchLabel,onChange:n=>{const x={...e,[o.field.switch]:n};s(x)}})]});if(o.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:o.itemsOptions,onChange:n=>{const x={...e,[o.field]:n};s(x)},label:o.label,value:e[o.field]||"String",leftAddon:o.leftAddon&&o.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:e[o.field]})})})})]})});function Qs(d){const{product:a,children:e}=d,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:o,isDragging:n}=t.useSortable({id:a.id}),x={transform:t.CSS.Transform.toString(c),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:r,style:x,className:`${F.product} ${n?F.dragging:""}`,...s,...i,children:e})}const Ks=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:x=!1,withImage:f=!1,deletable:j=!0,addable:l=!0,itemsType:E,itemsPlaceholder:p="",itemsOptions:m,hasRangeSelector:R=!1,rangeSelectorOptions:D,modalOptions:A,addableOptions:u={}}=d,[$,M]=h.useState(null),[z,N]=h.useState({top:0,left:0}),[b,C]=h.useState(null),g=h.useRef(null),[y,k]=h.useState(!1),L=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const v=()=>{M(null),k(!1)};return document.body.addEventListener("click",v),M(null),k(!1),()=>{M(null),k(!1),document.body.removeEventListener("click",v)}},[]),h.useEffect(()=>{if($){const v=[...s].map(O=>O.id===$.id?$:O);i(v)}},[$]),h.useEffect(()=>{if(g.current&&b){const v=g.current.getBoundingClientRect().height,O=window.innerHeight;let _=b.top;_+v>O+window.scrollY-200&&(_=O+window.scrollY-v-200),_<0&&(_=10),N({top:_,left:b.left})}},[g.current,b]);const B=(v,O)=>{v.stopPropagation();const _=v.target.getBoundingClientRect();C({top:_.top+window.scrollY,left:_.left-30}),M(O),k(!0)};function q(v){if(f)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 K=v=>{const{active:O,over:_}=v;if(_&&O.id!==_.id){const I=s.findIndex(U=>U.id===O.id),T=s.findIndex(U=>U.id===_.id);if(I!==-1&&T!==-1){const U=[...s],[Y]=U.splice(I,1);U.splice(T,0,Y),i(U)}}},it=v=>{var _;const O=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),E==="select"&&m&&t.jsxRuntimeExports.jsx(t.Select,{onChange:I=>{const U=[...s].map(Y=>Y.id===v.id?{...v,name:{"en-US":I}}:Y);M({...v,name:{"en-US":I}}),i([...U])},value:v.name["en-US"],options:m.filter(I=>!s.find(T=>T.name["en-US"]===I)),leftAddon:q(v.images)}),E==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:I=>{const U=[...s].map(Y=>Y.id===v.id?{...v,name:{"en-US":I}}:Y);i([...U])},value:v.name["en-US"],placeholder:p}),E==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:I=>{const U=[...s].map(Y=>Y.id===v.id?{...v,images:I}:Y);i([...U])},activeImage:(_=s.find(I=>I.id===v.id))==null?void 0:_.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:F.buttons,children:[n&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:I=>B(I,v)})}),j&&t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>i(s.filter(I=>I.id!==v.id))})})]})]});return x?t.jsxRuntimeExports.jsx(Qs,{product:v,children:O},v.id):t.jsxRuntimeExports.jsx("div",{className:F.product,children:O},v.id)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(c||a!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:c}),a!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:v=>e==null?void 0:e(v)})]}),$&&n&&A&&y&&t.jsxRuntimeExports.jsx(Js,{ref:g,activeItem:$,setActiveItem:M,popupPosition:z,modalOptions:A,setIsOpenModal:k}),R&&D&&t.jsxRuntimeExports.jsx(_t,{...D}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:o}),x?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:L,onDragEnd:K,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(v=>v.id),strategy:t.verticalListSortingStrategy,children:s.map(v=>it(v))})}):s.map(v=>it(v)),l&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:F.button,size:"s",onClick:()=>{const v=[...s];let O=null;if(m){for(let _=0;_<m.length;_++)if(!s.find(I=>I.name["en-US"]===m[_])){O=m[_];break}}E==="select"&&m?v.push({name:{"en-US":O||m[0]},id:t.v4(),...u,maxSymbols:100}):E==="input"?v.push({name:{"en-US":""},id:t.v4(),...u,maxSymbols:100}):v.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...u,maxSymbols:100}),i(v)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),r!==void 0&&t.jsxRuntimeExports.jsx(pt,{items:r})]})},Zs="_title_bn7sv_1",tn="_subtitle_bn7sv_5",en="_header_bn7sv_12",sn="_text_bn7sv_13",nn="_productsBlock_bn7sv_14",on="_buttonsBlock_bn7sv_15",an="_top_bn7sv_26",rn="_itemsBlock_bn7sv_35",cn="_typeTexts_bn7sv_41",ln="_block_bn7sv_48",dn="_active_bn7sv_60",un="_products_bn7sv_14",xn="_product_bn7sv_14",mn="_button_bn7sv_15",pn="_image_bn7sv_90",_n="_info_bn7sv_97",hn="_name_bn7sv_109",jn="_buttons_bn7sv_15",gn="_modal_bn7sv_120",fn="_other_bn7sv_139",bn="_options_bn7sv_145",vn="_closeIcon_bn7sv_153",nt={title:Zs,subtitle:tn,header:en,text:sn,productsBlock:nn,buttonsBlock:on,top:an,itemsBlock:rn,typeTexts:cn,block:ln,active:dn,products:un,product:xn,button:mn,image:pn,info:_n,name:hn,buttons:jn,modal:gn,other:fn,options:bn,closeIcon:vn},En=h.forwardRef((d,a)=>{const{activeButton:e,setActiveButton:s,popupPosition:i,editableLink:r=!0}=d,[c,o]=h.useState(e.typesText),[n,x]=h.useState(e.destination),[f,j]=h.useState(e.page),[l,E]=h.useState(e.link||""),[p,m]=h.useState(e.text||{"en-US":""}),[R,D]=h.useState(e.openInNewTab),{pages:A}=t.usePagesStore();return h.useEffect(()=>{s({...e,...{text:p,link:l,destination:n,typesText:c,page:f,openInNewTab:R}})},[c,n,l,p,f,R]),console.log(p),t.jsxRuntimeExports.jsxs("div",{className:nt.modal,onClick:u=>{u.stopPropagation()},style:{top:`${i.top}px`,left:`${i.left}px`},ref:a,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.top,children:[t.jsxRuntimeExports.jsx("h3",{className:nt.title,children:e.type}),t.jsxRuntimeExports.jsx("div",{className:nt.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>s(null)})})]}),t.jsxRuntimeExports.jsxs("div",{className:nt.options,children:[r&&t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:u=>x(u),options:["Go to Page","Open Link"].filter(u=>u!==n),value:n}),r&&(n==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:u=>j(u),options:A?Object.values(A).filter(u=>u.name!==f).map(u=>u.name):[],value:f}):t.jsxRuntimeExports.jsx(t.Input,{onChange:u=>E(u),value:l,placeholder:"https://",label:"Link"})),r&&t.jsxRuntimeExports.jsx(t.Switch,{current:e.openInNewTab,label:"Open in new tab",onChange:u=>D(u)}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:u=>m({"en-US":u}),value:p["en-US"],label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(gt,{typesText:c,setTypesText:o})]})]})}),Rn="_subtitle_jql1y_1",yn="_header_jql1y_8",In="_text_jql1y_9",kn="_productsBlock_jql1y_10",Sn="_buttonsBlock_jql1y_11",$n="_top_jql1y_23",Nn="_itemsBlock_jql1y_32",wn="_typeTexts_jql1y_38",Cn="_block_jql1y_45",Bn="_active_jql1y_58",Tn="_products_jql1y_10",Pn="_product_jql1y_10",An="_button_jql1y_11",Mn="_image_jql1y_88",On="_info_jql1y_95",qn="_name_jql1y_107",Ln="_buttons_jql1y_11",Dn="_modal_jql1y_118",Un="_other_jql1y_138",Hn="_options_jql1y_144",zn="_addButton_jql1y_150",Fn="_deleteButton_jql1y_165",tt={subtitle:Rn,header:yn,text:In,productsBlock:kn,buttonsBlock:Sn,top:$n,itemsBlock:Nn,typeTexts:wn,block:Cn,active:Bn,products:Tn,product:Pn,button:An,image:Mn,info:On,name:qn,buttons:Ln,modal:Dn,other:Un,options:Hn,addButton:zn,deleteButton:Fn},Et=d=>{const{buttons:a,setButtons:e,deletable:s=!0,addable:i=!0,editableLink:r=!0}=d,[c,o]=h.useState(null),[n,x]=h.useState({top:0,left:0}),[f,j]=h.useState(null),l=h.useRef(null);h.useEffect(()=>{const p=()=>{o(null)};return document.body.addEventListener("click",p),o(null),()=>{o(null),document.body.removeEventListener("click",p)}},[]),h.useEffect(()=>{if(c){const p=[...a].map(m=>m.id===c.id?c:m);e(p)}},[c]),h.useEffect(()=>{if(l.current&&f){const p=l.current.getBoundingClientRect().height,m=window.innerHeight;let R=f.top;R+p>m+window.scrollY-200&&(R=m+window.scrollY-p-200),R<0&&(R=10),x({top:R,left:f.left})}},[l.current,f]);const E=(p,m)=>{p.stopPropagation();const R=p.target.getBoundingClientRect();j({top:R.top+window.scrollY-70,left:R.left-(i?30:65)}),o(m)};return t.jsxRuntimeExports.jsxs("div",{className:tt.products,children:[t.jsxRuntimeExports.jsx("h5",{className:tt.subtitle,children:"Button Type"}),a.map(p=>t.jsxRuntimeExports.jsxs("div",{className:tt.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:m=>{const D=[...a].map(A=>A.id===p.id?{...p,type:m}:A);e(D)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:tt.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:tt.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:m=>{E(m,p)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:tt.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const m=a.filter(R=>R.id!==p.id);e(m)},width:20,height:20,fill:"#C12A2A"})})]})]},p.id)),c&&t.jsxRuntimeExports.jsx(En,{ref:l,activeButton:c,setActiveButton:o,popupPosition:n,editableLink:r}),i&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:tt.button,size:"s",onClick:()=>{const p=[...a];r?p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:"",openInNewTab:!1}):p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:"",openInNewTab:!1}),e(p)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:tt.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Vn=d=>{const{isActiveButtons:a,setIsActiveButtons:e,buttons:s,setButtons:i,editableLink:r=!0}=d;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:nt.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:nt.top,children:[t.jsxRuntimeExports.jsx("h3",{className:nt.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:c=>e(c)})]}),t.jsxRuntimeExports.jsx(Et,{buttons:s,setButtons:i,editableLink:r})]})})},Yn="_wrapper_m18qi_1",Gn="_subtitle_m18qi_7",Xn="_content_m18qi_14",Wn="_range_m18qi_22",Jn="_track_m18qi_27",Qn="_progress_m18qi_36",Kn="_dots_m18qi_46",Zn="_dot_m18qi_46",ti="_active_m18qi_65",ei="_input_m18qi_77",si="_countBlock_m18qi_91",ni="_count_m18qi_91",ii="_controls_m18qi_107",oi="_button_m18qi_113",G={wrapper:Yn,subtitle:Gn,content:Xn,range:Wn,track:Jn,progress:Qn,dots:Kn,dot:Zn,active:ti,input:ei,countBlock:si,count:ni,controls:ii,button:oi},_t=d=>{const{label:a,min:e=1,max:s=4,step:i=1,count:r,setCount:c}=d,[o,n]=h.useState(!1),x=Array.from({length:(s-e)/i+1}),f=(r-e)/(s-e)*100,j=()=>{r<s&&c(r+i)},l=()=>{r>e&&c(r-i)},E=p=>{const m=e+p*i;c(m)};return t.jsxRuntimeExports.jsxs("div",{className:G.wrapper,children:[a&&t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:a}),t.jsxRuntimeExports.jsxs("div",{className:G.content,children:[t.jsxRuntimeExports.jsxs("div",{className:G.range,children:[t.jsxRuntimeExports.jsx("div",{className:G.track}),t.jsxRuntimeExports.jsx("div",{className:G.progress,style:{width:`${f}%`}}),t.jsxRuntimeExports.jsx("div",{className:G.dots,children:x.map((p,m)=>{const R=m<=(r-e)/i;return t.jsxRuntimeExports.jsx("button",{onClick:()=>E(m),className:t.clx(G.dot,{[G.active]:R,[G.inactive]:!R,[G.dragging]:o}),"aria-label":`Set value to ${e+m*i}`},m)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:s,step:i,value:r,onChange:p=>c(Number(p.target.value)),onMouseDown:()=>n(!0),onMouseUp:()=>n(!1),onTouchStart:()=>n(!0),onTouchEnd:()=>n(!1),className:G.input})]}),t.jsxRuntimeExports.jsxs("div",{className:G.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:s,paddingless:!0,onChange:p=>{const m=Number(p);m>s?c(s):m<e?c(e):c(m)},value:String(r)}),t.jsxRuntimeExports.jsxs("div",{className:G.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:j,disabled:r>=s,className:G.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:l,disabled:r<=e,className:G.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},ai="_title_ix5ax_1",ri="_subtitle_ix5ax_5",ci="_header_ix5ax_12",li="_text_ix5ax_13",di="_productsBlock_ix5ax_14",ui="_top_ix5ax_26",xi="_itemsBlock_ix5ax_35",mi="_typeTexts_ix5ax_41",pi="_block_ix5ax_48",_i="_active_ix5ax_61",hi="_products_ix5ax_14",ji="_product_ix5ax_14",gi="_button_ix5ax_80",fi="_image_ix5ax_91",bi="_info_ix5ax_98",vi="_name_ix5ax_110",Ei="_buttons_ix5ax_114",Ri="_modal_ix5ax_121",yi="_link_ix5ax_141",Ii="_modalOptions_ix5ax_147",ki="_addButton_ix5ax_160",Si="_deleteButton_ix5ax_175",$i="_closeIcon_ix5ax_187",V={title:ai,subtitle:ri,header:ci,text:li,productsBlock:di,top:ui,itemsBlock:xi,typeTexts:mi,block:pi,active:_i,products:hi,product:ji,button:gi,image:fi,info:bi,name:vi,buttons:Ei,modal:Ri,link:yi,modalOptions:Ii,addButton:ki,deleteButton:Si,closeIcon:$i},Ni=d=>{const{activeItem:a,setActiveItem:e,popupPosition:s,setIsOpenModal:i,itemsOptions:r}=d,c=r.find(o=>o.id===a.listingId);return c?t.jsxRuntimeExports.jsxs("div",{className:V.modal,onClick:o=>{o.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{children:t.splitTextIntoSpans(c.productData.name)}),t.jsxRuntimeExports.jsx("div",{className:V.closeIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,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:o=>{const n={...a,image:o[0]};e(n)}})})]}):null};function wi(d){const{product:a,children:e}=d,{attributes:s,listeners:i,setNodeRef:r,transform:c,transition:o,isDragging:n}=t.useSortable({id:String(a.listingId)}),x={transform:t.CSS.Transform.toString(c),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:r,style:x,className:`${V.product} ${n?V.dragging:""}`,...s,...i,children:e})}const Ci=d=>{const{isActiveItems:a,setIsActiveItems:e,items:s,setItems:i,other:r,title:c,subtitle:o,editable:n=!0,draggable:x=!1,withImage:f=!1,deletable:j=!0,addable:l=!0,itemsType:E,itemsOptions:p}=d,[m,R]=h.useState(null),[D,A]=h.useState({top:0,left:0}),[u,$]=h.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));h.useEffect(()=>{const g=()=>{R(null),$(!1)};return document.body.addEventListener("click",g),R(null),$(!1),()=>{R(null),$(!1),document.body.removeEventListener("click",g)}},[]),h.useEffect(()=>{if(m){const g=[...s].map(y=>y.listingId===m.listingId?m:y);i(g)}},[m]);const z=(g,y)=>{g.stopPropagation();const k=g.target.getBoundingClientRect(),L=100,B=window.innerHeight;let q=k.top+window.scrollY;q+L>B&&(q=B-L-20),$(!0),A({top:q-80,left:k.left-30}),R(y)};function N(g){if(f)return g?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${g}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const b=g=>{const{active:y,over:k}=g;if(k&&y.id!==k.id){const L=s.findIndex(q=>String(q.listingId)===y.id),B=s.findIndex(q=>String(q.listingId)===k.id);if(L!==-1&&B!==-1){const q=[...s],[K]=q.splice(L,1);q.splice(B,0,K),i(q)}}},C=(g,y)=>{const k=p.find(B=>g.listingId===B.id);if(!k)return null;const L=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[x&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),E==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:B=>{const q=[...s],K=p.find(O=>O.productData.name===B);if(!K)return;const it={listingId:K.id,image:K.productData.images.length>0?K.productData.images[0].cfId:""},v=q.map(O=>O.listingId===g.listingId?it:O);R(it),i([...v])},value:k.productData.name,options:[...p.filter(B=>!s.find(q=>q.listingId===B.id)).map(B=>B.productData.name)],leftAddon:N(g.image||k.productData.images.length>0&&k.productData.images[0].cfId||"")},y),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=>z(B,g)})}),j&&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!==g))})})]})]});return x?t.jsxRuntimeExports.jsx(wi,{product:g,children:L},g.listingId):t.jsxRuntimeExports.jsx("div",{className:V.product,children:L},g.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:g=>e==null?void 0:e(g)})]}),u&&m&&t.jsxRuntimeExports.jsx(Ni,{activeItem:m,setActiveItem:R,setIsOpenModal:$,popupPosition:D,itemsOptions:p}),t.jsxRuntimeExports.jsxs("div",{className:V.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:V.subtitle,children:o}),x?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:b,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>String(g.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((g,y)=>C(g,y))})}):s.map((g,y)=>C(g,y)),l&&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 g=[...s];for(let y=0;y<p.length;y++)if(!s.find(k=>k.listingId===p[y].id)){g.push({listingId:p[y].id,image:p[y].productData.images.length>0?p[y].productData.images[0].cfId:""});break}i(g)},disabled:s.length===p.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(pt,{items:r})]})},Bi="_options_6cemk_1",Ti="_price_6cemk_12",Pi="_oldPrice_6cemk_19",Ai="_newPrice_6cemk_27",Mi="_animate_6cemk_34",Oi="_appearAndBounce_6cemk_1",qi="_meta_6cemk_52",Li="_info_6cemk_58",Di="_infoRight_6cemk_66",Ui="_buttons_6cemk_73",Hi="_variants_6cemk_80",zi="_variant_6cemk_80",Fi="_stock_6cemk_98",Vi="_variantInfo_6cemk_105",Yi="_quantity_6cemk_111",Gi="_count_6cemk_118",Xi="_focused_6cemk_135",Wi="_button_6cemk_73",Ji="_activeVariant_6cemk_161",Qi="_chargeTypes_6cemk_165",Ki="_charge_6cemk_165",Zi="_chargeActive_6cemk_190",to="_title_6cemk_198",w={options:Bi,price:Ti,oldPrice:Pi,newPrice:Ai,animate:Mi,appearAndBounce:Oi,meta:qi,info:Li,infoRight:Di,buttons:Ui,variants:Hi,variant:zi,stock:Fi,variantInfo:Vi,quantity:Yi,count:Gi,focused:Xi,button:Wi,activeVariant:Ji,chargeTypes:Qi,charge:Ki,chargeActive:Zi,title:to},eo="_wrapper_c1dht_1",so="_label_c1dht_9",no="_input_c1dht_18",io="_paddingless_c1dht_31",oo="_content_c1dht_35",ao="_contentBorder_c1dht_47",ro="_borderless_c1dht_52",co="_rightIcon_c1dht_57",Z={wrapper:eo,label:so,input:no,paddingless:io,content:oo,contentBorder:ao,borderless:ro,rightIcon:co},Rt=d=>{const{onChange:a,style:e,label:s,value:i,type:r,min:c,max:o,placeholder:n,disabled:x=!1,required:f=!1,regex:j,paddingless:l=!1,borderless:E=!1,editable:p=!1,isSearch:m=!1,centered:R=!1}=d,{themeSettings:D}=t.useThemeSettingsStore(),{inputs:A}=D,[u,$]=h.useState(!1);function M(N){return Number(N)<0?String(c):N}function z(N){return!f||!j?!0:new RegExp(j).test(N)}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:t.clx(Z.content,{[Z.contentBorder]:A.border.active}),style:{...e,background:A.field.active?A.field.color:"transparent",padding:m?`7px ${Number(A.general.size)+20}px 7px 11px`:"7px 11px"},children:[t.jsxRuntimeExports.jsx("input",{id:s,type:r||"text",onChange:N=>{if(r==="text")a(N.target.value);else{const b=M(N.target.value);a(b)}},value:i,autoComplete:"off",placeholder:n||"Type something...",className:t.clx(Z.input,{[Z.required]:u&&f&&!z(i),[Z.paddingless]:l,[Z.borderless]:E}),min:r==="number"?c:void 0,max:r==="number"?o:void 0,disabled:x,onFocus:()=>$(!0),style:{textAlign:R?"center":"left"}}),m&&t.jsxRuntimeExports.jsx("div",{className:Z.rightIcon,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"MagnifyingGlass",fill:"var(--icon-secondary)",width:A.general.size,height:A.general.size})}),p&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},lo="_button_85085_1",uo="_primary_85085_20",xo="_primaryHovered_85085_30",mo="_secondary_85085_34",po="_secondaryHovered_85085_44",_o="_tertiary_85085_48",ho="_tertiaryHovered_85085_58",jo="_content_85085_62",et={button:lo,primary:uo,primaryHovered:xo,secondary:mo,secondaryHovered:po,tertiary:_o,tertiaryHovered:ho,content:jo},W=d=>{const{children:a,onClick:e,style:s,className:i,disabled:r=!1,type:c="Primary"}=d,{themeSettings:o}=t.useThemeSettingsStore();return t.jsxRuntimeExports.jsx("button",{className:t.clx(et.button,i,{[et.primary]:c==="Primary",[et.secondary]:c==="Secondary",[et.tertiary]:c==="Tertiary",[et.primaryHovered]:c==="Primary"&&!r&&o.buttons.primary.hover,[et.secondaryHovered]:c==="Secondary"&&!r&&o.buttons.secondary.hover,[et.tertiaryHovered]:c==="Tertiary"&&!r&&o.buttons.tertiary.hover}),onClick:e,style:{...s},disabled:r,children:c==="Tertiary"?t.jsxRuntimeExports.jsxs("div",{className:et.content,children:[a,t.jsxRuntimeExports.jsx(t.Icon,{name:"ArrowRight",fill:"var(--icon-tertiary)",width:20,height:20})]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a})})};var yt=(d=>(d.ONE_TIME="One-Time",d.RECURRING="Subscribe & Save",d))(yt||{});const go=d=>{var D,A;const{variants:a}=d,[e,s]=h.useState(a[0]),[i,r]=h.useState(e.chargeTypes[0]),c=t.useNavigate(),[o,n]=h.useState(1),{reset:x,addProductToCart:f,getProducts:j}=t.useCart(),[l,E]=h.useState(!1);h.useEffect(()=>{E(!0);const u=setTimeout(()=>E(!1),600);return()=>clearTimeout(u)},[o]);async function p(){await j(),await f({productId:d.id,productVariantId:e.id,quantity:o})}function m(){x(),p(),c("/checkout")}function R(u){if(u>=864e5){const b=Math.floor(u/864e5);return`${b} ${b===1?"day":"days"}`}else if(u>=36e5){const b=Math.floor(u/36e5);return`${b} ${b===1?"hour":"hours"}`}else if(u>=6e4){const b=Math.floor(u/6e4);return`${b} ${b===1?"minute":"minutes"}`}else{const b=Math.floor(u/1e3);return`${b} ${b===1?"second":"seconds"}`}}return h.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&n(0)},[e.quantity.available]),console.log(e.quantity),t.jsxRuntimeExports.jsxs("div",{className:w.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:w.chargeTypes,children:e.chargeTypes.map(u=>t.jsxRuntimeExports.jsx("div",{className:t.clx(w.charge,{[w.chargeActive]:i===u}),onClick:()=>r(u),children:yt[u]},u))}),t.jsxRuntimeExports.jsx("div",{className:w.variants,children:a.map(u=>{var $;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(w.variant,{[w.activeVariant]:e.id===u.id}),onClick:()=>s(u),children:[t.jsxRuntimeExports.jsxs("div",{className:w.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:w.title,children:u.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",i==="ONE_TIME"?u.price.amount:u.subscriptionSettings?u.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:w.stock,children:[(($=u.quantity.restrictions)==null?void 0:$.max)||u.quantity.available||0," in stock"]})})]},u.id)})}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:w.quantity,children:[t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>{o>1?n(u=>u-1):n(1)},className:w.button,disabled:e.quantity.available===0||e.quantity.restrictions&&o<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(Rt,{type:"number",value:String(o),onChange:u=>n(Number(u)),max:((D=e.quantity.restrictions)==null?void 0:D.max)||e.quantity.available||1/0,min:((A=e.quantity.restrictions)==null?void 0:A.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>{n(u=>u+1)},className:w.button,disabled:!!(e.quantity.restrictions&&o>=e.quantity.restrictions.max||e.quantity.available!==void 0&&o>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:w.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:w.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":R(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:w.infoRight,children:i==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:l}),children:["$ ",(e.price.amount||0)*o]}),t.jsxRuntimeExports.jsxs("span",{className:w.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*o]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:l}),children:["$ ",(e.price.amount||0)*o]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:w.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:l}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:w.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(w.newPrice,{[w.animate]:l}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[t.jsxRuntimeExports.jsx(W,{type:"Primary",onClick:()=>m(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:i==="ONE_TIME"?"Buy Now":"Subscribe Now"}),i==="ONE_TIME"&&t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:()=>p(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},fo="_button_1tdo3_1",bo="_login_1tdo3_14",vo="_signUp_1tdo3_18",Eo="_buttons_1tdo3_23",Ro="_modal_1tdo3_32",yo="_closing_1tdo3_64",Io="_info_1tdo3_113",ko="_top_1tdo3_120",So="_title_1tdo3_131",$o="_clear_1tdo3_138",No="_activeClear_1tdo3_145",wo="_count_1tdo3_149",Co="_cart_1tdo3_164",Bo="_empty_1tdo3_172",To="_product_1tdo3_198",Po="_products_1tdo3_207",Ao="_image_1tdo3_215",Mo="_productInfo_1tdo3_221",Oo="_content_1tdo3_228",qo="_name_1tdo3_234",Lo="_price_1tdo3_240",Do="_productButtons_1tdo3_246",Uo="_productButton_1tdo3_246",Ho="_productCount_1tdo3_266",zo="_bottom_1tdo3_282",Fo="_subtotal_1tdo3_290",Vo="_block_1tdo3_298",Yo="_shoppingCount_1tdo3_305",Go="_total_1tdo3_325",Xo="_link_1tdo3_331",Wo="_userInfo_1tdo3_338",Jo="_pagesMobileModal_1tdo3_349",Qo="_pagesMobileModalContent_1tdo3_363",Ko="_pagesMobileModalHeader_1tdo3_369",Zo="_pagesMobileModalFooter_1tdo3_379",S={button:fo,login:bo,signUp:vo,buttons:Eo,modal:Ro,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:yo,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:Io,top:ko,title:So,clear:$o,activeClear:No,count:wo,cart:Co,empty:Bo,product:To,products:Po,image:Ao,productInfo:Mo,content:Oo,name:qo,price:Lo,productButtons:Do,productButton:Uo,productCount:Ho,bottom:zo,subtotal:Fo,block:Vo,shoppingCount:Yo,total:Go,link:Xo,userInfo:Wo,pagesMobileModal:Jo,pagesMobileModalContent:Qo,pagesMobileModalHeader:Ko,pagesMobileModalFooter:Zo};class ut extends Error{}ut.prototype.name="InvalidTokenError";function ta(d){return decodeURIComponent(atob(d).replace(/(.)/g,(a,e)=>{let s=e.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function ea(d){let a=d.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 ta(a)}catch{return atob(a)}}function sa(d,a){if(typeof d!="string")throw new ut("Invalid token specified: must be a string");a||(a={});const e=a.header===!0?0:1,s=d.split(".")[e];if(typeof s!="string")throw new ut(`Invalid token specified: missing part #${e+1}`);let i;try{i=ea(s)}catch(r){throw new ut(`Invalid token specified: invalid base64 for part #${e+1} (${r.message})`)}try{return JSON.parse(i)}catch(r){throw new ut(`Invalid token specified: invalid json for part #${e+1} (${r.message})`)}}const na=d=>{const{shopping:a,signUp:e,isShowUserInfo:s=!0}=d;return t.jsxRuntimeExports.jsxs("div",{className:S.buttons,children:[a&&t.jsxRuntimeExports.jsx(It,{}),s&&t.jsxRuntimeExports.jsx(bt,{signUp:e})]})},It=()=>{const[d,a]=h.useState(!1),[e,s]=h.useState([]),{cart:i,getProducts:r}=t.useCart();function c(l){for(let E=0;E<i.parts.length;E++)for(let p=0;p<l.variants.length;p++)if(i.parts[E].productVariantId===l.variants[E].id)return i.parts[E].productVariantId}function o(l){for(let E=0;E<i.parts.length;E++)for(let p=0;p<l.variants.length;p++)if(i.parts[E].productVariantId===l.variants[E].id)return i.parts[E].quantity}h.useEffect(()=>{(async()=>{const E=i.parts.map(R=>String(R.productId)),m=(await r([...E])).map(R=>({...R,activeVariantId:c(R),quantity:o(R)}));s(m)})()},[i.parts.length]);function n(l){var E;return!l||!(l!=null&&l.variants)?!1:(E=l.variants.find(p=>p.id===l.activeVariantId))==null?void 0:E.subscriptionSettings}const x=i.parts.length>0&&e.length>0&&!n(e[0]),[f,j]=h.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(W,{type:"Secondary",style:{padding:10},onClick:l=>{l.stopPropagation(),window.location.pathname!=="/admin/builder"&&(a(!0),j(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),x&&t.jsxRuntimeExports.jsx("div",{className:S.shoppingCount,children:i.parts.length})]}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{j(!1),setTimeout(()=>{a(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(kt,{activeProducts:e,isCartNotEmpty:x,isOpen:f})})]})},kt=d=>{const{activeProducts:a,isCartNotEmpty:e,isOpen:s}=d,{cart:i,reset:r,getTotalAndDiscount:c,updateQuantityOfProduct:o}=t.useCart(),n=t.useNavigate();function x(l){n(l)}function f(l){o({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity+1})}function j(l){o({productId:l.id,productVariantId:l.activeVariantId,quantity:l.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(S.modal,{[S.closing]:!s}),onClick:l=>l.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:S.top,children:[t.jsxRuntimeExports.jsxs("div",{className:S.info,children:[t.jsxRuntimeExports.jsx("span",{className:S.title,children:"Cart"}),e&&t.jsxRuntimeExports.jsx("div",{className:S.count,children:i.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(S.clear,{[S.activeClear]:e}),disabled:!e,onClick:r,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:S.cart,children:[t.jsxRuntimeExports.jsx("div",{className:S.products,children:a.map(l=>t.jsxRuntimeExports.jsxs("div",{className:S.product,children:[t.jsxRuntimeExports.jsxs("div",{className:S.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${l.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:S.image}),t.jsxRuntimeExports.jsxs("div",{className:S.content,children:[t.jsxRuntimeExports.jsx("div",{className:S.name,children:l.name}),t.jsxRuntimeExports.jsxs("div",{className:S.price,children:["$",l.variants.find(E=>E.id===l.activeVariantId).price.amount*((l==null?void 0:l.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:S.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{l.quantity!==1&&j(l)},className:S.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:S.productCount,children:l.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>f(l),className:S.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},l.id))}),t.jsxRuntimeExports.jsxs("div",{className:S.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:S.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:S.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:S.total,children:["$",c().total]})]}),t.jsxRuntimeExports.jsx(W,{onClick:()=>x("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(St,{})]})},St=()=>t.jsxRuntimeExports.jsxs("div",{className:S.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:S.link,children:"view products"})]})]}),bt=({signUp:d})=>{const a=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=a,s=t.useNavigate();function i(o){s(o)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(W,{onClick:()=>i("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),d&&t.jsxRuntimeExports.jsx(W,{onClick:()=>i("/customer-dash"),type:"Primary",style:{padding:10},children:"Sign Up"})]});const[r,c]=h.useState("test-email@gmail.com");return h.useEffect(()=>{(async()=>{const n=sa(e);c(n.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:S.userInfo,onClick:()=>i("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:r||"test-email@gmail.com"})})},$t=({children:d,logo:a,setIsOpen:e,signUp:s})=>{const{setIsOpen:i}=t.useModalStore(),r=()=>{i(!1),setTimeout(()=>{e(!1),i(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:S.pagesMobileModal,onClick:c=>c.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:S.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:a}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",onClick:r,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:S.pagesMobileModalContent,children:d}),t.jsxRuntimeExports.jsx("div",{className:S.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(bt,{signUp:s})})]})},ia=({children:d,logo:a,signUp:e})=>{const[s,i]=h.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Nt,{setIsOpenModal:i}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>i(!1),children:t.jsxRuntimeExports.jsx($t,{logo:a,setIsOpen:i,signUp:e,children:d})})]})},Nt=d=>{const{setIsOpenModal:a}=d;return t.jsxRuntimeExports.jsx(W,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),a(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},oa="_share_xddz7_1",aa="_modal_xddz7_8",ra="_header_xddz7_20",ca="_socials_xddz7_30",la="_social_xddz7_30",da="_copy_xddz7_40",ua="_title_xddz7_47",xa="_copyWrapper_xddz7_53",ma="_copyText_xddz7_62",pa="_copyTextMobile_xddz7_75",_a="_copyTextMiniMobile_xddz7_94",st={share:oa,modal:aa,header:ra,socials:ca,social:la,copy:da,title:ua,copyWrapper:xa,copyText:ma,copyTextMobile:pa,copyTextMiniMobile:_a},ha=()=>{const{isOpenModal:d,setIsOpenModal:a}=t.useShareLinkStore();function e(){a(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:st.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),d&&t.jsxRuntimeExports.jsx(t.Modal,{close:a,children:t.jsxRuntimeExports.jsx(ja,{})})]})},ja=()=>{const{setIsOpenModal:d}=t.useShareLinkStore(),{notification:a,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),i=window.location.href;function r(){navigator.clipboard.writeText(i),e({message:"Link copied to clipboard",status:"success"})}function c(){s(!1),setTimeout(()=>{d(!1),s(!0)},300)}function o(n,x){return n.length>x?n.slice(0,x)+"...":n}return t.jsxRuntimeExports.jsxs("div",{className:st.modal,onClick:n=>n.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:st.header,children:[t.jsxRuntimeExports.jsx("div",{className:st.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:c,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:st.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:r,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:st.copyText,children:o(i,100)}),t.jsxRuntimeExports.jsx("div",{className:st.copyTextMobile,children:o(i,40)}),t.jsxRuntimeExports.jsx("div",{className:st.copyTextMiniMobile,children:o(i,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:r,children:a?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},ga="_accordion_1s1lq_1",fa="_header_1s1lq_9",ba="_icon_1s1lq_18",va="_open_1s1lq_21",Ea="_content_1s1lq_25",dt={accordion:ga,header:fa,icon:ba,open:va,content:Ea},Ra=({title:d,content:a,defaultOpen:e=!1})=>{const[s,i]=h.useState(e),[r,c]=h.useState(0),o=h.useRef(null),n=()=>{i(!s)};return h.useEffect(()=>{o.current&&c(s?o.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:dt.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:dt.header,onClick:n,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:d}),t.jsxRuntimeExports.jsx("div",{className:t.clx(dt.icon,{[dt.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:o,className:dt.content,style:{height:`${r}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:a})})]})},ya=({children:d,path:a,className:e,target:s="_self",id:i})=>{const r=t.useNavigate(),c=/^https?:\/\//.test(a),o=n=>{c||s==="_blank"?s==="_blank"?window.open(a,"_blank"):window.location.href=a:(n.preventDefault(),r(a,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:o,className:e,role:"link",style:{cursor:"pointer"},id:i,children:d})},Ia="_buttonsBlock_1b2rb_1",ka="_slideUp_1b2rb_1",Sa={buttonsBlock:Ia,slideUp:ka},$a=()=>t.jsxRuntimeExports.jsxs("div",{className:Sa.buttonsBlock,children:[t.jsxRuntimeExports.jsx(W,{type:"Primary",style:{width:"100%"},onClick:()=>{console.log("add to cart")},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(W,{type:"Secondary",children:"Buy"})]}),Na="_wrapper_st58d_1",wa="_label_st58d_10",Ca="_textarea_st58d_18",Ba="_length_st58d_33",mt={wrapper:Na,label:wa,textarea:Ca,length:Ba},Ta=d=>{const{onChange:a,label:e,value:s,maxLength:i,placeholder:r="Type something..."}=d,[c,o]=h.useState(s.length);return t.jsxRuntimeExports.jsxs("div",{className:mt.wrapper,children:[e&&t.jsxRuntimeExports.jsx("label",{className:mt.label,htmlFor:e,children:e}),t.jsxRuntimeExports.jsx("textarea",{id:e,defaultValue:s,onChange:n=>{o(n.target.value.length),a(n.target.value)},placeholder:r,className:mt.textarea,maxLength:i}),i&&t.jsxRuntimeExports.jsxs("div",{className:mt.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=Ra;exports.BurgerMenuButton=Nt;exports.Button=W;exports.ButtonTypeSettings=Et;exports.ButtonsSettings=Vn;exports.CategorySettings=Ze;exports.EmptyCart=St;exports.FormSettings=Ks;exports.HeaderButtons=na;exports.InputUI=Rt;exports.ItemsSettings=vt;exports.LayoutSettings=Ft;exports.Link=ya;exports.ListingSelector=Ci;exports.PagesMobileMenu=ia;exports.PagesMobileModal=$t;exports.PagesSettings=Is;exports.ProductCardButtons=$a;exports.ProductOptions=go;exports.RangeSelector=_t;exports.ShareLink=ha;exports.ShoppingButton=It;exports.ShoppingModalCart=kt;exports.TextSettings=ft;exports.TextareaUI=Ta;exports.TypesText=gt;exports.UserInfo=bt;
|