@billgangcom/theme-lib 1.54.2 → 1.55.0

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-BtRp5S3J.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.splitTextIntoSpans=t.splitTextIntoSpans;exports.useReCaptcha=t.Wc;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-CzZx3EyU.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.splitTextIntoSpans=t.splitTextIntoSpans;exports.useReCaptcha=t.yi;
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { App as o, ColorVariables as t, createTicket as r, hotReload as s, iconNames as p } from "./builder.es.js";
2
- import { Q as i, s as l, W as h } from "./index-D_ZWUeWw.js";
2
+ import { q as i, s as l, y as h } from "./index-D1p6pZXA.js";
3
3
  export {
4
4
  o as App,
5
5
  t as ColorVariables,
package/dist/ui.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BtRp5S3J.cjs"),j=require("react");require("@phosphor-icons/react");const rt="_wrapper_1vmyb_2",ct="_alignmentBlock_1vmyb_8",lt="_title_1vmyb_15",dt="_subtitle_1vmyb_22",ut="_alignmentContent_1vmyb_29",xt="_alignments_1vmyb_37",mt="_alignment_1vmyb_8",pt="_circle_1vmyb_60",jt="_paddings_1vmyb_67",ht="_padding_1vmyb_67",_t="_active_1vmyb_91",gt="_input_1vmyb_98",H={wrapper:rt,alignmentBlock:ct,title:lt,subtitle:dt,alignmentContent:ut,alignments:xt,alignment:mt,circle:pt,paddings:jt,padding:ht,active:_t,input:gt},ft=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Et=["left","top","right","bottom"],bt=l=>{const{alignment:i,padding:e,setPadding:s,setAlignment:n}=l;function m(r){switch(r){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 u(r){switch(r){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[o,d]=j.useState(null),[_,C]=j.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:H.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:H.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:H.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:H.alignments,children:ft.map(r=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{n(r)},className:H.alignment,onMouseEnter:()=>{d(r)},onMouseLeave:()=>{d(null)},children:[r!==i&&o!==r&&t.jsxRuntimeExports.jsx("div",{className:H.circle}),r!==i&&o===r&&t.jsxRuntimeExports.jsx(t.Icon,{name:m(o),fill:"#c2c2c2",width:22,height:22}),r===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:m(i),fill:"#FF3F19",width:22,height:22})]},r))}),t.jsxRuntimeExports.jsx("div",{className:H.paddings,children:Et.map(r=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(H.padding,{[H.active]:_===r}),onFocus:()=>{C(r)},onBlur:()=>{C(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:u(r),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[r]),onChange:c=>s({...e,[r]:Math.min(Number(c),999)}),max:999,paddingless:!0,borderless:!0})]},r))})]})]})]})},Rt="_title_82zux_1",vt="_subtitle_82zux_5",yt="_header_82zux_12",It="_text_82zux_13",St="_productsBlock_82zux_14",Nt="_top_82zux_26",kt="_itemsBlock_82zux_35",Ct="_typeTexts_82zux_41",$t="_block_82zux_48",Bt="_active_82zux_61",wt="_products_82zux_14",Pt="_product_82zux_14",Mt="_button_82zux_80",Tt="_disabled_82zux_91",qt="_image_82zux_95",At="_info_82zux_102",Ot="_name_82zux_114",Lt="_buttons_82zux_118",zt="_modal_82zux_125",Dt="_link_82zux_145",Ut="_modalOptions_82zux_151",Ht="_addButton_82zux_157",Ft="_deleteButton_82zux_179",F={title:Rt,subtitle:vt,header:yt,text:It,productsBlock:St,top:Nt,itemsBlock:kt,typeTexts:Ct,block:$t,active:Bt,products:wt,product:Pt,button:Mt,disabled:Tt,image:qt,info:At,name:Ot,buttons:Lt,modal:zt,link:Dt,modalOptions:Ut,addButton:Ht,deleteButton:Ft},Vt=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,other:m,title:u,subtitle:o,draggable:d=!1,withImage:_=!1,addable:C=!0,itemsOptions:r,hasRangeSelector:c=!1,rangeSelectorOptions:B,limit:N,autoScrollInterval:p,deletable:y}=l;function k(E){if(_)return E?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${E[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const h=(E,P=!1)=>{const M=r.find(S=>S.id===E);if(!M)return;const L=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:S=>{const g=[...s],R=r.find(f=>f.name===S);if(!R)return;const T=R.id,a=g.map(f=>f===E?T:f);n([...a])},value:M.name,options:r.filter(S=>!s.find(g=>g===S.id)).map(S=>S.name),leftAddon:k(M.images)}),P&&t.jsxRuntimeExports.jsx("div",{className:F.buttons,children:t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(S=>S!==E))})})})]});return t.jsxRuntimeExports.jsx("div",{className:F.product,children:L},E)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:E=>e==null?void 0:e(E)})]}),c&&B&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...B}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:o}),s.map(E=>h(E,y)),C&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(F.button,{[F.disabled]:!!(N&&N<=s.length||s.length===r.length)}),size:"s",disabled:!!(N&&N<=s.length||s.length===r.length),onClick:()=>{const E=[...s];let P=null;if(r){for(let M=0;M<r.length;M++)if(!s.find(L=>L===r[M].id)){P=r[M];break}}E.push((P==null?void 0:P.id)||r[0].id),n(E)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),m!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:m}),p!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(p.scrollInterval),onChange:E=>p.setScrollInterval(Number(E)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Yt="_title_roi3a_1",Wt="_subtitle_roi3a_5",Gt="_header_roi3a_12",Xt="_text_roi3a_13",Jt="_productsBlock_roi3a_14",Qt="_top_roi3a_26",Kt="_itemsBlock_roi3a_35",Zt="_typeTexts_roi3a_41",te="_block_roi3a_48",ee="_active_roi3a_61",se="_products_roi3a_14",ne="_product_roi3a_14",ie="_button_roi3a_80",oe="_disabled_roi3a_91",ae="_image_roi3a_95",re="_info_roi3a_102",ce="_name_roi3a_114",le="_buttons_roi3a_118",de="_modal_roi3a_125",ue="_link_roi3a_145",xe="_modalOptions_roi3a_151",me="_addButton_roi3a_164",pe="_deleteButton_roi3a_179",je="_closeIcon_roi3a_191",D={title:Yt,subtitle:Wt,header:Gt,text:Xt,productsBlock:Jt,top:Qt,itemsBlock:Kt,typeTexts:Zt,block:te,active:ee,products:se,product:ne,button:ie,disabled:oe,image:ae,info:re,name:ce,buttons:le,modal:de,link:ue,modalOptions:xe,addButton:me,deleteButton:pe,closeIcon:je};function he({product:l,children:i}){const{attributes:e,listeners:s,setNodeRef:n,transform:m,transition:u,isDragging:o}=t.useSortable({id:l.id}),d={transform:t.CSS.Transform.toString(m),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:n,style:d,className:`${D.product} ${o?D.dragging:""}`,...e,...s,children:i})}const _e=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,title:m,subtitle:u,editable:o=!0,draggable:d=!1,deletable:_=!0,addable:C=!0,itemsType:r,itemsOptions:c,addableOptions:B={},limit:N}=l,[p,y]=j.useState(null),[k,h]=j.useState(null),E=j.useRef(null),P=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{if(p){const g=[...s].map(R=>R.id===p.id?p:R);n(g)}},[p]),j.useEffect(()=>{E.current&&k&&(E.current.getBoundingClientRect().height,k.top)},[E.current,k]);const M=(g,R)=>{g.stopPropagation();const T=g.target.getBoundingClientRect();h({top:T.top+window.scrollY,left:T.left-30}),y(R)},L=g=>{const{active:R,over:T}=g;if(T&&R.id!==T.id){const a=s.findIndex(I=>I.id===R.id),f=s.findIndex(I=>I.id===T.id);if(a!==-1&&f!==-1){const I=[...s],[z]=I.splice(a,1);I.splice(f,0,z),n(I)}}},S=(g,R)=>{const T=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),r==="select"&&c&&t.jsxRuntimeExports.jsx(t.Select,{onChange:a=>{const f=[...s],I=c.find($=>$.name===a);if(!I)return;const z=f.map($=>$.id===g.id?{...I,name:{"en-US":a}}:$);y({...g,name:{"en-US":a}}),n([...z])},value:g.name,options:c.filter(a=>!s.find(f=>f.name===a.name)).map(a=>a.name)}),t.jsxRuntimeExports.jsxs("div",{className:D.buttons,children:[o&&t.jsxRuntimeExports.jsx("div",{className:D.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:a=>M(a,g)})}),_&&t.jsxRuntimeExports.jsx("div",{className:D.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(a=>a.id!==g.id))})})]})]});return d?t.jsxRuntimeExports.jsx(he,{product:g,index:R,children:T},g.id):t.jsxRuntimeExports.jsx("div",{className:D.product,children:T},g.id)};return t.jsxRuntimeExports.jsxs("div",{className:D.productsBlock,children:[(m||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:D.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:D.title,children:m}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:g=>e==null?void 0:e(g)})]}),t.jsxRuntimeExports.jsxs("div",{className:D.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:D.subtitle,children:u}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:P,onDragEnd:L,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>g.id),strategy:t.verticalListSortingStrategy,children:s.map((g,R)=>S(g,R))})}):s.map((g,R)=>S(g,R)),C&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(D.button,{[D.disabled]:!!(N&&N<=s.length||s.length===(c==null?void 0:c.length))}),size:"s",disabled:!!(N&&N<=s.length||s.length===(c==null?void 0:c.length)),onClick:()=>{const g=[...s];let R=null;if(c){for(let T=0;T<c.length;T++)if(!s.find(a=>a.id===c[T].id)){R=c[T];break}}r==="select"&&c&&g.push({name:R?R.name:c[0].name,id:(R==null?void 0:R.id)||c[0].id,...B}),n(g)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:D.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function ge(l){const{product:i,children:e}=l,{attributes:s,listeners:n,setNodeRef:m,transform:u,transition:o,isDragging:d}=t.useSortable({id:i.id}),_={transform:t.CSS.Transform.toString(u),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:m,style:_,className:`${t.styles.product} ${d?t.styles.dragging:""}`,...s,...n,children:e})}const fe=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,other:m,title:u,subtitle:o,editable:d=!0,draggable:_=!1,withImage:C=!1,deletable:r=!0,addable:c=!0,itemsType:B,itemsPlaceholder:N="",itemsOptions:p,hasRangeSelector:y=!1,rangeSelectorOptions:k,modalOptions:h,addableOptions:E={},limit:P}=l,[M,L]=j.useState(null),[S,g]=j.useState({top:0,left:0}),[R,T]=j.useState(null),a=j.useRef(null),[f,I]=j.useState(!1),z=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const x=()=>{L(null),I(!1)};return document.body.addEventListener("click",x),L(null),I(!1),()=>{L(null),I(!1),document.body.removeEventListener("click",x)}},[]),j.useEffect(()=>{if(M){const x=[...s].map(w=>w.id===M.id?M:w);n(x)}},[M]),j.useEffect(()=>{if(a.current&&R){const x=a.current.getBoundingClientRect().height,w=window.innerHeight;let q=R.top;q+x>w+window.scrollY-200&&(q=w+window.scrollY-x-200),q<0&&(q=10),g({top:q,left:R.left})}},[a.current,R]);const $=(x,w)=>{x.stopPropagation();const q=x.target.getBoundingClientRect();T({top:q.top+window.scrollY,left:q.left-30}),L(w),I(!0)};function O(x){if(C)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const Y=x=>{const{active:w,over:q}=x;if(q&&w.id!==q.id){const A=s.findIndex(U=>U.id===w.id),X=s.findIndex(U=>U.id===q.id);if(A!==-1&&X!==-1){const U=[...s],[V]=U.splice(A,1);U.splice(X,0,V),n(U)}}},J=x=>{var q;const w=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[_&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),B==="select"&&p&&t.jsxRuntimeExports.jsx(t.Select,{onChange:A=>{const U=[...s].map(V=>V.id===x.id?{...x,name:{"en-US":A}}:V);L({...x,name:{"en-US":A}}),n([...U])},value:x.name["en-US"],options:p.filter(A=>!s.find(X=>X.name["en-US"]===A)),leftAddon:O(x.images)}),B==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:A=>{const U=[...s].map(V=>V.id===x.id?{...x,name:{"en-US":A}}:V);n([...U])},value:x.name["en-US"],placeholder:N}),B==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:A=>{const U=[...s].map(V=>V.id===x.id?{...x,images:A}:V);n([...U])},activeImage:(q=s.find(A=>A.id===x.id))==null?void 0:q.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[d&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:A=>$(A,x)})}),r&&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:()=>n(s.filter(A=>A.id!==x.id))})})]})]});return _?t.jsxRuntimeExports.jsx(ge,{product:x,children:w},x.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:w},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>e==null?void 0:e(x)})]}),M&&d&&h&&f&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:a,activeItem:M,setActiveItem:L,popupPosition:S,modalOptions:h,setIsOpenModal:I}),y&&k&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...k}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:o}),_?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:z,onDragEnd:Y,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map(x=>J(x))})}):s.map(x=>J(x)),c&&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]:!!(P&&P<=s.length)}),size:"s",disabled:!!(P&&P<=s.length),onClick:()=>{const x=[...s];let w=null;if(p){for(let q=0;q<p.length;q++)if(!s.find(A=>A.name["en-US"]===p[q])){w=p[q];break}}B==="select"&&p?x.push({name:{"en-US":w||p[0]},id:t.v4(),...E,maxSymbols:100}):B==="input"?x.push({name:{"en-US":""},id:t.v4(),...E,maxSymbols:100}):x.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...E,maxSymbols:100}),n(x)},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})]})})})]}),m!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:m})]})},Ee="_subtitle_jql1y_1",be="_header_jql1y_8",Re="_text_jql1y_9",ve="_productsBlock_jql1y_10",ye="_buttonsBlock_jql1y_11",Ie="_top_jql1y_23",Se="_itemsBlock_jql1y_32",Ne="_typeTexts_jql1y_38",ke="_block_jql1y_45",Ce="_active_jql1y_58",$e="_products_jql1y_10",Be="_product_jql1y_10",we="_button_jql1y_11",Pe="_image_jql1y_88",Me="_info_jql1y_95",Te="_name_jql1y_107",qe="_buttons_jql1y_11",Ae="_modal_jql1y_118",Oe="_other_jql1y_138",Le="_options_jql1y_144",ze="_addButton_jql1y_150",De="_deleteButton_jql1y_165",W={subtitle:Ee,header:be,text:Re,productsBlock:ve,buttonsBlock:ye,top:Ie,itemsBlock:Se,typeTexts:Ne,block:ke,active:Ce,products:$e,product:Be,button:we,image:Pe,info:Me,name:Te,buttons:qe,modal:Ae,other:Oe,options:Le,addButton:ze,deleteButton:De},tt=l=>{const{buttons:i,setButtons:e,deletable:s=!0,addable:n=!0,editableLink:m=!0}=l,{pages:u}=t.usePagesStore(),[o,d]=j.useState(null),[_,C]=j.useState({top:0,left:0}),[r,c]=j.useState(null),B=j.useRef(null);j.useEffect(()=>{if(o){const p=[...i].map(y=>y.id===o.id?o:y);e(p)}},[o]),j.useEffect(()=>{if(B.current&&r){const p=B.current.getBoundingClientRect().height,y=window.innerHeight;let k=r.top;k+p>y+window.scrollY-200&&(k=y+window.scrollY-p-200),k<0&&(k=10),C({top:k,left:r.left})}},[B.current,r]);const N=(p,y)=>{p.stopPropagation();const k=p.target.getBoundingClientRect();c({top:k.top+window.scrollY-70,left:k.left-(n?30:65)}),d(y)};return t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:"Button Type"}),i.map(p=>t.jsxRuntimeExports.jsxs("div",{className:W.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const h=[...i].map(E=>E.id===p.id?{...p,type:y}:E);e(h)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:W.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>{N(y,p)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const y=i.filter(k=>k.id!==p.id);e(y)},width:20,height:20,fill:"#C12A2A"})})]})]},p.id)),o&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:B,activeButton:o,setActiveButton:d,popupPosition:_,editableLink:m}),n&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:W.button,size:"s",onClick:()=>{const p=[...i];m?p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:u?Object.values(u)[0].name:"Home",openInNewTab:!1}):p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:u?Object.values(u)[0].name:"Home",openInNewTab:!1}),e(p)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Ue=l=>{const{isActiveButtons:i,setIsActiveButtons:e,buttons:s,setButtons:n,editableLink:m=!0,addable:u=!0,deletable:o=!0}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.top,children:[t.jsxRuntimeExports.jsx("h3",{className:t.styles$1.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:d=>e(d)})]}),i&&t.jsxRuntimeExports.jsx(tt,{buttons:s,setButtons:n,editableLink:m,addable:u,deletable:o})]})})};function He(l){const{product:i,children:e}=l,{attributes:s,listeners:n,setNodeRef:m,transform:u,transition:o,isDragging:d}=t.useSortable({id:String(i.listingId)}),_={transform:t.CSS.Transform.toString(u),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:m,style:_,className:`${t.styles$2.product} ${d?t.styles$2.dragging:""}`,...s,...n,children:e})}const Fe=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,other:m,title:u,subtitle:o,editable:d=!0,draggable:_=!1,withImage:C=!1,deletable:r=!0,addable:c=!0,itemsType:B,itemsOptions:N}=l,[p,y]=j.useState(null),[k,h]=j.useState({top:0,left:0}),[E,P]=j.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const a=()=>{y(null),P(!1)};return document.body.addEventListener("click",a),y(null),P(!1),()=>{y(null),P(!1),document.body.removeEventListener("click",a)}},[]),j.useEffect(()=>{if(p){const a=[...s].map(f=>f.listingId===p.listingId?p:f);n(a)}},[p]);const L=(a,f)=>{a.stopPropagation();const I=a.target.getBoundingClientRect(),z=100,$=window.innerHeight;let O=I.top+window.scrollY;O+z>$&&(O=$-z-20),P(!0),h({top:O-80,left:I.left-30}),y(f)};function S(a){if(C)return a?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const g=a=>{const{active:f,over:I}=a;if(I&&f.id!==I.id){const z=s.findIndex(O=>String(O.listingId)===f.id),$=s.findIndex(O=>String(O.listingId)===I.id);if(z!==-1&&$!==-1){const O=[...s],[Y]=O.splice(z,1);O.splice($,0,Y),n(O)}}},R=(a,f)=>{const I=N.find($=>a.listingId===$.id);if(!I)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[_&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),B==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:$=>{const O=[...s],Y=N.find(w=>w.productData.name===$);if(!Y)return;const J={listingId:Y.id,image:Y.productData.images.length>0?Y.productData.images[0].cfId:""},x=O.map(w=>w.listingId===a.listingId?J:w);y(J),n([...x])},value:I.productData.name,options:[...N.filter($=>!s.find(O=>O.listingId===$.id)).map($=>$.productData.name)],leftAddon:S(a.image||I.productData.images.length>0&&I.productData.images[0].cfId||"")},f),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[d&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:$=>L($,a)})}),r&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter($=>$!==a))})})]})]});return _?t.jsxRuntimeExports.jsx(He,{product:a,children:z},a.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},a.listingId)},T=j.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:a=>e==null?void 0:e(a)})]}),E&&p&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:T,activeItem:p,setActiveItem:y,setIsOpenModal:P,popupPosition:k,itemsOptions:N}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:o}),_?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:g,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(a=>String(a.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((a,f)=>R(a,f))})}):s.map((a,f)=>R(a,f)),c&&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 a=[...s];for(let f=0;f<N.length;f++)if(!s.find(I=>I.listingId===N[f].id)){a.push({listingId:N[f].id,image:N[f].productData.images.length>0?N[f].productData.images[0].cfId:""});break}n(a)},disabled:s.length===N.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})]})})})]}),i&&m!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:m})]})},Ve="_options_6cemk_1",Ye="_price_6cemk_12",We="_oldPrice_6cemk_19",Ge="_newPrice_6cemk_27",Xe="_animate_6cemk_34",Je="_appearAndBounce_6cemk_1",Qe="_meta_6cemk_52",Ke="_info_6cemk_58",Ze="_infoRight_6cemk_66",ts="_buttons_6cemk_73",es="_variants_6cemk_80",ss="_variant_6cemk_80",ns="_stock_6cemk_98",is="_variantInfo_6cemk_105",os="_quantity_6cemk_111",as="_count_6cemk_118",rs="_focused_6cemk_135",cs="_button_6cemk_73",ls="_activeVariant_6cemk_161",ds="_chargeTypes_6cemk_165",us="_charge_6cemk_165",xs="_chargeActive_6cemk_190",ms="_title_6cemk_198",v={options:Ve,price:Ye,oldPrice:We,newPrice:Ge,animate:Xe,appearAndBounce:Je,meta:Qe,info:Ke,infoRight:Ze,buttons:ts,variants:es,variant:ss,stock:ns,variantInfo:is,quantity:os,count:as,focused:rs,button:cs,activeVariant:ls,chargeTypes:ds,charge:us,chargeActive:xs,title:ms};var et=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(et||{});const ps=l=>{var y,k;const{variants:i}=l,[e,s]=j.useState(i[0]),[n,m]=j.useState(e.chargeTypes[0]),u=t.useNavigate(),[o,d]=j.useState(1),{reset:_,addProductToCart:C}=t.gi(),[r,c]=j.useState(!1);j.useEffect(()=>{c(!0);const h=setTimeout(()=>c(!1),600);return()=>clearTimeout(h)},[o]);async function B(){await C({productId:l.id,productVariantId:e.id,quantity:o})}function N(){_(),B(),u("/checkout")}function p(h){if(h>=864e5){const S=Math.floor(h/864e5);return`${S} ${S===1?"day":"days"}`}else if(h>=36e5){const S=Math.floor(h/36e5);return`${S} ${S===1?"hour":"hours"}`}else if(h>=6e4){const S=Math.floor(h/6e4);return`${S} ${S===1?"minute":"minutes"}`}else{const S=Math.floor(h/1e3);return`${S} ${S===1?"second":"seconds"}`}}return j.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&d(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:v.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:v.chargeTypes,children:e.chargeTypes.map(h=>t.jsxRuntimeExports.jsx("div",{className:t.clx(v.charge,{[v.chargeActive]:n===h}),onClick:()=>m(h),children:et[h]},h))}),t.jsxRuntimeExports.jsx("div",{className:v.variants,children:i.map(h=>{var E;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(v.variant,{[v.activeVariant]:e.id===h.id}),onClick:()=>s(h),children:[t.jsxRuntimeExports.jsxs("div",{className:v.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:v.title,children:h.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",n==="ONE_TIME"?h.price.amount:h.subscriptionSettings?h.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:v.stock,children:[((E=h.quantity.restrictions)==null?void 0:E.max)||h.quantity.available||0," in stock"]})})]},h.id)})}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:v.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{o>1?d(h=>h-1):d(1)},className:v.button,disabled:e.quantity.available===0||e.quantity.restrictions&&o<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(o),onChange:h=>d(Number(h)),max:((y=e.quantity.restrictions)==null?void 0:y.max)||e.quantity.available||1/0,min:((k=e.quantity.restrictions)==null?void 0:k.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{d(h=>h+1)},className:v.button,disabled:!!(e.quantity.restrictions&&o>=e.quantity.restrictions.max||e.quantity.available!==void 0&&o>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:v.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:v.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:v.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":p(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:v.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:v.infoRight,children:n==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:v.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:r}),children:["$ ",(e.price.amount||0)*o]}),t.jsxRuntimeExports.jsxs("span",{className:v.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*o]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:r}),children:["$ ",(e.price.amount||0)*o]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:v.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:r}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:v.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:r}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:v.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>N(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:n==="ONE_TIME"?"Buy Now":"Subscribe Now"}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>B(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},js="_button_1tdo3_1",hs="_login_1tdo3_14",_s="_signUp_1tdo3_18",gs="_buttons_1tdo3_23",fs="_modal_1tdo3_32",Es="_closing_1tdo3_64",bs="_info_1tdo3_113",Rs="_top_1tdo3_120",vs="_title_1tdo3_131",ys="_clear_1tdo3_138",Is="_activeClear_1tdo3_145",Ss="_count_1tdo3_149",Ns="_cart_1tdo3_164",ks="_empty_1tdo3_172",Cs="_product_1tdo3_198",$s="_products_1tdo3_207",Bs="_image_1tdo3_215",ws="_productInfo_1tdo3_221",Ps="_content_1tdo3_228",Ms="_name_1tdo3_234",Ts="_price_1tdo3_240",qs="_productButtons_1tdo3_246",As="_productButton_1tdo3_246",Os="_productCount_1tdo3_266",Ls="_bottom_1tdo3_282",zs="_subtotal_1tdo3_290",Ds="_block_1tdo3_298",Us="_shoppingCount_1tdo3_305",Hs="_total_1tdo3_325",Fs="_link_1tdo3_331",Vs="_userInfo_1tdo3_338",Ys="_pagesMobileModal_1tdo3_349",Ws="_pagesMobileModalContent_1tdo3_363",Gs="_pagesMobileModalHeader_1tdo3_369",Xs="_pagesMobileModalFooter_1tdo3_379",b={button:js,login:hs,signUp:_s,buttons:gs,modal:fs,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:Es,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:bs,top:Rs,title:vs,clear:ys,activeClear:Is,count:Ss,cart:Ns,empty:ks,product:Cs,products:$s,image:Bs,productInfo:ws,content:Ps,name:Ms,price:Ts,productButtons:qs,productButton:As,productCount:Os,bottom:Ls,subtotal:zs,block:Ds,shoppingCount:Us,total:Hs,link:Fs,userInfo:Vs,pagesMobileModal:Ys,pagesMobileModalContent:Ws,pagesMobileModalHeader:Gs,pagesMobileModalFooter:Xs},Js=l=>{const{shopping:i,signUp:e,isShowUserInfo:s=!0}=l;return t.jsxRuntimeExports.jsxs("div",{className:b.buttons,children:[i&&t.jsxRuntimeExports.jsx(st,{}),s&&t.jsxRuntimeExports.jsx(Z,{signUp:e})]})},st=()=>{const[l,i]=j.useState(!1),[e,s]=j.useState([]),{cart:n}=t.gi();function m(_){var C;return!_||!(_!=null&&_.variants)?!1:(C=_.variants.find(r=>r.id===_.activeVariantId))==null?void 0:C.subscriptionSettings}const u=n.parts.length>0&&e.length>0&&!m(e[0]),[o,d]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10},onClick:_=>{_.stopPropagation(),window.location.pathname.includes("/admin/builder")||(i(!0),d(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),u&&t.jsxRuntimeExports.jsx("div",{className:b.shoppingCount,children:n.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{d(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(nt,{activeProducts:e,isCartNotEmpty:u,isOpen:o})})]})},nt=l=>{const{activeProducts:i,isCartNotEmpty:e,isOpen:s}=l,{cart:n,reset:m,getTotalAndDiscount:u,updateQuantityOfProduct:o}=t.gi(),d=t.useNavigate();function _(c){d(c)}function C(c){o({productId:c.id,productVariantId:c.activeVariantId,quantity:c.quantity+1})}function r(c){o({productId:c.id,productVariantId:c.activeVariantId,quantity:c.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(b.modal,{[b.closing]:!s}),onClick:c=>c.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:n.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(b.clear,{[b.activeClear]:e}),disabled:!e,onClick:m,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:b.cart,children:[t.jsxRuntimeExports.jsx("div",{className:b.products,children:i.map(c=>t.jsxRuntimeExports.jsxs("div",{className:b.product,children:[t.jsxRuntimeExports.jsxs("div",{className:b.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${c.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:b.image}),t.jsxRuntimeExports.jsxs("div",{className:b.content,children:[t.jsxRuntimeExports.jsx("div",{className:b.name,children:c.name}),t.jsxRuntimeExports.jsxs("div",{className:b.price,children:["$",c.variants.find(B=>B.id===c.activeVariantId).price.amount*((c==null?void 0:c.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{c.quantity!==1&&r(c)},className:b.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:b.productCount,children:c.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>C(c),className:b.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},c.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:["$",u().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>_("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(it,{})]})},it=()=>t.jsxRuntimeExports.jsxs("div",{className:b.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:b.link,children:"view products"})]})]}),Z=({signUp:l})=>{const i=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=i,s=t.useNavigate();function n(o){window.location.pathname.includes("/admin/builder")||s(o)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>n("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),l&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>n("/customer-dash"),type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[m,u]=j.useState("test-email@gmail.com");return j.useEffect(()=>{(async()=>{const d=t.jwtDecode(e);u(d.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:b.userInfo,onClick:()=>n("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:m||"test-email@gmail.com"})})},ot=({children:l,logo:i,setIsOpen:e,signUp:s})=>{const{setIsOpen:n}=t.useModalStore(),m=()=>{n(!1),setTimeout(()=>{e(!1),n(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:b.pagesMobileModal,onClick:u=>u.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:b.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:i}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:m,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:b.pagesMobileModalContent,children:l}),t.jsxRuntimeExports.jsx("div",{className:b.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(Z,{signUp:s})})]})},Qs=({children:l,logo:i,signUp:e})=>{const[s,n]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:n}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>n(!1),children:t.jsxRuntimeExports.jsx(ot,{logo:i,setIsOpen:n,signUp:e,children:l})})]})},at=l=>{const{setIsOpenModal:i}=l;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},Ks="_share_xddz7_1",Zs="_modal_xddz7_8",tn="_header_xddz7_20",en="_socials_xddz7_30",sn="_social_xddz7_30",nn="_copy_xddz7_40",on="_title_xddz7_47",an="_copyWrapper_xddz7_53",rn="_copyText_xddz7_62",cn="_copyTextMobile_xddz7_75",ln="_copyTextMiniMobile_xddz7_94",G={share:Ks,modal:Zs,header:tn,socials:en,social:sn,copy:nn,title:on,copyWrapper:an,copyText:rn,copyTextMobile:cn,copyTextMiniMobile:ln},dn=()=>{const{isOpenModal:l,setIsOpenModal:i}=t.useShareLinkStore();function e(){i(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:G.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:i,children:t.jsxRuntimeExports.jsx(un,{})})]})},un=()=>{const{setIsOpenModal:l}=t.useShareLinkStore(),{notification:i,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),n=window.location.href;function m(){navigator.clipboard.writeText(n),e({message:"Link copied to clipboard",status:"success"})}function u(){s(!1),setTimeout(()=>{l(!1),s(!0)},300)}function o(d,_){return d.length>_?d.slice(0,_)+"...":d}return t.jsxRuntimeExports.jsxs("div",{className:G.modal,onClick:d=>d.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsx("div",{className:G.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:u,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:G.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:m,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:G.copyText,children:o(n,100)}),t.jsxRuntimeExports.jsx("div",{className:G.copyTextMobile,children:o(n,40)}),t.jsxRuntimeExports.jsx("div",{className:G.copyTextMiniMobile,children:o(n,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:m,children:i?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},xn="_accordion_1s1lq_1",mn="_header_1s1lq_9",pn="_icon_1s1lq_18",jn="_open_1s1lq_21",hn="_content_1s1lq_25",Q={accordion:xn,header:mn,icon:pn,open:jn,content:hn},_n=({title:l,content:i,defaultOpen:e=!1})=>{const[s,n]=j.useState(e),[m,u]=j.useState(0),o=j.useRef(null),d=()=>{n(!s)};return j.useEffect(()=>{o.current&&u(s?o.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:Q.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,onClick:d,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(Q.icon,{[Q.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:o,className:Q.content,style:{height:`${m}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},gn=({children:l,path:i,className:e,target:s="_self",id:n})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:e,role:"link",style:{cursor:"pointer"},id:n,children:l});const m=t.useNavigate(),u=/^https?:\/\//.test(i),o=d=>{u||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.location.href=i:(d.preventDefault(),m(i,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:o,className:e,role:"link",style:{cursor:"pointer"},id:n,children:l})},fn="_buttonsBlock_1b2rb_1",En="_slideUp_1b2rb_1",bn={buttonsBlock:fn,slideUp:En},Rn=()=>t.jsxRuntimeExports.jsxs("div",{className:bn.buttonsBlock,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{width:"100%"},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",children:"Buy"})]}),vn="_wrapper_st58d_1",yn="_label_st58d_10",In="_textarea_st58d_18",Sn="_length_st58d_33",K={wrapper:vn,label:yn,textarea:In,length:Sn},Nn=l=>{const{onChange:i,label:e,value:s,maxLength:n,placeholder:m="Type something...",type:u="text"}=l,[o,d]=j.useState(s.length);function _(C){return u==="number"?C.replace(/[^\d\n]+/g,""):C}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:C=>{const r=_(C.target.value);d(r.length),i(r)},placeholder:m,className:K.textarea,maxLength:n}),n&&t.jsxRuntimeExports.jsxs("div",{className:K.length,children:[o,"/",n]})]})};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=_n;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=tt;exports.ButtonsSettings=Ue;exports.CategorySettings=Vt;exports.EmptyCart=it;exports.FormSettings=fe;exports.HeaderButtons=Js;exports.LayoutSettings=bt;exports.Link=gn;exports.ListingSelector=Fe;exports.PagesMobileMenu=Qs;exports.PagesMobileModal=ot;exports.PagesSettings=_e;exports.ProductCardButtons=Rn;exports.ProductOptions=ps;exports.ShareLink=dn;exports.ShoppingButton=st;exports.ShoppingModalCart=nt;exports.TextareaUI=Nn;exports.UserInfo=Z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CzZx3EyU.cjs"),j=require("react");require("@phosphor-icons/react");const rt="_wrapper_1vmyb_2",ct="_alignmentBlock_1vmyb_8",lt="_title_1vmyb_15",dt="_subtitle_1vmyb_22",ut="_alignmentContent_1vmyb_29",xt="_alignments_1vmyb_37",mt="_alignment_1vmyb_8",pt="_circle_1vmyb_60",jt="_paddings_1vmyb_67",ht="_padding_1vmyb_67",_t="_active_1vmyb_91",gt="_input_1vmyb_98",H={wrapper:rt,alignmentBlock:ct,title:lt,subtitle:dt,alignmentContent:ut,alignments:xt,alignment:mt,circle:pt,paddings:jt,padding:ht,active:_t,input:gt},ft=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],Et=["left","top","right","bottom"],bt=l=>{const{alignment:i,padding:e,setPadding:s,setAlignment:n}=l;function m(r){switch(r){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 u(r){switch(r){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}const[o,d]=j.useState(null),[_,C]=j.useState(null);return t.jsxRuntimeExports.jsxs("div",{className:H.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:H.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:H.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:H.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:H.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:H.alignments,children:ft.map(r=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{n(r)},className:H.alignment,onMouseEnter:()=>{d(r)},onMouseLeave:()=>{d(null)},children:[r!==i&&o!==r&&t.jsxRuntimeExports.jsx("div",{className:H.circle}),r!==i&&o===r&&t.jsxRuntimeExports.jsx(t.Icon,{name:m(o),fill:"#c2c2c2",width:22,height:22}),r===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:m(i),fill:"#FF3F19",width:22,height:22})]},r))}),t.jsxRuntimeExports.jsx("div",{className:H.paddings,children:Et.map(r=>t.jsxRuntimeExports.jsxs("label",{className:t.clx(H.padding,{[H.active]:_===r}),onFocus:()=>{C(r)},onBlur:()=>{C(null)},children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:u(r),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"number",value:String(e[r]),onChange:c=>s({...e,[r]:Math.min(Number(c),999)}),max:999,paddingless:!0,borderless:!0})]},r))})]})]})]})},Rt="_title_82zux_1",vt="_subtitle_82zux_5",yt="_header_82zux_12",It="_text_82zux_13",St="_productsBlock_82zux_14",Nt="_top_82zux_26",kt="_itemsBlock_82zux_35",Ct="_typeTexts_82zux_41",$t="_block_82zux_48",Bt="_active_82zux_61",wt="_products_82zux_14",Pt="_product_82zux_14",Mt="_button_82zux_80",Tt="_disabled_82zux_91",qt="_image_82zux_95",At="_info_82zux_102",Ot="_name_82zux_114",Lt="_buttons_82zux_118",zt="_modal_82zux_125",Dt="_link_82zux_145",Ut="_modalOptions_82zux_151",Ht="_addButton_82zux_157",Ft="_deleteButton_82zux_179",F={title:Rt,subtitle:vt,header:yt,text:It,productsBlock:St,top:Nt,itemsBlock:kt,typeTexts:Ct,block:$t,active:Bt,products:wt,product:Pt,button:Mt,disabled:Tt,image:qt,info:At,name:Ot,buttons:Lt,modal:zt,link:Dt,modalOptions:Ut,addButton:Ht,deleteButton:Ft},Vt=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,other:m,title:u,subtitle:o,draggable:d=!1,withImage:_=!1,addable:C=!0,itemsOptions:r,hasRangeSelector:c=!1,rangeSelectorOptions:B,limit:N,autoScrollInterval:p,deletable:y}=l;function k(E){if(_)return E?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${E[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const h=(E,P=!1)=>{const M=r.find(S=>S.id===E);if(!M)return;const L=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Select,{onChange:S=>{const g=[...s],R=r.find(f=>f.name===S);if(!R)return;const T=R.id,a=g.map(f=>f===E?T:f);n([...a])},value:M.name,options:r.filter(S=>!s.find(g=>g===S.id)).map(S=>S.name),leftAddon:k(M.images)}),P&&t.jsxRuntimeExports.jsx("div",{className:F.buttons,children:t.jsxRuntimeExports.jsx("div",{className:F.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(S=>S!==E))})})})]});return t.jsxRuntimeExports.jsx("div",{className:F.product,children:L},E)};return t.jsxRuntimeExports.jsxs("div",{className:F.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:F.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:F.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:E=>e==null?void 0:e(E)})]}),c&&B&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...B}),t.jsxRuntimeExports.jsxs("div",{className:F.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:F.subtitle,children:o}),s.map(E=>h(E,y)),C&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",gap:5},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(F.button,{[F.disabled]:!!(N&&N<=s.length||s.length===r.length)}),size:"s",disabled:!!(N&&N<=s.length||s.length===r.length),onClick:()=>{const E=[...s];let P=null;if(r){for(let M=0;M<r.length;M++)if(!s.find(L=>L===r[M].id)){P=r[M];break}}E.push((P==null?void 0:P.id)||r[0].id),n(E)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:F.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]}),m!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:m}),p!==void 0&&t.jsxRuntimeExports.jsx(t.Input,{label:"Auto scroll interval",type:"number",value:String(p.scrollInterval),onChange:E=>p.setScrollInterval(Number(E)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},Yt="_title_roi3a_1",Wt="_subtitle_roi3a_5",Gt="_header_roi3a_12",Xt="_text_roi3a_13",Jt="_productsBlock_roi3a_14",Qt="_top_roi3a_26",Kt="_itemsBlock_roi3a_35",Zt="_typeTexts_roi3a_41",te="_block_roi3a_48",ee="_active_roi3a_61",se="_products_roi3a_14",ne="_product_roi3a_14",ie="_button_roi3a_80",oe="_disabled_roi3a_91",ae="_image_roi3a_95",re="_info_roi3a_102",ce="_name_roi3a_114",le="_buttons_roi3a_118",de="_modal_roi3a_125",ue="_link_roi3a_145",xe="_modalOptions_roi3a_151",me="_addButton_roi3a_164",pe="_deleteButton_roi3a_179",je="_closeIcon_roi3a_191",D={title:Yt,subtitle:Wt,header:Gt,text:Xt,productsBlock:Jt,top:Qt,itemsBlock:Kt,typeTexts:Zt,block:te,active:ee,products:se,product:ne,button:ie,disabled:oe,image:ae,info:re,name:ce,buttons:le,modal:de,link:ue,modalOptions:xe,addButton:me,deleteButton:pe,closeIcon:je};function he({product:l,children:i}){const{attributes:e,listeners:s,setNodeRef:n,transform:m,transition:u,isDragging:o}=t.useSortable({id:l.id}),d={transform:t.CSS.Transform.toString(m),transition:u};return t.jsxRuntimeExports.jsx("div",{ref:n,style:d,className:`${D.product} ${o?D.dragging:""}`,...e,...s,children:i})}const _e=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,title:m,subtitle:u,editable:o=!0,draggable:d=!1,deletable:_=!0,addable:C=!0,itemsType:r,itemsOptions:c,addableOptions:B={},limit:N}=l,[p,y]=j.useState(null),[k,h]=j.useState(null),E=j.useRef(null),P=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{if(p){const g=[...s].map(R=>R.id===p.id?p:R);n(g)}},[p]),j.useEffect(()=>{E.current&&k&&(E.current.getBoundingClientRect().height,k.top)},[E.current,k]);const M=(g,R)=>{g.stopPropagation();const T=g.target.getBoundingClientRect();h({top:T.top+window.scrollY,left:T.left-30}),y(R)},L=g=>{const{active:R,over:T}=g;if(T&&R.id!==T.id){const a=s.findIndex(I=>I.id===R.id),f=s.findIndex(I=>I.id===T.id);if(a!==-1&&f!==-1){const I=[...s],[z]=I.splice(a,1);I.splice(f,0,z),n(I)}}},S=(g,R)=>{const T=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[d&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),r==="select"&&c&&t.jsxRuntimeExports.jsx(t.Select,{onChange:a=>{const f=[...s],I=c.find($=>$.name===a);if(!I)return;const z=f.map($=>$.id===g.id?{...I,name:{"en-US":a}}:$);y({...g,name:{"en-US":a}}),n([...z])},value:g.name,options:c.filter(a=>!s.find(f=>f.name===a.name)).map(a=>a.name)}),t.jsxRuntimeExports.jsxs("div",{className:D.buttons,children:[o&&t.jsxRuntimeExports.jsx("div",{className:D.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:a=>M(a,g)})}),_&&t.jsxRuntimeExports.jsx("div",{className:D.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter(a=>a.id!==g.id))})})]})]});return d?t.jsxRuntimeExports.jsx(he,{product:g,index:R,children:T},g.id):t.jsxRuntimeExports.jsx("div",{className:D.product,children:T},g.id)};return t.jsxRuntimeExports.jsxs("div",{className:D.productsBlock,children:[(m||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:D.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:D.title,children:m}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:g=>e==null?void 0:e(g)})]}),t.jsxRuntimeExports.jsxs("div",{className:D.products,children:[u&&t.jsxRuntimeExports.jsx("h5",{className:D.subtitle,children:u}),d?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:P,onDragEnd:L,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(g=>g.id),strategy:t.verticalListSortingStrategy,children:s.map((g,R)=>S(g,R))})}):s.map((g,R)=>S(g,R)),C&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:t.clx(D.button,{[D.disabled]:!!(N&&N<=s.length||s.length===(c==null?void 0:c.length))}),size:"s",disabled:!!(N&&N<=s.length||s.length===(c==null?void 0:c.length)),onClick:()=>{const g=[...s];let R=null;if(c){for(let T=0;T<c.length;T++)if(!s.find(a=>a.id===c[T].id)){R=c[T];break}}r==="select"&&c&&g.push({name:R?R.name:c[0].name,id:(R==null?void 0:R.id)||c[0].id,...B}),n(g)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:D.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})]})};function ge(l){const{product:i,children:e}=l,{attributes:s,listeners:n,setNodeRef:m,transform:u,transition:o,isDragging:d}=t.useSortable({id:i.id}),_={transform:t.CSS.Transform.toString(u),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:m,style:_,className:`${t.styles.product} ${d?t.styles.dragging:""}`,...s,...n,children:e})}const fe=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,other:m,title:u,subtitle:o,editable:d=!0,draggable:_=!1,withImage:C=!1,deletable:r=!0,addable:c=!0,itemsType:B,itemsPlaceholder:N="",itemsOptions:p,hasRangeSelector:y=!1,rangeSelectorOptions:k,modalOptions:h,addableOptions:E={},limit:P}=l,[M,L]=j.useState(null),[S,g]=j.useState({top:0,left:0}),[R,T]=j.useState(null),a=j.useRef(null),[f,I]=j.useState(!1),z=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const x=()=>{L(null),I(!1)};return document.body.addEventListener("click",x),L(null),I(!1),()=>{L(null),I(!1),document.body.removeEventListener("click",x)}},[]),j.useEffect(()=>{if(M){const x=[...s].map(w=>w.id===M.id?M:w);n(x)}},[M]),j.useEffect(()=>{if(a.current&&R){const x=a.current.getBoundingClientRect().height,w=window.innerHeight;let q=R.top;q+x>w+window.scrollY-200&&(q=w+window.scrollY-x-200),q<0&&(q=10),g({top:q,left:R.left})}},[a.current,R]);const $=(x,w)=>{x.stopPropagation();const q=x.target.getBoundingClientRect();T({top:q.top+window.scrollY,left:q.left-30}),L(w),I(!0)};function O(x){if(C)return x?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${x[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const Y=x=>{const{active:w,over:q}=x;if(q&&w.id!==q.id){const A=s.findIndex(U=>U.id===w.id),X=s.findIndex(U=>U.id===q.id);if(A!==-1&&X!==-1){const U=[...s],[V]=U.splice(A,1);U.splice(X,0,V),n(U)}}},J=x=>{var q;const w=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[_&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),B==="select"&&p&&t.jsxRuntimeExports.jsx(t.Select,{onChange:A=>{const U=[...s].map(V=>V.id===x.id?{...x,name:{"en-US":A}}:V);L({...x,name:{"en-US":A}}),n([...U])},value:x.name["en-US"],options:p.filter(A=>!s.find(X=>X.name["en-US"]===A)),leftAddon:O(x.images)}),B==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:A=>{const U=[...s].map(V=>V.id===x.id?{...x,name:{"en-US":A}}:V);n([...U])},value:x.name["en-US"],placeholder:N}),B==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:A=>{const U=[...s].map(V=>V.id===x.id?{...x,images:A}:V);n([...U])},activeImage:(q=s.find(A=>A.id===x.id))==null?void 0:q.images[0]}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.buttons,children:[d&&t.jsxRuntimeExports.jsx("div",{className:t.styles.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:A=>$(A,x)})}),r&&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:()=>n(s.filter(A=>A.id!==x.id))})})]})]});return _?t.jsxRuntimeExports.jsx(ge,{product:x,children:w},x.id):t.jsxRuntimeExports.jsx("div",{className:t.styles.product,children:w},x.id)};return t.jsxRuntimeExports.jsxs("div",{className:t.styles.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:t.styles.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:x=>e==null?void 0:e(x)})]}),M&&d&&h&&f&&t.jsxRuntimeExports.jsx(t.ItemPopup,{ref:a,activeItem:M,setActiveItem:L,popupPosition:S,modalOptions:h,setIsOpenModal:I}),y&&k&&t.jsxRuntimeExports.jsx(t.RangeSelector,{...k}),t.jsxRuntimeExports.jsxs("div",{className:t.styles.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:t.styles.subtitle,children:o}),_?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:z,onDragEnd:Y,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(x=>x.id),strategy:t.verticalListSortingStrategy,children:s.map(x=>J(x))})}):s.map(x=>J(x)),c&&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]:!!(P&&P<=s.length)}),size:"s",disabled:!!(P&&P<=s.length),onClick:()=>{const x=[...s];let w=null;if(p){for(let q=0;q<p.length;q++)if(!s.find(A=>A.name["en-US"]===p[q])){w=p[q];break}}B==="select"&&p?x.push({name:{"en-US":w||p[0]},id:t.v4(),...E,maxSymbols:100}):B==="input"?x.push({name:{"en-US":""},id:t.v4(),...E,maxSymbols:100}):x.push({name:{"en-US":`Image ${s.length+1}`},id:t.v4(),...E,maxSymbols:100}),n(x)},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})]})})})]}),m!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:m})]})},Ee="_subtitle_jql1y_1",be="_header_jql1y_8",Re="_text_jql1y_9",ve="_productsBlock_jql1y_10",ye="_buttonsBlock_jql1y_11",Ie="_top_jql1y_23",Se="_itemsBlock_jql1y_32",Ne="_typeTexts_jql1y_38",ke="_block_jql1y_45",Ce="_active_jql1y_58",$e="_products_jql1y_10",Be="_product_jql1y_10",we="_button_jql1y_11",Pe="_image_jql1y_88",Me="_info_jql1y_95",Te="_name_jql1y_107",qe="_buttons_jql1y_11",Ae="_modal_jql1y_118",Oe="_other_jql1y_138",Le="_options_jql1y_144",ze="_addButton_jql1y_150",De="_deleteButton_jql1y_165",W={subtitle:Ee,header:be,text:Re,productsBlock:ve,buttonsBlock:ye,top:Ie,itemsBlock:Se,typeTexts:Ne,block:ke,active:Ce,products:$e,product:Be,button:we,image:Pe,info:Me,name:Te,buttons:qe,modal:Ae,other:Oe,options:Le,addButton:ze,deleteButton:De},tt=l=>{const{buttons:i,setButtons:e,deletable:s=!0,addable:n=!0,editableLink:m=!0}=l,{pages:u}=t.usePagesStore(),[o,d]=j.useState(null),[_,C]=j.useState({top:0,left:0}),[r,c]=j.useState(null),B=j.useRef(null);j.useEffect(()=>{if(o){const p=[...i].map(y=>y.id===o.id?o:y);e(p)}},[o]),j.useEffect(()=>{if(B.current&&r){const p=B.current.getBoundingClientRect().height,y=window.innerHeight;let k=r.top;k+p>y+window.scrollY-200&&(k=y+window.scrollY-p-200),k<0&&(k=10),C({top:k,left:r.left})}},[B.current,r]);const N=(p,y)=>{p.stopPropagation();const k=p.target.getBoundingClientRect();c({top:k.top+window.scrollY-70,left:k.left-(n?30:65)}),d(y)};return t.jsxRuntimeExports.jsxs("div",{className:W.products,children:[t.jsxRuntimeExports.jsx("h5",{className:W.subtitle,children:"Button Type"}),i.map(p=>t.jsxRuntimeExports.jsxs("div",{className:W.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const h=[...i].map(E=>E.id===p.id?{...p,type:y}:E);e(h)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:W.buttons,children:[t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>{N(y,p)}})}),s&&t.jsxRuntimeExports.jsx("div",{className:W.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const y=i.filter(k=>k.id!==p.id);e(y)},width:20,height:20,fill:"#C12A2A"})})]})]},p.id)),o&&t.jsxRuntimeExports.jsx(t.ButtonPopup,{ref:B,activeButton:o,setActiveButton:d,popupPosition:_,editableLink:m}),n&&t.jsxRuntimeExports.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:t.jsxRuntimeExports.jsx(t.Button,{withoutHover:!0,className:W.button,size:"s",onClick:()=>{const p=[...i];m?p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Button Name"},destination:"Go to Page",page:u?Object.values(u)[0].name:"Home",openInNewTab:!1}):p.push({type:"Primary",id:t.v4(),typesText:[],text:{"en-US":"Create Ticket"},destination:"Go to Page",page:u?Object.values(u)[0].name:"Home",openInNewTab:!1}),e(p)},style:{width:"fit-content"},children:t.jsxRuntimeExports.jsxs("div",{className:W.addButton,children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})})})]})},Ue=l=>{const{isActiveButtons:i,setIsActiveButtons:e,buttons:s,setButtons:n,editableLink:m=!0,addable:u=!0,deletable:o=!0}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:t.styles$1.top,children:[t.jsxRuntimeExports.jsx("h3",{className:t.styles$1.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:d=>e(d)})]}),i&&t.jsxRuntimeExports.jsx(tt,{buttons:s,setButtons:n,editableLink:m,addable:u,deletable:o})]})})};function He(l){const{product:i,children:e}=l,{attributes:s,listeners:n,setNodeRef:m,transform:u,transition:o,isDragging:d}=t.useSortable({id:String(i.listingId)}),_={transform:t.CSS.Transform.toString(u),transition:o};return t.jsxRuntimeExports.jsx("div",{ref:m,style:_,className:`${t.styles$2.product} ${d?t.styles$2.dragging:""}`,...s,...n,children:e})}const Fe=l=>{const{isActiveItems:i,setIsActiveItems:e,items:s,setItems:n,other:m,title:u,subtitle:o,editable:d=!0,draggable:_=!1,withImage:C=!1,deletable:r=!0,addable:c=!0,itemsType:B,itemsOptions:N}=l,[p,y]=j.useState(null),[k,h]=j.useState({top:0,left:0}),[E,P]=j.useState(!1),M=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:5}}));j.useEffect(()=>{const a=()=>{y(null),P(!1)};return document.body.addEventListener("click",a),y(null),P(!1),()=>{y(null),P(!1),document.body.removeEventListener("click",a)}},[]),j.useEffect(()=>{if(p){const a=[...s].map(f=>f.listingId===p.listingId?p:f);n(a)}},[p]);const L=(a,f)=>{a.stopPropagation();const I=a.target.getBoundingClientRect(),z=100,$=window.innerHeight;let O=I.top+window.scrollY;O+z>$&&(O=$-z-20),P(!0),h({top:O-80,left:I.left-30}),y(f)};function S(a){if(C)return a?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${a}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const g=a=>{const{active:f,over:I}=a;if(I&&f.id!==I.id){const z=s.findIndex(O=>String(O.listingId)===f.id),$=s.findIndex(O=>String(O.listingId)===I.id);if(z!==-1&&$!==-1){const O=[...s],[Y]=O.splice(z,1);O.splice($,0,Y),n(O)}}},R=(a,f)=>{const I=N.find($=>a.listingId===$.id);if(!I)return null;const z=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[_&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),B==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:$=>{const O=[...s],Y=N.find(w=>w.productData.name===$);if(!Y)return;const J={listingId:Y.id,image:Y.productData.images.length>0?Y.productData.images[0].cfId:""},x=O.map(w=>w.listingId===a.listingId?J:w);y(J),n([...x])},value:I.productData.name,options:[...N.filter($=>!s.find(O=>O.listingId===$.id)).map($=>$.productData.name)],leftAddon:S(a.image||I.productData.images.length>0&&I.productData.images[0].cfId||"")},f),t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.buttons,children:[d&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:$=>L($,a)})}),r&&t.jsxRuntimeExports.jsx("div",{className:t.styles$2.deleteButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>n(s.filter($=>$!==a))})})]})]});return _?t.jsxRuntimeExports.jsx(He,{product:a,children:z},a.listingId):t.jsxRuntimeExports.jsx("div",{className:t.styles$2.product,children:z},a.listingId)},T=j.useRef(null);return t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.productsBlock,children:[(u||i!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.top,children:[u&&t.jsxRuntimeExports.jsx("h3",{className:t.styles$2.title,children:u}),i!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:a=>e==null?void 0:e(a)})]}),E&&p&&t.jsxRuntimeExports.jsx(t.ListingPopup,{ref:T,activeItem:p,setActiveItem:y,setIsOpenModal:P,popupPosition:k,itemsOptions:N}),i&&t.jsxRuntimeExports.jsxs("div",{className:t.styles$2.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:t.styles$2.subtitle,children:o}),_?t.jsxRuntimeExports.jsx(t.DndContext,{sensors:M,onDragEnd:g,children:t.jsxRuntimeExports.jsx(t.SortableContext,{items:s.map(a=>String(a.listingId)),strategy:t.verticalListSortingStrategy,children:s.map((a,f)=>R(a,f))})}):s.map((a,f)=>R(a,f)),c&&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 a=[...s];for(let f=0;f<N.length;f++)if(!s.find(I=>I.listingId===N[f].id)){a.push({listingId:N[f].id,image:N[f].productData.images.length>0?N[f].productData.images[0].cfId:""});break}n(a)},disabled:s.length===N.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})]})})})]}),i&&m!==void 0&&t.jsxRuntimeExports.jsx(t.OtherSettings,{items:m})]})},Ve="_options_6cemk_1",Ye="_price_6cemk_12",We="_oldPrice_6cemk_19",Ge="_newPrice_6cemk_27",Xe="_animate_6cemk_34",Je="_appearAndBounce_6cemk_1",Qe="_meta_6cemk_52",Ke="_info_6cemk_58",Ze="_infoRight_6cemk_66",ts="_buttons_6cemk_73",es="_variants_6cemk_80",ss="_variant_6cemk_80",ns="_stock_6cemk_98",is="_variantInfo_6cemk_105",os="_quantity_6cemk_111",as="_count_6cemk_118",rs="_focused_6cemk_135",cs="_button_6cemk_73",ls="_activeVariant_6cemk_161",ds="_chargeTypes_6cemk_165",us="_charge_6cemk_165",xs="_chargeActive_6cemk_190",ms="_title_6cemk_198",v={options:Ve,price:Ye,oldPrice:We,newPrice:Ge,animate:Xe,appearAndBounce:Je,meta:Qe,info:Ke,infoRight:Ze,buttons:ts,variants:es,variant:ss,stock:ns,variantInfo:is,quantity:os,count:as,focused:rs,button:cs,activeVariant:ls,chargeTypes:ds,charge:us,chargeActive:xs,title:ms};var et=(l=>(l.ONE_TIME="One-Time",l.RECURRING="Subscribe & Save",l))(et||{});const ps=l=>{var y,k;const{variants:i}=l,[e,s]=j.useState(i[0]),[n,m]=j.useState(e.chargeTypes[0]),u=t.useNavigate(),[o,d]=j.useState(1),{reset:_,addProductToCart:C}=t.ui(),[r,c]=j.useState(!1);j.useEffect(()=>{c(!0);const h=setTimeout(()=>c(!1),600);return()=>clearTimeout(h)},[o]);async function B(){await C({productId:l.id,productVariantId:e.id,quantity:o})}function N(){_(),B(),u("/checkout")}function p(h){if(h>=864e5){const S=Math.floor(h/864e5);return`${S} ${S===1?"day":"days"}`}else if(h>=36e5){const S=Math.floor(h/36e5);return`${S} ${S===1?"hour":"hours"}`}else if(h>=6e4){const S=Math.floor(h/6e4);return`${S} ${S===1?"minute":"minutes"}`}else{const S=Math.floor(h/1e3);return`${S} ${S===1?"second":"seconds"}`}}return j.useEffect(()=>{(e.quantity.available===0||!e.quantity.available)&&d(0)},[e.quantity.available]),t.jsxRuntimeExports.jsxs("div",{className:v.options,children:[e.chargeTypes.length>1&&t.jsxRuntimeExports.jsx("div",{className:v.chargeTypes,children:e.chargeTypes.map(h=>t.jsxRuntimeExports.jsx("div",{className:t.clx(v.charge,{[v.chargeActive]:n===h}),onClick:()=>m(h),children:et[h]},h))}),t.jsxRuntimeExports.jsx("div",{className:v.variants,children:i.map(h=>{var E;return t.jsxRuntimeExports.jsxs("div",{className:t.clx(v.variant,{[v.activeVariant]:e.id===h.id}),onClick:()=>s(h),children:[t.jsxRuntimeExports.jsxs("div",{className:v.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:v.title,children:h.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",n==="ONE_TIME"?h.price.amount:h.subscriptionSettings?h.subscriptionSettings.price.amount:"Price Not Found"]})]}),t.jsxRuntimeExports.jsx("div",{children:n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("span",{className:v.stock,children:[((E=h.quantity.restrictions)==null?void 0:E.max)||h.quantity.available||0," in stock"]})})]},h.id)})}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsxs("div",{className:v.quantity,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{o>1?d(h=>h-1):d(1)},className:v.button,disabled:e.quantity.available===0||e.quantity.restrictions&&o<=e.quantity.restrictions.min||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx(t.Input$1,{type:"number",value:String(o),onChange:h=>d(Number(h)),max:((y=e.quantity.restrictions)==null?void 0:y.max)||e.quantity.available||1/0,min:((k=e.quantity.restrictions)==null?void 0:k.min)||0,centered:!0,disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>{d(h=>h+1)},className:v.button,disabled:!!(e.quantity.restrictions&&o>=e.quantity.restrictions.max||e.quantity.available!==void 0&&o>=e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:v.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:v.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:v.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":p(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:v.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:v.infoRight,children:n==="ONE_TIME"?e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:v.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:r}),children:["$ ",(e.price.amount||0)*o]}),t.jsxRuntimeExports.jsxs("span",{className:v.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*o]})]}):t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:r}),children:["$ ",(e.price.amount||0)*o]}):e.subscriptionSettings&&e.subscriptionSettings.compareAtPrice&&(e.subscriptionSettings.compareAtPrice.amount||0)-(e.subscriptionSettings.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:v.price,children:[t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:r}),children:["$ ",e.subscriptionSettings.price.amount||0]}),t.jsxRuntimeExports.jsxs("span",{className:v.oldPrice,children:["$ ",e.subscriptionSettings.compareAtPrice.amount||0]})]}):e.subscriptionSettings&&t.jsxRuntimeExports.jsxs("span",{className:t.clx(v.newPrice,{[v.animate]:r}),children:["$ ",e.subscriptionSettings.price.amount||0]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:v.buttons,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",onClick:()=>N(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:n==="ONE_TIME"?"Buy Now":"Subscribe Now"}),n==="ONE_TIME"&&t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:()=>B(),disabled:e.quantity.available===0||!e.quantity.available||Object.keys(e.quantity.restrictions||{}).length===0&&!e.quantity.available,children:"Add to Cart"})]})]})},js="_button_1tdo3_1",hs="_login_1tdo3_14",_s="_signUp_1tdo3_18",gs="_buttons_1tdo3_23",fs="_modal_1tdo3_32",Es="_closing_1tdo3_64",bs="_info_1tdo3_113",Rs="_top_1tdo3_120",vs="_title_1tdo3_131",ys="_clear_1tdo3_138",Is="_activeClear_1tdo3_145",Ss="_count_1tdo3_149",Ns="_cart_1tdo3_164",ks="_empty_1tdo3_172",Cs="_product_1tdo3_198",$s="_products_1tdo3_207",Bs="_image_1tdo3_215",ws="_productInfo_1tdo3_221",Ps="_content_1tdo3_228",Ms="_name_1tdo3_234",Ts="_price_1tdo3_240",qs="_productButtons_1tdo3_246",As="_productButton_1tdo3_246",Os="_productCount_1tdo3_266",Ls="_bottom_1tdo3_282",zs="_subtotal_1tdo3_290",Ds="_block_1tdo3_298",Us="_shoppingCount_1tdo3_305",Hs="_total_1tdo3_325",Fs="_link_1tdo3_331",Vs="_userInfo_1tdo3_338",Ys="_pagesMobileModal_1tdo3_349",Ws="_pagesMobileModalContent_1tdo3_363",Gs="_pagesMobileModalHeader_1tdo3_369",Xs="_pagesMobileModalFooter_1tdo3_379",b={button:js,login:hs,signUp:_s,buttons:gs,modal:fs,"slide-in-fade":"_slide-in-fade_1tdo3_1","mobile-slide-in-fade":"_mobile-slide-in-fade_1tdo3_1",closing:Es,"mobile-slide-out-fade":"_mobile-slide-out-fade_1tdo3_1","slide-out-fade":"_slide-out-fade_1tdo3_1",info:bs,top:Rs,title:vs,clear:ys,activeClear:Is,count:Ss,cart:Ns,empty:ks,product:Cs,products:$s,image:Bs,productInfo:ws,content:Ps,name:Ms,price:Ts,productButtons:qs,productButton:As,productCount:Os,bottom:Ls,subtotal:zs,block:Ds,shoppingCount:Us,total:Hs,link:Fs,userInfo:Vs,pagesMobileModal:Ys,pagesMobileModalContent:Ws,pagesMobileModalHeader:Gs,pagesMobileModalFooter:Xs},Js=l=>{const{shopping:i,signUp:e,isShowUserInfo:s=!0}=l;return t.jsxRuntimeExports.jsxs("div",{className:b.buttons,children:[i&&t.jsxRuntimeExports.jsx(st,{}),s&&t.jsxRuntimeExports.jsx(Z,{signUp:e})]})},st=()=>{const[l,i]=j.useState(!1),[e,s]=j.useState([]),{cart:n}=t.ui();function m(_){var C;return!_||!(_!=null&&_.variants)?!1:(C=_.variants.find(r=>r.id===_.activeVariantId))==null?void 0:C.subscriptionSettings}const u=n.parts.length>0&&e.length>0&&!m(e[0]),[o,d]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs(t.Button$1,{type:"Secondary",style:{padding:10},onClick:_=>{_.stopPropagation(),window.location.pathname.includes("/admin/builder")||(i(!0),d(!0))},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-primary)"}),u&&t.jsxRuntimeExports.jsx("div",{className:b.shoppingCount,children:n.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>{d(!1),setTimeout(()=>{i(!1)},300)},withAnimation:!1,children:t.jsxRuntimeExports.jsx(nt,{activeProducts:e,isCartNotEmpty:u,isOpen:o})})]})},nt=l=>{const{activeProducts:i,isCartNotEmpty:e,isOpen:s}=l,{cart:n,reset:m,getTotalAndDiscount:u,updateQuantityOfProduct:o}=t.ui(),d=t.useNavigate();function _(c){d(c)}function C(c){o({productId:c.id,productVariantId:c.activeVariantId,quantity:c.quantity+1})}function r(c){o({productId:c.id,productVariantId:c.activeVariantId,quantity:c.quantity-1})}return t.jsxRuntimeExports.jsxs("div",{className:t.clx(b.modal,{[b.closing]:!s}),onClick:c=>c.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:n.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(b.clear,{[b.activeClear]:e}),disabled:!e,onClick:m,children:"Clear all"})]}),e?t.jsxRuntimeExports.jsxs("div",{className:b.cart,children:[t.jsxRuntimeExports.jsx("div",{className:b.products,children:i.map(c=>t.jsxRuntimeExports.jsxs("div",{className:b.product,children:[t.jsxRuntimeExports.jsxs("div",{className:b.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${c.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:b.image}),t.jsxRuntimeExports.jsxs("div",{className:b.content,children:[t.jsxRuntimeExports.jsx("div",{className:b.name,children:c.name}),t.jsxRuntimeExports.jsxs("div",{className:b.price,children:["$",c.variants.find(B=>B.id===c.activeVariantId).price.amount*((c==null?void 0:c.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:b.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{c.quantity!==1&&r(c)},className:b.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:b.productCount,children:c.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>C(c),className:b.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},c.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:["$",u().total]})]}),t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>_("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(it,{})]})},it=()=>t.jsxRuntimeExports.jsxs("div",{className:b.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"var(--icon-secondary)"})}),t.jsxRuntimeExports.jsx("span",{children:"Empty Cart"}),t.jsxRuntimeExports.jsxs("span",{children:["You don’t have any items in your shopping cart yet,"," ",t.jsxRuntimeExports.jsx("a",{href:"/products",className:b.link,children:"view products"})]})]}),Z=({signUp:l})=>{const i=JSON.parse(localStorage.getItem("token")||"{}"),{data:e}=i,s=t.useNavigate();function n(o){window.location.pathname.includes("/admin/builder")||s(o)}if(!e)return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>n("/customer-dash"),type:"Secondary",style:{padding:10},children:"Login"}),l&&t.jsxRuntimeExports.jsx(t.Button$1,{onClick:()=>n("/customer-dash"),type:"Primary",style:{padding:10,whiteSpace:"nowrap"},children:"Sign Up"})]});const[m,u]=j.useState("test-email@gmail.com");return j.useEffect(()=>{(async()=>{const d=t.jwtDecode(e);u(d.email)})()},[e]),t.jsxRuntimeExports.jsx("div",{className:b.userInfo,onClick:()=>n("/customer-dash"),children:t.jsxRuntimeExports.jsx("div",{children:m||"test-email@gmail.com"})})},ot=({children:l,logo:i,setIsOpen:e,signUp:s})=>{const{setIsOpen:n}=t.useModalStore(),m=()=>{n(!1),setTimeout(()=>{e(!1),n(!0)},300)};return t.jsxRuntimeExports.jsxs("div",{className:b.pagesMobileModal,onClick:u=>u.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:b.pagesMobileModalHeader,children:[t.jsxRuntimeExports.jsx("div",{children:i}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",onClick:m,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"var(--icon-primary)"})})]}),t.jsxRuntimeExports.jsx("div",{className:b.pagesMobileModalContent,children:l}),t.jsxRuntimeExports.jsx("div",{className:b.pagesMobileModalFooter,children:t.jsxRuntimeExports.jsx(Z,{signUp:s})})]})},Qs=({children:l,logo:i,signUp:e})=>{const[s,n]=j.useState(!1);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(at,{setIsOpenModal:n}),s&&t.jsxRuntimeExports.jsx(t.Modal,{close:()=>n(!1),children:t.jsxRuntimeExports.jsx(ot,{logo:i,setIsOpen:n,signUp:e,children:l})})]})},at=l=>{const{setIsOpenModal:i}=l;return t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",style:{padding:10},onClick:e=>{e.stopPropagation(),i(!0)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:"List",fill:"var(--icon-primary)"})})},Ks="_share_xddz7_1",Zs="_modal_xddz7_8",tn="_header_xddz7_20",en="_socials_xddz7_30",sn="_social_xddz7_30",nn="_copy_xddz7_40",on="_title_xddz7_47",an="_copyWrapper_xddz7_53",rn="_copyText_xddz7_62",cn="_copyTextMobile_xddz7_75",ln="_copyTextMiniMobile_xddz7_94",G={share:Ks,modal:Zs,header:tn,socials:en,social:sn,copy:nn,title:on,copyWrapper:an,copyText:rn,copyTextMobile:cn,copyTextMiniMobile:ln},dn=()=>{const{isOpenModal:l,setIsOpenModal:i}=t.useShareLinkStore();function e(){i(!0)}return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(t.Button,{className:G.share,onClick:s=>{s.stopPropagation(),e()},type:"Secondary",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Share",fill:"#757575",hoverable:!0})}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:i,children:t.jsxRuntimeExports.jsx(un,{})})]})},un=()=>{const{setIsOpenModal:l}=t.useShareLinkStore(),{notification:i,setNotification:e}=t.useNotificationStore(),{setIsOpen:s}=t.useModalStore(),n=window.location.href;function m(){navigator.clipboard.writeText(n),e({message:"Link copied to clipboard",status:"success"})}function u(){s(!1),setTimeout(()=>{l(!1),s(!0)},300)}function o(d,_){return d.length>_?d.slice(0,_)+"...":d}return t.jsxRuntimeExports.jsxs("div",{className:G.modal,onClick:d=>d.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:G.header,children:[t.jsxRuntimeExports.jsx("div",{className:G.title,children:"Copy Product Link"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",fill:"#757575",onClick:u,hoverable:!0})]}),t.jsxRuntimeExports.jsxs("div",{className:G.copyWrapper,children:[t.jsxRuntimeExports.jsxs(t.Button,{type:"Secondary",onClick:m,style:{flex:1},children:[t.jsxRuntimeExports.jsx("div",{className:G.copyText,children:o(n,100)}),t.jsxRuntimeExports.jsx("div",{className:G.copyTextMobile,children:o(n,40)}),t.jsxRuntimeExports.jsx("div",{className:G.copyTextMiniMobile,children:o(n,20)})]}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:m,children:i?t.jsxRuntimeExports.jsx(t.Icon,{name:"Check"}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Copy"})})]})]})},xn="_accordion_1s1lq_1",mn="_header_1s1lq_9",pn="_icon_1s1lq_18",jn="_open_1s1lq_21",hn="_content_1s1lq_25",Q={accordion:xn,header:mn,icon:pn,open:jn,content:hn},_n=({title:l,content:i,defaultOpen:e=!1})=>{const[s,n]=j.useState(e),[m,u]=j.useState(0),o=j.useRef(null),d=()=>{n(!s)};return j.useEffect(()=>{o.current&&u(s?o.current.scrollHeight:0)},[s]),t.jsxRuntimeExports.jsxs("div",{className:Q.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:Q.header,onClick:d,children:[t.jsxRuntimeExports.jsx("h5",{id:"h5",children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(Q.icon,{[Q.open]:s}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:o,className:Q.content,style:{height:`${m}px`},children:t.jsxRuntimeExports.jsx("p",{id:"p",children:i})})]})},gn=({children:l,path:i,className:e,target:s="_self",id:n})=>{if(window.location.pathname.includes("/admin/builder"))return t.jsxRuntimeExports.jsx("div",{className:e,role:"link",style:{cursor:"pointer"},id:n,children:l});const m=t.useNavigate(),u=/^https?:\/\//.test(i),o=d=>{u||s==="_blank"?s==="_blank"?window.open(i,"_blank"):window.location.href=i:(d.preventDefault(),m(i,{replace:!0}))};return t.jsxRuntimeExports.jsx("div",{onClick:o,className:e,role:"link",style:{cursor:"pointer"},id:n,children:l})},fn="_buttonsBlock_1b2rb_1",En="_slideUp_1b2rb_1",bn={buttonsBlock:fn,slideUp:En},Rn=()=>t.jsxRuntimeExports.jsxs("div",{className:bn.buttonsBlock,children:[t.jsxRuntimeExports.jsx(t.Button$1,{type:"Primary",style:{width:"100%"},children:"Add to Cart"}),t.jsxRuntimeExports.jsx(t.Button$1,{type:"Secondary",children:"Buy"})]}),vn="_wrapper_st58d_1",yn="_label_st58d_10",In="_textarea_st58d_18",Sn="_length_st58d_33",K={wrapper:vn,label:yn,textarea:In,length:Sn},Nn=l=>{const{onChange:i,label:e,value:s,maxLength:n,placeholder:m="Type something...",type:u="text"}=l,[o,d]=j.useState(s.length);function _(C){return u==="number"?C.replace(/[^\d\n]+/g,""):C}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:C=>{const r=_(C.target.value);d(r.length),i(r)},placeholder:m,className:K.textarea,maxLength:n}),n&&t.jsxRuntimeExports.jsxs("div",{className:K.length,children:[o,"/",n]})]})};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=_n;exports.BurgerMenuButton=at;exports.ButtonTypeSettings=tt;exports.ButtonsSettings=Ue;exports.CategorySettings=Vt;exports.EmptyCart=it;exports.FormSettings=fe;exports.HeaderButtons=Js;exports.LayoutSettings=bt;exports.Link=gn;exports.ListingSelector=Fe;exports.PagesMobileMenu=Qs;exports.PagesMobileModal=ot;exports.PagesSettings=_e;exports.ProductCardButtons=Rn;exports.ProductOptions=ps;exports.ShareLink=dn;exports.ShoppingButton=st;exports.ShoppingModalCart=nt;exports.TextareaUI=Nn;exports.UserInfo=Z;
package/dist/ui.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { j as t, I as x, c as Y, a as dt, S as ot, R as yt, B as tt, O as ut, b as at, u as mt, d as ht, P as pt, D as _t, e as gt, v as xt, f as ft, C as bt, g as H, h as St, i as it, k as wt, l as Bt, m as $t, n as rt, o as V, L as Pt, p as lt, q as jt, r as G, t as Mt, M as vt, w as Nt, x as Tt, y as kt, z as qt } from "./index-D_ZWUeWw.js";
2
- import { H as hi, E as pi, G as _i, A as gi, T as xi, F as fi } from "./index-D_ZWUeWw.js";
1
+ import { j as t, I as x, c as Y, a as dt, S as ot, R as yt, B as tt, O as ut, b as at, u as mt, d as ht, P as pt, D as _t, e as gt, v as xt, f as ft, C as bt, g as H, h as St, i as it, k as wt, l as Bt, m as $t, n as rt, o as V, L as Pt, p as lt, r as jt, t as G, w as Mt, M as vt, x as Nt, z as Tt, A as kt, E as qt } from "./index-D1p6pZXA.js";
2
+ import { K as hi, G as pi, J as _i, F as gi, T as xi, H as fi } from "./index-D1p6pZXA.js";
3
3
  import _ from "react";
4
4
  import "@phosphor-icons/react";
5
5
  const At = "_wrapper_1vmyb_2", Ot = "_alignmentBlock_1vmyb_8", Et = "_title_1vmyb_15", zt = "_subtitle_1vmyb_22", Rt = "_alignmentContent_1vmyb_29", Lt = "_alignments_1vmyb_37", Dt = "_alignment_1vmyb_8", Ht = "_circle_1vmyb_60", Ut = "_paddings_1vmyb_67", Ft = "_padding_1vmyb_67", Vt = "_active_1vmyb_91", Yt = "_input_1vmyb_98", W = {
@@ -25,7 +25,7 @@ const At = "_wrapper_1vmyb_2", Ot = "_alignmentBlock_1vmyb_8", Et = "_title_1vmy
25
25
  "bottomLeft",
26
26
  "bottom",
27
27
  "bottomRight"
28
- ], Wt = ["left", "top", "right", "bottom"], Qn = (r) => {
28
+ ], Wt = ["left", "top", "right", "bottom"], Kn = (r) => {
29
29
  const { alignment: i, padding: e, setPadding: s, setAlignment: n } = r;
30
30
  function h(c) {
31
31
  switch (c) {
@@ -142,11 +142,11 @@ const At = "_wrapper_1vmyb_2", Ot = "_alignmentBlock_1vmyb_8", Et = "_title_1vmy
142
142
  ] })
143
143
  ] })
