@billgangcom/theme-lib 1.66.0 → 1.66.1

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