144
144
  ] });
145
- }, Xt = "_title_82zux_1", Jt = "_subtitle_82zux_5", Qt = "_header_82zux_12", Kt = "_text_82zux_13", Zt = "_productsBlock_82zux_14", te = "_top_82zux_26", ee = "_itemsBlock_82zux_35", se = "_typeTexts_82zux_41", ne = "_block_82zux_48", ie = "_active_82zux_61", oe = "_products_82zux_14", ae = "_product_82zux_14", ce = "_button_82zux_80", le = "_disabled_82zux_91", re = "_image_82zux_95", de = "_info_82zux_102", ue = "_name_82zux_114", me = "_buttons_82zux_118", he = "_modal_82zux_125", pe = "_link_82zux_145", _e = "_modalOptions_82zux_151", ge = "_addButton_82zux_157", xe = "_deleteButton_82zux_179", X = {
146
- title: Xt,
147
- subtitle: Jt,
148
- header: Qt,
149
- text: Kt,
145
+ }, Jt = "_title_82zux_1", Xt = "_subtitle_82zux_5", Kt = "_header_82zux_12", Qt = "_text_82zux_13", Zt = "_productsBlock_82zux_14", te = "_top_82zux_26", ee = "_itemsBlock_82zux_35", se = "_typeTexts_82zux_41", ne = "_block_82zux_48", ie = "_active_82zux_61", oe = "_products_82zux_14", ae = "_product_82zux_14", ce = "_button_82zux_80", le = "_disabled_82zux_91", re = "_image_82zux_95", de = "_info_82zux_102", ue = "_name_82zux_114", me = "_buttons_82zux_118", he = "_modal_82zux_125", pe = "_link_82zux_145", _e = "_modalOptions_82zux_151", ge = "_addButton_82zux_157", xe = "_deleteButton_82zux_179", J = {
146
+ title: Jt,
147
+ subtitle: Xt,
148
+ header: Kt,
149
+ text: Qt,
150
150
  productsBlock: Zt,
151
151
  top: te,
152
152
  itemsBlock: ee,
@@ -166,7 +166,7 @@ const At = "_wrapper_1vmyb_2", Ot = "_alignmentBlock_1vmyb_8", Et = "_title_1vmy
166
166
  modalOptions: _e,
167
167
  addButton: ge,
168
168
  deleteButton: xe
169
- }, Kn = (r) => {
169
+ }, Qn = (r) => {
170
170
  const {
171
171
  isActiveItems: i,
172
172
  setIsActiveItems: e,
@@ -232,7 +232,7 @@ const At = "_wrapper_1vmyb_2", Ot = "_alignmentBlock_1vmyb_8", Et = "_title_1vmy
232
232
  leftAddon: B(A.images)
233
233
  }
234
234
  ),
235
- q && /* @__PURE__ */ t.jsx("div", { className: X.buttons, children: /* @__PURE__ */ t.jsx("div", { className: X.deleteButton, children: /* @__PURE__ */ t.jsx(
235
+ q && /* @__PURE__ */ t.jsx("div", { className: J.buttons, children: /* @__PURE__ */ t.jsx("div", { className: J.deleteButton, children: /* @__PURE__ */ t.jsx(
236
236
  x,
237
237
  {
238
238
  name: "Trash",
@@ -247,15 +247,15 @@ const At = "_wrapper_1vmyb_2", Ot = "_alignmentBlock_1vmyb_8", Et = "_title_1vmy
247
247
  return /* @__PURE__ */ t.jsx(
248
248
  "div",
249
249
  {
250
- className: X.product,
250
+ className: J.product,
251
251
  children: L
252
252
  },
253
253
  v
254
254
  );
255
255
  };
256
- return /* @__PURE__ */ t.jsxs("div", { className: X.productsBlock, children: [
257
- (u || i !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: X.top, children: [
258
- u && /* @__PURE__ */ t.jsx("h3", { className: X.title, children: u }),
256
+ return /* @__PURE__ */ t.jsxs("div", { className: J.productsBlock, children: [
257
+ (u || i !== void 0) && /* @__PURE__ */ t.jsxs("div", { className: J.top, children: [
258
+ u && /* @__PURE__ */ t.jsx("h3", { className: J.title, children: u }),
259
259
  i !== void 0 && /* @__PURE__ */ t.jsx(
260
260
  ot,
261
261
  {
@@ -265,8 +265,8 @@ const At = "_wrapper_1vmyb_2", Ot = "_alignmentBlock_1vmyb_8", Et = "_title_1vmy
265
265
  )
266
266
  ] }),
267
267
  l && M && /* @__PURE__ */ t.jsx(yt, { ...M }),
268
- /* @__PURE__ */ t.jsxs("div", { className: X.products, children: [
269
- o && /* @__PURE__ */ t.jsx("h5", { className: X.subtitle, children: o }),
268
+ /* @__PURE__ */ t.jsxs("div", { className: J.products, children: [
269
+ o && /* @__PURE__ */ t.jsx("h5", { className: J.subtitle, children: o }),
270
270
  s.map((v) => g(v, I)),
271
271
  $ && /* @__PURE__ */ t.jsx(
272
272
  "div",
@@ -281,8 +281,8 @@ const At = "_wrapper_1vmyb_2", Ot = "_alignmentBlock_1vmyb_8", Et = "_title_1vmy
281
281
  tt,
282
282
  {
283
283
  withoutHover: !0,
284
- className: Y(X.button, {
285
- [X.disabled]: !!(w && w <= s.length || s.length === c.length)
284
+ className: Y(J.button, {
285
+ [J.disabled]: !!(w && w <= s.length || s.length === c.length)
286
286
  }),
287
287
  size: "s",
288
288
  disabled: !!(w && w <= s.length || s.length === c.length),
@@ -301,7 +301,7 @@ const At = "_wrapper_1vmyb_2", Ot = "_alignmentBlock_1vmyb_8", Et = "_title_1vmy
301
301
  style: {
302
302
  width: "fit-content"
303
303
  },
304
- children: /* @__PURE__ */ t.jsxs("div", { className: X.addButton, children: [
304
+ children: /* @__PURE__ */ t.jsxs("div", { className: J.addButton, children: [
305
305
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
306
306
  /* @__PURE__ */ t.jsx(
307
307
  x,
@@ -691,13 +691,13 @@ const ti = (r) => {
691
691
  }
692
692
  );
693
693
  }
694
- const Q = (m) => {
694
+ const K = (m) => {
695
695
  const { active: T, over: E } = m;
696
696
  if (E && T.id !== E.id) {
697
697
  const z = s.findIndex((F) => F.id === T.id), et = s.findIndex((F) => F.id === E.id);
698
698
  if (z !== -1 && et !== -1) {
699
- const F = [...s], [J] = F.splice(z, 1);
700
- F.splice(et, 0, J), n(F);
699
+ const F = [...s], [X] = F.splice(z, 1);
700
+ F.splice(et, 0, X), n(F);
701
701
  }
702
702
  }
703
703
  }, st = (m) => {
@@ -716,12 +716,12 @@ const ti = (r) => {
716
716
  at,
717
717
  {
718
718
  onChange: (z) => {
719
- const F = [...s].map((J) => J.id === m.id ? {
719
+ const F = [...s].map((X) => X.id === m.id ? {
720
720
  ...m,
721
721
  name: {
722
722
  "en-US": z
723
723
  }
724
- } : J);
724
+ } : X);
725
725
  L({
726
726
  ...m,
727
727
  name: {
@@ -740,12 +740,12 @@ const ti = (r) => {
740
740
  dt,
741
741
  {
742
742
  onChange: (z) => {
743
- const F = [...s].map((J) => J.id === m.id ? {
743
+ const F = [...s].map((X) => X.id === m.id ? {
744
744
  ...m,
745
745
  name: {
746
746
  "en-US": z
747
747
  }
748
- } : J);
748
+ } : X);
749
749
  n([...F]);
750
750
  },
751
751
  value: m.name["en-US"],
@@ -756,10 +756,10 @@ const ti = (r) => {
756
756
  wt,
757
757
  {
758
758
  onChange: (z) => {
759
- const F = [...s].map((J) => J.id === m.id ? {
759
+ const F = [...s].map((X) => X.id === m.id ? {
760
760
  ...m,
761
761
  images: z
762
- } : J);
762
+ } : X);
763
763
  n([...F]);
764
764
  },
765
765
  activeImage: (E = s.find((z) => z.id === m.id)) == null ? void 0 : E.images[0]
@@ -834,7 +834,7 @@ const ti = (r) => {
834
834
  _t,
835
835
  {
836
836
  sensors: D,
837
- onDragEnd: Q,
837
+ onDragEnd: K,
838
838
  children: /* @__PURE__ */ t.jsx(
839
839
  gt,
840
840
  {
@@ -917,16 +917,16 @@ const ti = (r) => {
917
917
  ] }),
918
918
  h !== void 0 && /* @__PURE__ */ t.jsx(ut, { items: h })
919
919
  ] });
920
- }, Fe = "_subtitle_jql1y_1", Ve = "_header_jql1y_8", Ye = "_text_jql1y_9", Ge = "_productsBlock_jql1y_10", We = "_buttonsBlock_jql1y_11", Xe = "_top_jql1y_23", Je = "_itemsBlock_jql1y_32", Qe = "_typeTexts_jql1y_38", Ke = "_block_jql1y_45", Ze = "_active_jql1y_58", ts = "_products_jql1y_10", es = "_product_jql1y_10", ss = "_button_jql1y_11", ns = "_image_jql1y_88", is = "_info_jql1y_95", os = "_name_jql1y_107", as = "_buttons_jql1y_11", cs = "_modal_jql1y_118", ls = "_other_jql1y_138", rs = "_options_jql1y_144", ds = "_addButton_jql1y_150", us = "_deleteButton_jql1y_165", K = {
920
+ }, Fe = "_subtitle_jql1y_1", Ve = "_header_jql1y_8", Ye = "_text_jql1y_9", Ge = "_productsBlock_jql1y_10", We = "_buttonsBlock_jql1y_11", Je = "_top_jql1y_23", Xe = "_itemsBlock_jql1y_32", Ke = "_typeTexts_jql1y_38", Qe = "_block_jql1y_45", Ze = "_active_jql1y_58", ts = "_products_jql1y_10", es = "_product_jql1y_10", ss = "_button_jql1y_11", ns = "_image_jql1y_88", is = "_info_jql1y_95", os = "_name_jql1y_107", as = "_buttons_jql1y_11", cs = "_modal_jql1y_118", ls = "_other_jql1y_138", rs = "_options_jql1y_144", ds = "_addButton_jql1y_150", us = "_deleteButton_jql1y_165", Q = {
921
921
  subtitle: Fe,
922
922
  header: Ve,
923
923
  text: Ye,
924
924
  productsBlock: Ge,
925
925
  buttonsBlock: We,
926
- top: Xe,
927
- itemsBlock: Je,
928
- typeTexts: Qe,
929
- block: Ke,
926
+ top: Je,
927
+ itemsBlock: Xe,
928
+ typeTexts: Ke,
929
+ block: Qe,
930
930
  active: Ze,
931
931
  products: ts,
932
932
  product: es,
@@ -968,12 +968,12 @@ const ti = (r) => {
968
968
  left: B.left - (n ? 30 : 65)
969
969
  }), d(I);
970
970
  };
971
- return /* @__PURE__ */ t.jsxs("div", { className: K.products, children: [
972
- /* @__PURE__ */ t.jsx("h5", { className: K.subtitle, children: "Button Type" }),
971
+ return /* @__PURE__ */ t.jsxs("div", { className: Q.products, children: [
972
+ /* @__PURE__ */ t.jsx("h5", { className: Q.subtitle, children: "Button Type" }),
973
973
  i.map((p) => /* @__PURE__ */ t.jsxs(
974
974
  "div",
975
975
  {
976
- className: K.product,
976
+ className: Q.product,
977
977
  children: [
978
978
  /* @__PURE__ */ t.jsx(
979
979
  at,
@@ -989,8 +989,8 @@ const ti = (r) => {
989
989
  options: ["Primary", "Secondary", "Tertiary"]
990
990
  }
991
991
  ),
992
- /* @__PURE__ */ t.jsxs("div", { className: K.buttons, children: [
993
- /* @__PURE__ */ t.jsx("div", { className: K.deleteButton, children: /* @__PURE__ */ t.jsx(
992
+ /* @__PURE__ */ t.jsxs("div", { className: Q.buttons, children: [
993
+ /* @__PURE__ */ t.jsx("div", { className: Q.deleteButton, children: /* @__PURE__ */ t.jsx(
994
994
  x,
995
995
  {
996
996
  name: "Sliders",
@@ -1002,7 +1002,7 @@ const ti = (r) => {
1002
1002
  }
1003
1003
  }
1004
1004
  ) }),
1005
- s && /* @__PURE__ */ t.jsx("div", { className: K.deleteButton, children: /* @__PURE__ */ t.jsx(
1005
+ s && /* @__PURE__ */ t.jsx("div", { className: Q.deleteButton, children: /* @__PURE__ */ t.jsx(
1006
1006
  x,
1007
1007
  {
1008
1008
  name: "Trash",
@@ -1043,7 +1043,7 @@ const ti = (r) => {
1043
1043
  tt,
1044
1044
  {
1045
1045
  withoutHover: !0,
1046
- className: K.button,
1046
+ className: Q.button,
1047
1047
  size: "s",
1048
1048
  onClick: () => {
1049
1049
  const p = [...i];
@@ -1072,7 +1072,7 @@ const ti = (r) => {
1072
1072
  style: {
1073
1073
  width: "fit-content"
1074
1074
  },
1075
- children: /* @__PURE__ */ t.jsxs("div", { className: K.addButton, children: [
1075
+ children: /* @__PURE__ */ t.jsxs("div", { className: Q.addButton, children: [
1076
1076
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
1077
1077
  /* @__PURE__ */ t.jsx(
1078
1078
  x,
@@ -1215,8 +1215,8 @@ const si = (r) => {
1215
1215
  if (C && j.id !== C.id) {
1216
1216
  const D = s.findIndex((R) => String(R.listingId) === j.id), P = s.findIndex((R) => String(R.listingId) === C.id);
1217
1217
  if (D !== -1 && P !== -1) {
1218
- const R = [...s], [Q] = R.splice(D, 1);
1219
- R.splice(P, 0, Q), n(R);
1218
+ const R = [...s], [K] = R.splice(D, 1);
1219
+ R.splice(P, 0, K), n(R);
1220
1220
  }
1221
1221
  }
1222
1222
  }, N = (a, j) => {
@@ -1236,11 +1236,11 @@ const si = (r) => {
1236
1236
  at,
1237
1237
  {
1238
1238
  onChange: (P) => {
1239
- const R = [...s], Q = w.find((T) => T.productData.name === P);
1240
- if (!Q) return;
1239
+ const R = [...s], K = w.find((T) => T.productData.name === P);
1240
+ if (!K) return;
1241
1241
  const st = {
1242
- listingId: Q.id,
1243
- image: Q.productData.images.length > 0 ? Q.productData.images[0].cfId : ""
1242
+ listingId: K.id,
1243
+ image: K.productData.images.length > 0 ? K.productData.images[0].cfId : ""
1244
1244
  }, m = R.map((T) => T.listingId === a.listingId ? st : T);
1245
1245
  I(st), n([...m]);
1246
1246
  },
@@ -1584,7 +1584,7 @@ const ni = (r) => {
1584
1584
  )
1585
1585
  ] })
1586
1586
  ] });
1587
- }, Es = "_button_1tdo3_1", zs = "_login_1tdo3_14", Rs = "_signUp_1tdo3_18", Ls = "_buttons_1tdo3_23", Ds = "_modal_1tdo3_32", Hs = "_closing_1tdo3_64", Us = "_info_1tdo3_113", Fs = "_top_1tdo3_120", Vs = "_title_1tdo3_131", Ys = "_clear_1tdo3_138", Gs = "_activeClear_1tdo3_145", Ws = "_count_1tdo3_149", Xs = "_cart_1tdo3_164", Js = "_empty_1tdo3_172", Qs = "_product_1tdo3_198", Ks = "_products_1tdo3_207", Zs = "_image_1tdo3_215", tn = "_productInfo_1tdo3_221", en = "_content_1tdo3_228", sn = "_name_1tdo3_234", nn = "_price_1tdo3_240", on = "_productButtons_1tdo3_246", an = "_productButton_1tdo3_246", cn = "_productCount_1tdo3_266", ln = "_bottom_1tdo3_282", rn = "_subtotal_1tdo3_290", dn = "_block_1tdo3_298", un = "_shoppingCount_1tdo3_305", mn = "_total_1tdo3_325", hn = "_link_1tdo3_331", pn = "_userInfo_1tdo3_338", _n = "_pagesMobileModal_1tdo3_349", gn = "_pagesMobileModalContent_1tdo3_363", xn = "_pagesMobileModalHeader_1tdo3_369", fn = "_pagesMobileModalFooter_1tdo3_379", y = {
1587
+ }, Es = "_button_1tdo3_1", zs = "_login_1tdo3_14", Rs = "_signUp_1tdo3_18", Ls = "_buttons_1tdo3_23", Ds = "_modal_1tdo3_32", Hs = "_closing_1tdo3_64", Us = "_info_1tdo3_113", Fs = "_top_1tdo3_120", Vs = "_title_1tdo3_131", Ys = "_clear_1tdo3_138", Gs = "_activeClear_1tdo3_145", Ws = "_count_1tdo3_149", Js = "_cart_1tdo3_164", Xs = "_empty_1tdo3_172", Ks = "_product_1tdo3_198", Qs = "_products_1tdo3_207", Zs = "_image_1tdo3_215", tn = "_productInfo_1tdo3_221", en = "_content_1tdo3_228", sn = "_name_1tdo3_234", nn = "_price_1tdo3_240", on = "_productButtons_1tdo3_246", an = "_productButton_1tdo3_246", cn = "_productCount_1tdo3_266", ln = "_bottom_1tdo3_282", rn = "_subtotal_1tdo3_290", dn = "_block_1tdo3_298", un = "_shoppingCount_1tdo3_305", mn = "_total_1tdo3_325", hn = "_link_1tdo3_331", pn = "_userInfo_1tdo3_338", _n = "_pagesMobileModal_1tdo3_349", gn = "_pagesMobileModalContent_1tdo3_363", xn = "_pagesMobileModalHeader_1tdo3_369", fn = "_pagesMobileModalFooter_1tdo3_379", y = {
1588
1588
  button: Es,
1589
1589
  login: zs,
1590
1590
  signUp: Rs,
@@ -1601,10 +1601,10 @@ const ni = (r) => {
1601
1601
  clear: Ys,
1602
1602
  activeClear: Gs,
1603
1603
  count: Ws,
1604
- cart: Xs,
1605
- empty: Js,
1606
- product: Qs,
1607
- products: Ks,
1604
+ cart: Js,
1605
+ empty: Xs,
1606
+ product: Ks,
1607
+ products: Qs,
1608
1608
  image: Zs,
1609
1609
  productInfo: tn,
1610
1610
  content: en,
@@ -2187,7 +2187,7 @@ export {
2187
2187
  G as Button,
2188
2188
  ms as ButtonTypeSettings,
2189
2189
  ei as ButtonsSettings,
2190
- Kn as CategorySettings,
2190
+ Qn as CategorySettings,
2191
2191
  wt as ChooseImage,
2192
2192
  hi as ChooseImageModal,
2193
2193
  vn as EmptyCart,
@@ -2197,7 +2197,7 @@ export {
2197
2197
  dt as InputSettings,
2198
2198
  Mt as InputUI,
2199
2199
  pi as ItemsSettings,
2200
- Qn as LayoutSettings,
2200
+ Kn as LayoutSettings,
2201
2201
  li as Link,
2202
2202
  si as ListingSelector,
2203
2203
  _i as Loader,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@billgangcom/theme-lib",
3
- "version": "1.54.2",
3
+ "version": "1.55.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,7 +23,7 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@billgangcom/frontend-lib": "^4.11.0",
26
+ "@billgangcom/frontend-lib": "^4.12.2",
27
27
  "@dnd-kit/core": "^6.3.1",
28
28
  "@dnd-kit/sortable": "^10.0.0",
29
29
  "@dnd-kit/utilities": "^3.2.2",