@billgangcom/theme-lib 1.76.0 → 1.76.2

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.
@@ -70,7 +70,7 @@ React keys must be passed directly to JSX without using spread:
70
70
  To pick up a draggable item, press the space bar.
71
71
  While dragging, use the arrow keys to move the item.
72
72
  Press space again to drop the item in its new position, or press escape to cancel.
73
- `},wI={onDragStart(t){let{active:n}=t;return"Picked up draggable item "+n.id+"."},onDragOver(t){let{active:n,over:o}=t;return o?"Draggable item "+n.id+" was moved over droppable area "+o.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(t){let{active:n,over:o}=t;return o?"Draggable item "+n.id+" was dropped over droppable area "+o.id:"Draggable item "+n.id+" was dropped."},onDragCancel(t){let{active:n}=t;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function xI(t){let{announcements:n=wI,container:o,hiddenTextDescribedById:r,screenReaderInstructions:a=bI}=t;const{announce:i,announcement:c}=SI(),l=Rr("DndLiveRegion"),[u,d]=y.useState(!1);if(y.useEffect(()=>{d(!0)},[]),yI(y.useMemo(()=>({onDragStart(f){let{active:m}=f;i(n.onDragStart({active:m}))},onDragMove(f){let{active:m,over:g}=f;n.onDragMove&&i(n.onDragMove({active:m,over:g}))},onDragOver(f){let{active:m,over:g}=f;i(n.onDragOver({active:m,over:g}))},onDragEnd(f){let{active:m,over:g}=f;i(n.onDragEnd({active:m,over:g}))},onDragCancel(f){let{active:m,over:g}=f;i(n.onDragCancel({active:m,over:g}))}}),[i,n])),!u)return null;const h=y.createElement(y.Fragment,null,y.createElement(II,{id:r,value:a.draggable}),y.createElement(CI,{id:l,announcement:c}));return o?go.createPortal(h,o):h}var ht;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(ht||(ht={}));function ka(){}function Mu(t,n){return y.useMemo(()=>({sensor:t,options:n??{}}),[t,n])}function Nu(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return y.useMemo(()=>[...n].filter(r=>r!=null),[...n])}const gn=Object.freeze({x:0,y:0});function _I(t,n){let{data:{value:o}}=t,{data:{value:r}}=n;return r-o}function TI(t,n){if(!t||t.length===0)return null;const[o]=t;return o[n]}function kI(t,n){const o=Math.max(n.top,t.top),r=Math.max(n.left,t.left),a=Math.min(n.left+n.width,t.left+t.width),i=Math.min(n.top+n.height,t.top+t.height),c=a-r,l=i-o;if(r<a&&o<i){const u=n.width*n.height,d=t.width*t.height,h=c*l,f=h/(u+d-h);return Number(f.toFixed(4))}return 0}const PI=t=>{let{collisionRect:n,droppableRects:o,droppableContainers:r}=t;const a=[];for(const i of r){const{id:c}=i,l=o.get(c);if(l){const u=kI(l,n);u>0&&a.push({id:c,data:{droppableContainer:i,value:u}})}}return a.sort(_I)};function LI(t,n,o){return{...t,scaleX:n&&o?n.width/o.width:1,scaleY:n&&o?n.height/o.height:1}}function Bu(t,n){return t&&n?{x:t.left-n.left,y:t.top-n.top}:gn}function AI(t){return function(o){for(var r=arguments.length,a=new Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];return a.reduce((c,l)=>({...c,top:c.top+t*l.y,bottom:c.bottom+t*l.y,left:c.left+t*l.x,right:c.right+t*l.x}),{...o})}}const EI=AI(1);function RI(t){if(t.startsWith("matrix3d(")){const n=t.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(t.startsWith("matrix(")){const n=t.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function DI(t,n,o){const r=RI(n);if(!r)return t;const{scaleX:a,scaleY:i,x:c,y:l}=r,u=t.left-c-(1-a)*parseFloat(o),d=t.top-l-(1-i)*parseFloat(o.slice(o.indexOf(" ")+1)),h=a?t.width/a:t.width,f=i?t.height/i:t.height;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u}}const MI={ignoreTransform:!1};function qo(t,n){n===void 0&&(n=MI);let o=t.getBoundingClientRect();if(n.ignoreTransform){const{transform:d,transformOrigin:h}=zt(t).getComputedStyle(t);d&&(o=DI(o,d,h))}const{top:r,left:a,width:i,height:c,bottom:l,right:u}=o;return{top:r,left:a,width:i,height:c,bottom:l,right:u}}function $c(t){return qo(t,{ignoreTransform:!0})}function NI(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}function BI(t,n){return n===void 0&&(n=zt(t).getComputedStyle(t)),n.position==="fixed"}function FI(t,n){n===void 0&&(n=zt(t).getComputedStyle(t));const o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const i=n[a];return typeof i=="string"?o.test(i):!1})}function Es(t,n){const o=[];function r(a){if(n!=null&&o.length>=n||!a)return o;if(Ps(a)&&a.scrollingElement!=null&&!o.includes(a.scrollingElement))return o.push(a.scrollingElement),o;if(!Ar(a)||Eu(a)||o.includes(a))return o;const i=zt(t).getComputedStyle(a);return a!==t&&FI(a,i)&&o.push(a),BI(a,i)?o:r(a.parentNode)}return t?r(t):o}function Fu(t){const[n]=Es(t,1);return n??null}function pi(t){return!Wa||!t?null:$o(t)?t:ks(t)?Ps(t)||t===Wo(t).scrollingElement?window:Ar(t)?t:null:null}function ju(t){return $o(t)?t.scrollX:t.scrollLeft}function Ou(t){return $o(t)?t.scrollY:t.scrollTop}function zi(t){return{x:ju(t),y:Ou(t)}}var yt;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(yt||(yt={}));function Hu(t){return!Wa||!t?!1:t===document.scrollingElement}function Vu(t){const n={x:0,y:0},o=Hu(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-o.width,y:t.scrollHeight-o.height},a=t.scrollTop<=n.y,i=t.scrollLeft<=n.x,c=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:a,isLeft:i,isBottom:c,isRight:l,maxScroll:r,minScroll:n}}const jI={x:.2,y:.2};function OI(t,n,o,r,a){let{top:i,left:c,right:l,bottom:u}=o;r===void 0&&(r=10),a===void 0&&(a=jI);const{isTop:d,isBottom:h,isLeft:f,isRight:m}=Vu(t),g={x:0,y:0},S={x:0,y:0},p={height:n.height*a.y,width:n.width*a.x};return!d&&i<=n.top+p.height?(g.y=yt.Backward,S.y=r*Math.abs((n.top+p.height-i)/p.height)):!h&&u>=n.bottom-p.height&&(g.y=yt.Forward,S.y=r*Math.abs((n.bottom-p.height-u)/p.height)),!m&&l>=n.right-p.width?(g.x=yt.Forward,S.x=r*Math.abs((n.right-p.width-l)/p.width)):!f&&c<=n.left+p.width&&(g.x=yt.Backward,S.x=r*Math.abs((n.left+p.width-c)/p.width)),{direction:g,speed:S}}function HI(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,height:c}}const{top:n,left:o,right:r,bottom:a}=t.getBoundingClientRect();return{top:n,left:o,right:r,bottom:a,width:t.clientWidth,height:t.clientHeight}}function Uu(t){return t.reduce((n,o)=>Bo(n,zi(o)),gn)}function VI(t){return t.reduce((n,o)=>n+ju(o),0)}function UI(t){return t.reduce((n,o)=>n+Ou(o),0)}function $I(t,n){if(n===void 0&&(n=qo),!t)return;const{top:o,left:r,bottom:a,right:i}=n(t);Fu(t)&&(a<=0||i<=0||o>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const WI=[["x",["left","right"],VI],["y",["top","bottom"],UI]];class Rs{constructor(n,o){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Es(o),a=Uu(r);this.rect={...n},this.width=n.width,this.height=n.height;for(const[i,c,l]of WI)for(const u of c)Object.defineProperty(this,u,{get:()=>{const d=l(r),h=a[i]-d;return this.rect[u]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class dr{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(o=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...o)})},this.target=n}add(n,o,r){var a;(a=this.target)==null||a.addEventListener(n,o,r),this.listeners.push([n,o,r])}}function qI(t){const{EventTarget:n}=zt(t);return t instanceof n?t:Wo(t)}function mi(t,n){const o=Math.abs(t.x),r=Math.abs(t.y);return typeof n=="number"?Math.sqrt(o**2+r**2)>n:"x"in n&&"y"in n?o>n.x&&r>n.y:"x"in n?o>n.x:"y"in n?r>n.y:!1}var an;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(an||(an={}));function Wc(t){t.preventDefault()}function ZI(t){t.stopPropagation()}var Ee;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Ee||(Ee={}));const $u={start:[Ee.Space,Ee.Enter],cancel:[Ee.Esc],end:[Ee.Space,Ee.Enter,Ee.Tab]},GI=(t,n)=>{let{currentCoordinates:o}=n;switch(t.code){case Ee.Right:return{...o,x:o.x+25};case Ee.Left:return{...o,x:o.x-25};case Ee.Down:return{...o,y:o.y+25};case Ee.Up:return{...o,y:o.y-25}}};class Wu{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:o}}=n;this.props=n,this.listeners=new dr(Wo(o)),this.windowListeners=new dr(zt(o)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(an.Resize,this.handleCancel),this.windowListeners.add(an.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(an.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:o}=this.props,r=n.node.current;r&&$I(r),o(gn)}handleKeyDown(n){if(As(n)){const{active:o,context:r,options:a}=this.props,{keyboardCodes:i=$u,coordinateGetter:c=GI,scrollBehavior:l="smooth"}=a,{code:u}=n;if(i.end.includes(u)){this.handleEnd(n);return}if(i.cancel.includes(u)){this.handleCancel(n);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:gn;this.referenceCoordinates||(this.referenceCoordinates=h);const f=c(n,{active:o,context:r.current,currentCoordinates:h});if(f){const m=Ta(f,h),g={x:0,y:0},{scrollableAncestors:S}=r.current;for(const p of S){const I=n.code,{isTop:w,isRight:C,isLeft:x,isBottom:T,maxScroll:_,minScroll:D}=Vu(p),v=HI(p),P={x:Math.min(I===Ee.Right?v.right-v.width/2:v.right,Math.max(I===Ee.Right?v.left:v.left+v.width/2,f.x)),y:Math.min(I===Ee.Down?v.bottom-v.height/2:v.bottom,Math.max(I===Ee.Down?v.top:v.top+v.height/2,f.y))},N=I===Ee.Right&&!C||I===Ee.Left&&!x,M=I===Ee.Down&&!T||I===Ee.Up&&!w;if(N&&P.x!==f.x){const q=p.scrollLeft+m.x,j=I===Ee.Right&&q<=_.x||I===Ee.Left&&q>=D.x;if(j&&!m.y){p.scrollTo({left:q,behavior:l});return}j?g.x=p.scrollLeft-q:g.x=I===Ee.Right?p.scrollLeft-_.x:p.scrollLeft-D.x,g.x&&p.scrollBy({left:-g.x,behavior:l});break}else if(M&&P.y!==f.y){const q=p.scrollTop+m.y,j=I===Ee.Down&&q<=_.y||I===Ee.Up&&q>=D.y;if(j&&!m.x){p.scrollTo({top:q,behavior:l});return}j?g.y=p.scrollTop-q:g.y=I===Ee.Down?p.scrollTop-_.y:p.scrollTop-D.y,g.y&&p.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(n,Bo(Ta(f,this.referenceCoordinates),g))}}}handleMove(n,o){const{onMove:r}=this.props;n.preventDefault(),r(o)}handleEnd(n){const{onEnd:o}=this.props;n.preventDefault(),this.detach(),o()}handleCancel(n){const{onCancel:o}=this.props;n.preventDefault(),this.detach(),o()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Wu.activators=[{eventName:"onKeyDown",handler:(t,n,o)=>{let{keyboardCodes:r=$u,onActivation:a}=n,{active:i}=o;const{code:c}=t.nativeEvent;if(r.start.includes(c)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),a==null||a({event:t.nativeEvent}),!0)}return!1}}];function qc(t){return!!(t&&"distance"in t)}function Zc(t){return!!(t&&"delay"in t)}class Ds{constructor(n,o,r){var a;r===void 0&&(r=qI(n.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=n,this.events=o;const{event:i}=n,{target:c}=i;this.props=n,this.events=o,this.document=Wo(c),this.documentListeners=new dr(this.document),this.listeners=new dr(r),this.windowListeners=new dr(zt(c)),this.initialCoordinates=(a=Gi(i))!=null?a:gn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:n,props:{options:{activationConstraint:o,bypassActivationConstraint:r}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(an.Resize,this.handleCancel),this.windowListeners.add(an.DragStart,Wc),this.windowListeners.add(an.VisibilityChange,this.handleCancel),this.windowListeners.add(an.ContextMenu,Wc),this.documentListeners.add(an.Keydown,this.handleKeydown),o){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Zc(o)){this.timeoutId=setTimeout(this.handleStart,o.delay),this.handlePending(o);return}if(qc(o)){this.handlePending(o);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(n,o){const{active:r,onPending:a}=this.props;a(r,n,this.initialCoordinates,o)}handleStart(){const{initialCoordinates:n}=this,{onStart:o}=this.props;n&&(this.activated=!0,this.documentListeners.add(an.Click,ZI,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(an.SelectionChange,this.removeTextSelection),o(n))}handleMove(n){var o;const{activated:r,initialCoordinates:a,props:i}=this,{onMove:c,options:{activationConstraint:l}}=i;if(!a)return;const u=(o=Gi(n))!=null?o:gn,d=Ta(a,u);if(!r&&l){if(qc(l)){if(l.tolerance!=null&&mi(d,l.tolerance))return this.handleCancel();if(mi(d,l.distance))return this.handleStart()}if(Zc(l)&&mi(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}n.cancelable&&n.preventDefault(),c(u)}handleEnd(){const{onAbort:n,onEnd:o}=this.props;this.detach(),this.activated||n(this.props.active),o()}handleCancel(){const{onAbort:n,onCancel:o}=this.props;this.detach(),this.activated||n(this.props.active),o()}handleKeydown(n){n.code===Ee.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const zI={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class qa extends Ds{constructor(n){const{event:o}=n,r=Wo(o.target);super(n,zI,r)}}qa.activators=[{eventName:"onPointerDown",handler:(t,n)=>{let{nativeEvent:o}=t,{onActivation:r}=n;return!o.isPrimary||o.button!==0?!1:(r==null||r({event:o}),!0)}}];const YI={move:{name:"mousemove"},end:{name:"mouseup"}};var Yi;(function(t){t[t.RightClick=2]="RightClick"})(Yi||(Yi={}));class XI extends Ds{constructor(n){super(n,YI,Wo(n.event.target))}}XI.activators=[{eventName:"onMouseDown",handler:(t,n)=>{let{nativeEvent:o}=t,{onActivation:r}=n;return o.button===Yi.RightClick?!1:(r==null||r({event:o}),!0)}}];const gi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class KI extends Ds{constructor(n){super(n,gi)}static setup(){return window.addEventListener(gi.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(gi.move.name,n)};function n(){}}}KI.activators=[{eventName:"onTouchStart",handler:(t,n)=>{let{nativeEvent:o}=t,{onActivation:r}=n;const{touches:a}=o;return a.length>1?!1:(r==null||r({event:o}),!0)}}];var hr;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(hr||(hr={}));var Pa;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Pa||(Pa={}));function JI(t){let{acceleration:n,activator:o=hr.Pointer,canScroll:r,draggingRect:a,enabled:i,interval:c=5,order:l=Pa.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:f,threshold:m}=t;const g=e2({delta:f,disabled:!i}),[S,p]=hI(),I=y.useRef({x:0,y:0}),w=y.useRef({x:0,y:0}),C=y.useMemo(()=>{switch(o){case hr.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case hr.DraggableRect:return a}},[o,a,u]),x=y.useRef(null),T=y.useCallback(()=>{const D=x.current;if(!D)return;const v=I.current.x*w.current.x,P=I.current.y*w.current.y;D.scrollBy(v,P)},[]),_=y.useMemo(()=>l===Pa.TreeOrder?[...d].reverse():d,[l,d]);y.useEffect(()=>{if(!i||!d.length||!C){p();return}for(const D of _){if((r==null?void 0:r(D))===!1)continue;const v=d.indexOf(D),P=h[v];if(!P)continue;const{direction:N,speed:M}=OI(D,P,C,n,m);for(const q of["x","y"])g[q][N[q]]||(M[q]=0,N[q]=0);if(M.x>0||M.y>0){p(),x.current=D,S(T,c),I.current=M,w.current=N;return}}I.current={x:0,y:0},w.current={x:0,y:0},p()},[n,T,r,p,i,c,JSON.stringify(C),JSON.stringify(g),S,d,_,h,JSON.stringify(m)])}const QI={x:{[yt.Backward]:!1,[yt.Forward]:!1},y:{[yt.Backward]:!1,[yt.Forward]:!1}};function e2(t){let{delta:n,disabled:o}=t;const r=Zi(n);return Er(a=>{if(o||!r||!a)return QI;const i={x:Math.sign(n.x-r.x),y:Math.sign(n.y-r.y)};return{x:{[yt.Backward]:a.x[yt.Backward]||i.x===-1,[yt.Forward]:a.x[yt.Forward]||i.x===1},y:{[yt.Backward]:a.y[yt.Backward]||i.y===-1,[yt.Forward]:a.y[yt.Forward]||i.y===1}}},[o,n,r])}function t2(t,n){const o=n!=null?t.get(n):void 0,r=o?o.node.current:null;return Er(a=>{var i;return n==null?null:(i=r??a)!=null?i:null},[r,n])}function n2(t,n){return y.useMemo(()=>t.reduce((o,r)=>{const{sensor:a}=r,i=a.activators.map(c=>({eventName:c.eventName,handler:n(c.handler,r)}));return[...o,...i]},[]),[t,n])}var yr;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(yr||(yr={}));var Xi;(function(t){t.Optimized="optimized"})(Xi||(Xi={}));const Gc=new Map;function o2(t,n){let{dragging:o,dependencies:r,config:a}=n;const[i,c]=y.useState(null),{frequency:l,measure:u,strategy:d}=a,h=y.useRef(t),f=I(),m=Sr(f),g=y.useCallback(function(w){w===void 0&&(w=[]),!m.current&&c(C=>C===null?w:C.concat(w.filter(x=>!C.includes(x))))},[m]),S=y.useRef(null),p=Er(w=>{if(f&&!o)return Gc;if(!w||w===Gc||h.current!==t||i!=null){const C=new Map;for(let x of t){if(!x)continue;if(i&&i.length>0&&!i.includes(x.id)&&x.rect.current){C.set(x.id,x.rect.current);continue}const T=x.node.current,_=T?new Rs(u(T),T):null;x.rect.current=_,_&&C.set(x.id,_)}return C}return w},[t,i,o,f,u]);return y.useEffect(()=>{h.current=t},[t]),y.useEffect(()=>{f||g()},[o,f]),y.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),y.useEffect(()=>{f||typeof l!="number"||S.current!==null||(S.current=setTimeout(()=>{g(),S.current=null},l))},[l,f,g,...r]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:i!=null};function I(){switch(d){case yr.Always:return!1;case yr.BeforeDragging:return o;default:return!o}}}function qu(t,n){return Er(o=>t?o||(typeof n=="function"?n(t):t):null,[n,t])}function r2(t,n){return qu(t,n)}function a2(t){let{callback:n,disabled:o}=t;const r=Ls(n),a=y.useMemo(()=>{if(o||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,o]);return y.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Za(t){let{callback:n,disabled:o}=t;const r=Ls(n),a=y.useMemo(()=>{if(o||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[o]);return y.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function i2(t){return new Rs(qo(t),t)}function zc(t,n,o){n===void 0&&(n=i2);const[r,a]=y.useState(null);function i(){a(u=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=u??o)!=null?d:null}const h=n(t);return JSON.stringify(u)===JSON.stringify(h)?u:h})}const c=a2({callback(u){if(t)for(const d of u){const{type:h,target:f}=d;if(h==="childList"&&f instanceof HTMLElement&&f.contains(t)){i();break}}}}),l=Za({callback:i});return En(()=>{i(),t?(l==null||l.observe(t),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),c==null||c.disconnect())},[t]),r}function s2(t){const n=qu(t);return Bu(t,n)}const Yc=[];function c2(t){const n=y.useRef(t),o=Er(r=>t?r&&r!==Yc&&t&&n.current&&t.parentNode===n.current.parentNode?r:Es(t):Yc,[t]);return y.useEffect(()=>{n.current=t},[t]),o}function l2(t){const[n,o]=y.useState(null),r=y.useRef(t),a=y.useCallback(i=>{const c=pi(i.target);c&&o(l=>l?(l.set(c,zi(c)),new Map(l)):null)},[]);return y.useEffect(()=>{const i=r.current;if(t!==i){c(i);const l=t.map(u=>{const d=pi(u);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,zi(d)]):null}).filter(u=>u!=null);o(l.length?new Map(l):null),r.current=t}return()=>{c(t),c(i)};function c(l){l.forEach(u=>{const d=pi(u);d==null||d.removeEventListener("scroll",a)})}},[a,t]),y.useMemo(()=>t.length?n?Array.from(n.values()).reduce((i,c)=>Bo(i,c),gn):Uu(t):gn,[t,n])}function Xc(t,n){n===void 0&&(n=[]);const o=y.useRef(null);return y.useEffect(()=>{o.current=null},n),y.useEffect(()=>{const r=t!==gn;r&&!o.current&&(o.current=t),!r&&o.current&&(o.current=null)},[t]),o.current?Ta(t,o.current):gn}function u2(t){y.useEffect(()=>{if(!Wa)return;const n=t.map(o=>{let{sensor:r}=o;return r.setup==null?void 0:r.setup()});return()=>{for(const o of n)o==null||o()}},t.map(n=>{let{sensor:o}=n;return o}))}function d2(t,n){return y.useMemo(()=>t.reduce((o,r)=>{let{eventName:a,handler:i}=r;return o[a]=c=>{i(c,n)},o},{}),[t,n])}function Zu(t){return y.useMemo(()=>t?NI(t):null,[t])}const Kc=[];function h2(t,n){n===void 0&&(n=qo);const[o]=t,r=Zu(o?zt(o):null),[a,i]=y.useState(Kc);function c(){i(()=>t.length?t.map(u=>Hu(u)?r:new Rs(n(u),u)):Kc)}const l=Za({callback:c});return En(()=>{l==null||l.disconnect(),c(),t.forEach(u=>l==null?void 0:l.observe(u))},[t]),a}function f2(t){if(!t)return null;if(t.children.length>1)return t;const n=t.children[0];return Ar(n)?n:t}function p2(t){let{measure:n}=t;const[o,r]=y.useState(null),a=y.useCallback(d=>{for(const{target:h}of d)if(Ar(h)){r(f=>{const m=n(h);return f?{...f,width:m.width,height:m.height}:m});break}},[n]),i=Za({callback:a}),c=y.useCallback(d=>{const h=f2(d);i==null||i.disconnect(),h&&(i==null||i.observe(h)),r(h?n(h):null)},[n,i]),[l,u]=_a(c);return y.useMemo(()=>({nodeRef:l,rect:o,setRef:u}),[o,l,u])}const m2=[{sensor:qa,options:{}},{sensor:Wu,options:{}}],g2={current:{}},fa={draggable:{measure:$c},droppable:{measure:$c,strategy:yr.WhileDragging,frequency:Xi.Optimized},dragOverlay:{measure:qo}};class fr extends Map{get(n){var o;return n!=null&&(o=super.get(n))!=null?o:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:o}=n;return!o})}getNodeFor(n){var o,r;return(o=(r=this.get(n))==null?void 0:r.node.current)!=null?o:void 0}}const I2={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ka},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fa,measureDroppableContainers:ka,windowRect:null,measuringScheduled:!1},C2={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ka,draggableNodes:new Map,over:null,measureDroppableContainers:ka},Ga=y.createContext(C2),Gu=y.createContext(I2);function S2(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fr}}}function y2(t,n){switch(n.type){case ht.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case ht.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:n.coordinates.x-t.draggable.initialCoordinates.x,y:n.coordinates.y-t.draggable.initialCoordinates.y}}};case ht.DragEnd:case ht.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ht.RegisterDroppable:{const{element:o}=n,{id:r}=o,a=new fr(t.droppable.containers);return a.set(r,o),{...t,droppable:{...t.droppable,containers:a}}}case ht.SetDroppableDisabled:{const{id:o,key:r,disabled:a}=n,i=t.droppable.containers.get(o);if(!i||r!==i.key)return t;const c=new fr(t.droppable.containers);return c.set(o,{...i,disabled:a}),{...t,droppable:{...t.droppable,containers:c}}}case ht.UnregisterDroppable:{const{id:o,key:r}=n,a=t.droppable.containers.get(o);if(!a||r!==a.key)return t;const i=new fr(t.droppable.containers);return i.delete(o),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function v2(t){let{disabled:n}=t;const{active:o,activatorEvent:r,draggableNodes:a}=y.useContext(Ga),i=Zi(r),c=Zi(o==null?void 0:o.id);return y.useEffect(()=>{if(!n&&!r&&i&&c!=null){if(!As(i)||document.activeElement===i.target)return;const l=a.get(c);if(!l)return;const{activatorNode:u,node:d}=l;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const f=mI(h);if(f){f.focus();break}}})}},[r,n,a,c,i]),null}function b2(t,n){let{transform:o,...r}=n;return t!=null&&t.length?t.reduce((a,i)=>i({transform:a,...r}),o):o}function w2(t){return y.useMemo(()=>({draggable:{...fa.draggable,...t==null?void 0:t.draggable},droppable:{...fa.droppable,...t==null?void 0:t.droppable},dragOverlay:{...fa.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function x2(t){let{activeNode:n,measure:o,initialRect:r,config:a=!0}=t;const i=y.useRef(!1),{x:c,y:l}=typeof a=="boolean"?{x:a,y:a}:a;En(()=>{if(!c&&!l||!n){i.current=!1;return}if(i.current||!r)return;const d=n==null?void 0:n.node.current;if(!d||d.isConnected===!1)return;const h=o(d),f=Bu(h,r);if(c||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=Fu(d);m&&m.scrollBy({top:f.y,left:f.x})}},[n,c,l,r,o])}const zu=y.createContext({...gn,scaleX:1,scaleY:1});var Kn;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Kn||(Kn={}));const Yu=y.memo(function(n){var o,r,a,i;let{id:c,accessibility:l,autoScroll:u=!0,children:d,sensors:h=m2,collisionDetection:f=PI,measuring:m,modifiers:g,...S}=n;const p=y.useReducer(y2,void 0,S2),[I,w]=p,[C,x]=vI(),[T,_]=y.useState(Kn.Uninitialized),D=T===Kn.Initialized,{draggable:{active:v,nodes:P,translate:N},droppable:{containers:M}}=I,q=v!=null?P.get(v):null,j=y.useRef({initial:null,translated:null}),G=y.useMemo(()=>{var Ve;return v!=null?{id:v,data:(Ve=q==null?void 0:q.data)!=null?Ve:g2,rect:j}:null},[v,q]),H=y.useRef(null),[ce,he]=y.useState(null),[me,Ce]=y.useState(null),ye=Sr(S,Object.values(S)),$=Rr("DndDescribedBy",c),Y=y.useMemo(()=>M.getEnabled(),[M]),ne=w2(m),{droppableRects:oe,measureDroppableContainers:O,measuringScheduled:X}=o2(Y,{dragging:D,dependencies:[N.x,N.y],config:ne.droppable}),K=t2(P,v),ie=y.useMemo(()=>me?Gi(me):null,[me]),ue=Bn(),z=r2(K,ne.draggable.measure);x2({activeNode:v!=null?P.get(v):null,config:ue.layoutShiftCompensation,initialRect:z,measure:ne.draggable.measure});const J=zc(K,ne.draggable.measure,z),ke=zc(K?K.parentElement:null),V=y.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:oe,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=M.getNodeFor((o=V.current.over)==null?void 0:o.id),le=p2({measure:ne.dragOverlay.measure}),de=(r=le.nodeRef.current)!=null?r:K,Pe=D?(a=le.rect)!=null?a:J:null,et=!!(le.nodeRef.current&&le.rect),tt=s2(et?null:J),Le=Zu(de?zt(de):null),je=c2(D?xe??K:null),Yt=h2(je),We=b2(g,{transform:{x:N.x-tt.x,y:N.y-tt.y,scaleX:1,scaleY:1},activatorEvent:me,active:G,activeNodeRect:J,containerNodeRect:ke,draggingNodeRect:Pe,over:V.current.over,overlayNodeRect:le.rect,scrollableAncestors:je,scrollableAncestorRects:Yt,windowRect:Le}),Ot=ie?Bo(ie,N):null,qe=l2(je),lt=Xc(qe),Pt=Xc(qe,[J]),Ye=Bo(We,lt),nt=Pe?EI(Pe,We):null,Xe=G&&nt?f({active:G,collisionRect:nt,droppableRects:oe,droppableContainers:Y,pointerCoordinates:Ot}):null,yn=TI(Xe,"id"),[vt,zn]=y.useState(null),ot=et?We:Bo(We,Pt),vn=LI(ot,(i=vt==null?void 0:vt.rect)!=null?i:null,J),bn=y.useRef(null),io=y.useCallback((Ve,pt)=>{let{sensor:mt,options:Xt}=pt;if(H.current==null)return;const bt=P.get(H.current);if(!bt)return;const Ke=Ve.nativeEvent,gt=new mt({active:H.current,activeNode:bt,event:Ke,options:Xt,context:V,onAbort(Je){if(!P.get(Je))return;const{onDragAbort:L}=ye.current,R={id:Je};L==null||L(R),C({type:"onDragAbort",event:R})},onPending(Je,k,L,R){if(!P.get(Je))return;const{onDragPending:ee}=ye.current,se={id:Je,constraint:k,initialCoordinates:L,offset:R};ee==null||ee(se),C({type:"onDragPending",event:se})},onStart(Je){const k=H.current;if(k==null)return;const L=P.get(k);if(!L)return;const{onDragStart:R}=ye.current,W={activatorEvent:Ke,active:{id:k,data:L.data,rect:j}};go.unstable_batchedUpdates(()=>{R==null||R(W),_(Kn.Initializing),w({type:ht.DragStart,initialCoordinates:Je,active:k}),C({type:"onDragStart",event:W}),he(bn.current),Ce(Ke)})},onMove(Je){w({type:ht.DragMove,coordinates:Je})},onEnd:wn(ht.DragEnd),onCancel:wn(ht.DragCancel)});bn.current=gt;function wn(Je){return async function(){const{active:L,collisions:R,over:W,scrollAdjustedTranslate:ee}=V.current;let se=null;if(L&&ee){const{cancelDrop:b}=ye.current;se={activatorEvent:Ke,active:L,collisions:R,delta:ee,over:W},Je===ht.DragEnd&&typeof b=="function"&&await Promise.resolve(b(se))&&(Je=ht.DragCancel)}H.current=null,go.unstable_batchedUpdates(()=>{w({type:Je}),_(Kn.Uninitialized),zn(null),he(null),Ce(null),bn.current=null;const b=Je===ht.DragEnd?"onDragEnd":"onDragCancel";if(se){const A=ye.current[b];A==null||A(se),C({type:b,event:se})}})}}},[P]),zo=y.useCallback((Ve,pt)=>(mt,Xt)=>{const bt=mt.nativeEvent,Ke=P.get(Xt);if(H.current!==null||!Ke||bt.dndKit||bt.defaultPrevented)return;const gt={active:Ke};Ve(mt,pt.options,gt)===!0&&(bt.dndKit={capturedBy:pt.sensor},H.current=Xt,io(mt,pt))},[P,io]),Mn=n2(h,zo);u2(h),En(()=>{J&&T===Kn.Initializing&&_(Kn.Initialized)},[J,T]),y.useEffect(()=>{const{onDragMove:Ve}=ye.current,{active:pt,activatorEvent:mt,collisions:Xt,over:bt}=V.current;if(!pt||!mt)return;const Ke={active:pt,activatorEvent:mt,collisions:Xt,delta:{x:Ye.x,y:Ye.y},over:bt};go.unstable_batchedUpdates(()=>{Ve==null||Ve(Ke),C({type:"onDragMove",event:Ke})})},[Ye.x,Ye.y]),y.useEffect(()=>{const{active:Ve,activatorEvent:pt,collisions:mt,droppableContainers:Xt,scrollAdjustedTranslate:bt}=V.current;if(!Ve||H.current==null||!pt||!bt)return;const{onDragOver:Ke}=ye.current,gt=Xt.get(yn),wn=gt&&gt.rect.current?{id:gt.id,rect:gt.rect.current,data:gt.data,disabled:gt.disabled}:null,Je={active:Ve,activatorEvent:pt,collisions:mt,delta:{x:bt.x,y:bt.y},over:wn};go.unstable_batchedUpdates(()=>{zn(wn),Ke==null||Ke(Je),C({type:"onDragOver",event:Je})})},[yn]),En(()=>{V.current={activatorEvent:me,active:G,activeNode:K,collisionRect:nt,collisions:Xe,droppableRects:oe,draggableNodes:P,draggingNode:de,draggingNodeRect:Pe,droppableContainers:M,over:vt,scrollableAncestors:je,scrollAdjustedTranslate:Ye},j.current={initial:Pe,translated:nt}},[G,K,Xe,nt,P,de,Pe,oe,M,vt,je,Ye]),JI({...ue,delta:N,draggingRect:nt,pointerCoordinates:Ot,scrollableAncestors:je,scrollableAncestorRects:Yt});const Nn=y.useMemo(()=>({active:G,activeNode:K,activeNodeRect:J,activatorEvent:me,collisions:Xe,containerNodeRect:ke,dragOverlay:le,draggableNodes:P,droppableContainers:M,droppableRects:oe,over:vt,measureDroppableContainers:O,scrollableAncestors:je,scrollableAncestorRects:Yt,measuringConfiguration:ne,measuringScheduled:X,windowRect:Le}),[G,K,J,me,Xe,ke,le,P,M,oe,vt,O,je,Yt,ne,X,Le]),dn=y.useMemo(()=>({activatorEvent:me,activators:Mn,active:G,activeNodeRect:J,ariaDescribedById:{draggable:$},dispatch:w,draggableNodes:P,over:vt,measureDroppableContainers:O}),[me,Mn,G,J,w,$,P,vt,O]);return y.createElement(Du.Provider,{value:x},y.createElement(Ga.Provider,{value:dn},y.createElement(Gu.Provider,{value:Nn},y.createElement(zu.Provider,{value:vn},d)),y.createElement(v2,{disabled:(l==null?void 0:l.restoreFocus)===!1})),y.createElement(xI,{...l,hiddenTextDescribedById:$}));function Bn(){const Ve=(ce==null?void 0:ce.autoScrollEnabled)===!1,pt=typeof u=="object"?u.enabled===!1:u===!1,mt=D&&!Ve&&!pt;return typeof u=="object"?{...u,enabled:mt}:{enabled:mt}}}),_2=y.createContext(null),Jc="button",T2="Draggable";function k2(t){let{id:n,data:o,disabled:r=!1,attributes:a}=t;const i=Rr(T2),{activators:c,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:f,over:m}=y.useContext(Ga),{role:g=Jc,roleDescription:S="draggable",tabIndex:p=0}=a??{},I=(u==null?void 0:u.id)===n,w=y.useContext(I?zu:_2),[C,x]=_a(),[T,_]=_a(),D=d2(c,n),v=Sr(o);En(()=>(f.set(n,{id:n,key:i,node:C,activatorNode:T,data:v}),()=>{const N=f.get(n);N&&N.key===i&&f.delete(n)}),[f,n]);const P=y.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":r,"aria-pressed":I&&g===Jc?!0:void 0,"aria-roledescription":S,"aria-describedby":h.draggable}),[r,g,p,I,S,h.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:P,isDragging:I,listeners:r?void 0:D,node:C,over:m,setNodeRef:x,setActivatorNodeRef:_,transform:w}}function P2(){return y.useContext(Gu)}const L2="Droppable",A2={timeout:25};function E2(t){let{data:n,disabled:o=!1,id:r,resizeObserverConfig:a}=t;const i=Rr(L2),{active:c,dispatch:l,over:u,measureDroppableContainers:d}=y.useContext(Ga),h=y.useRef({disabled:o}),f=y.useRef(!1),m=y.useRef(null),g=y.useRef(null),{disabled:S,updateMeasurementsFor:p,timeout:I}={...A2,...a},w=Sr(p??r),C=y.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),g.current=null},I)},[I]),x=Za({callback:C,disabled:S||!c}),T=y.useCallback((P,N)=>{x&&(N&&(x.unobserve(N),f.current=!1),P&&x.observe(P))},[x]),[_,D]=_a(T),v=Sr(n);return y.useEffect(()=>{!x||!_.current||(x.disconnect(),f.current=!1,x.observe(_.current))},[_,x]),y.useEffect(()=>(l({type:ht.RegisterDroppable,element:{id:r,key:i,disabled:o,node:_,rect:m,data:v}}),()=>l({type:ht.UnregisterDroppable,key:i,id:r})),[r]),y.useEffect(()=>{o!==h.current.disabled&&(l({type:ht.SetDroppableDisabled,id:r,key:i,disabled:o}),h.current.disabled=o)},[r,i,o,l]),{active:c,rect:m,isOver:(u==null?void 0:u.id)===r,node:_,over:u,setNodeRef:D}}function Xu(t,n,o){const r=t.slice();return r.splice(o<0?r.length+o:o,0,r.splice(n,1)[0]),r}function R2(t,n){return t.reduce((o,r,a)=>{const i=n.get(r);return i&&(o[a]=i),o},Array(t.length))}function Zr(t){return t!==null&&t>=0}function D2(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==n[o])return!1;return!0}function M2(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Ku=t=>{let{rects:n,activeIndex:o,overIndex:r,index:a}=t;const i=Xu(n,r,o),c=n[a],l=i[a];return!l||!c?null:{x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height}},Gr={scaleX:1,scaleY:1},Ju=t=>{var n;let{activeIndex:o,activeNodeRect:r,index:a,rects:i,overIndex:c}=t;const l=(n=i[o])!=null?n:r;if(!l)return null;if(a===o){const d=i[c];return d?{x:0,y:o<c?d.top+d.height-(l.top+l.height):d.top-l.top,...Gr}:null}const u=N2(i,a,o);return a>o&&a<=c?{x:0,y:-l.height-u,...Gr}:a<o&&a>=c?{x:0,y:l.height+u,...Gr}:{x:0,y:0,...Gr}};function N2(t,n,o){const r=t[n],a=t[n-1],i=t[n+1];return r?o<n?a?r.top-(a.top+a.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):a?r.top-(a.top+a.height):0:0}const Qu="Sortable",ed=y.createContext({activeIndex:-1,containerId:Qu,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ku,disabled:{draggable:!1,droppable:!1}});function td(t){let{children:n,id:o,items:r,strategy:a=Ku,disabled:i=!1}=t;const{active:c,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:h}=P2(),f=Rr(Qu,o),m=l.rect!==null,g=y.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),S=c!=null,p=c?g.indexOf(c.id):-1,I=d?g.indexOf(d.id):-1,w=y.useRef(g),C=!D2(g,w.current),x=I!==-1&&p===-1||C,T=M2(i);En(()=>{C&&S&&h(g)},[C,g,S,h]),y.useEffect(()=>{w.current=g},[g]);const _=y.useMemo(()=>({activeIndex:p,containerId:f,disabled:T,disableTransforms:x,items:g,overIndex:I,useDragOverlay:m,sortedRects:R2(g,u),strategy:a}),[p,f,T.draggable,T.droppable,x,g,I,u,m,a]);return y.createElement(ed.Provider,{value:_},n)}const B2=t=>{let{id:n,items:o,activeIndex:r,overIndex:a}=t;return Xu(o,r,a).indexOf(n)},F2=t=>{let{containerId:n,isSorting:o,wasDragging:r,index:a,items:i,newIndex:c,previousItems:l,previousContainerId:u,transition:d}=t;return!d||!r||l!==i&&a===c?!1:o?!0:c!==a&&n===u},j2={duration:200,easing:"ease"},nd="transform",O2=jo.Transition.toString({property:nd,duration:0,easing:"linear"}),H2={roleDescription:"sortable"};function V2(t){let{disabled:n,index:o,node:r,rect:a}=t;const[i,c]=y.useState(null),l=y.useRef(o);return En(()=>{if(!n&&o!==l.current&&r.current){const u=a.current;if(u){const d=qo(r.current,{ignoreTransform:!0}),h={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(h.x||h.y)&&c(h)}}o!==l.current&&(l.current=o)},[n,o,r,a]),y.useEffect(()=>{i&&c(null)},[i]),i}function od(t){let{animateLayoutChanges:n=F2,attributes:o,disabled:r,data:a,getNewIndex:i=B2,id:c,strategy:l,resizeObserverConfig:u,transition:d=j2}=t;const{items:h,containerId:f,activeIndex:m,disabled:g,disableTransforms:S,sortedRects:p,overIndex:I,useDragOverlay:w,strategy:C}=y.useContext(ed),x=U2(r,g),T=h.indexOf(c),_=y.useMemo(()=>({sortable:{containerId:f,index:T,items:h},...a}),[f,a,T,h]),D=y.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:v,node:P,isOver:N,setNodeRef:M}=E2({id:c,data:_,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...u}}),{active:q,activatorEvent:j,activeNodeRect:G,attributes:H,setNodeRef:ce,listeners:he,isDragging:me,over:Ce,setActivatorNodeRef:ye,transform:$}=k2({id:c,data:_,attributes:{...H2,...o},disabled:x.draggable}),Y=dI(M,ce),ne=!!q,oe=ne&&!S&&Zr(m)&&Zr(I),O=!w&&me,X=O&&oe?$:null,ie=oe?X??(l??C)({rects:p,activeNodeRect:G,activeIndex:m,overIndex:I,index:T}):null,ue=Zr(m)&&Zr(I)?i({id:c,items:h,activeIndex:m,overIndex:I}):T,z=q==null?void 0:q.id,J=y.useRef({activeId:z,items:h,newIndex:ue,containerId:f}),ke=h!==J.current.items,V=n({active:q,containerId:f,isDragging:me,isSorting:ne,id:c,index:T,items:h,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:d,wasDragging:J.current.activeId!=null}),xe=V2({disabled:!V,index:T,node:P,rect:v});return y.useEffect(()=>{ne&&J.current.newIndex!==ue&&(J.current.newIndex=ue),f!==J.current.containerId&&(J.current.containerId=f),h!==J.current.items&&(J.current.items=h)},[ne,ue,f,h]),y.useEffect(()=>{if(z===J.current.activeId)return;if(z!=null&&J.current.activeId==null){J.current.activeId=z;return}const de=setTimeout(()=>{J.current.activeId=z},50);return()=>clearTimeout(de)},[z]),{active:q,activeIndex:m,attributes:H,data:_,rect:v,index:T,newIndex:ue,items:h,isOver:N,isSorting:ne,isDragging:me,listeners:he,node:P,overIndex:I,over:Ce,setNodeRef:Y,setActivatorNodeRef:ye,setDroppableNodeRef:M,setDraggableNodeRef:ce,transform:xe??ie,transition:le()};function le(){if(xe||ke&&J.current.newIndex===T)return O2;if(!(O&&!As(j)||!d)&&(ne||V))return jo.Transition.toString({...d,property:nd})}}function U2(t,n){var o,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(o=t==null?void 0:t.draggable)!=null?o:n.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:n.droppable}}Ee.Down,Ee.Right,Ee.Up,Ee.Left;function $2({product:t,children:n}){const{attributes:o,listeners:r,setNodeRef:a,transform:i,transition:c,isDragging:l}=od({id:t.id}),u={transform:jo.Transform.toString(i),transition:c};return s.jsx("div",{ref:a,style:u,className:`${Qe.product} ${l?Qe.dragging:""}`,...o,...r,children:n})}const rd=t=>{const{isActiveItems:n,setIsActiveItems:o,items:r,setItems:a,other:i,title:c,subtitle:l,editable:u=!0,draggable:d=!1,withImage:h=!1,deletable:f=!0,addable:m=!0,itemsType:g,itemsPlaceholder:S="",itemsOptions:p,hasRangeSelector:I=!1,rangeSelectorOptions:w,modalOptions:C,addableOptions:x={},limit:T,autoInterval:_,tip:D,aspectRatio:v,setAspectRatio:P}=t,[N,M]=y.useState(null),[q,j]=y.useState({top:0,left:0}),[G,H]=y.useState(null),ce=y.useRef(null),[he,me]=y.useState(!1),Ce=Nu(Mu(qa,{activationConstraint:{distance:5}}));y.useEffect(()=>{if(N){const O=[...r].map(X=>X.id===N.id?N:X);a(O)}},[N]),y.useEffect(()=>{if(ce.current&&G){const O=ce.current.getBoundingClientRect().height,X=window.innerHeight;let K=G.top;K+O>X+window.scrollY-200&&(K=X+window.scrollY-O-200),K<0&&(K=10),j({top:K-30,left:G.left})}},[ce.current,G]);const ye=(O,X)=>{O.stopPropagation();const K=O.target.getBoundingClientRect();H({top:K.top+window.scrollY-70,left:K.left-(m?30:65)}),M(X),me(!0)},$=(O,X)=>{const K=[...r],ie={...O,id:Math.random().toString(36).substr(2,9)};K.splice(X+1,0,ie),a(K)};function Y(O){if(h)return O?s.jsx("img",{src:`https://imagedelivery.net/${O[0]}/w=1000`,alt:"image",width:16,height:16}):s.jsx(Z,{name:"Image",width:16,height:16,fill:"#757575"})}const ne=O=>{const{active:X,over:K}=O;if(K&&X.id!==K.id){const ie=r.findIndex(z=>z.id===X.id),ue=r.findIndex(z=>z.id===K.id);if(ie!==-1&&ue!==-1){const z=[...r],[J]=z.splice(ie,1);z.splice(ue,0,J),a(z)}}},oe=(O,X)=>{var ie,ue;const K=s.jsxs(s.Fragment,{children:[d&&s.jsx("div",{children:s.jsx(Z,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&p&&s.jsx(no,{onChange:z=>{const J=[...r],ke=p.find(xe=>xe.name["en-US"]===z);if(!ke)return;const V=J.map(xe=>xe.id===O.id?{...ke,name:{"en-US":z}}:xe);M({...O,name:{"en-US":z}}),a([...V])},value:O.name["en-US"],options:p.filter(z=>!r.find(J=>J.name["en-US"]===z.name["en-US"])).map(z=>z.name["en-US"]),leftAddonOptions:p.filter(z=>{var J;return((J=z.images)==null?void 0:J.length)>0}).map(z=>({value:z.name["en-US"],addon:Y(z.images)}))}),g==="selectInfiniteList"&&p&&s.jsx(Cs,{onChange:z=>{const J=[...r],ke=p.find(xe=>xe.name["en-US"]===z);if(!ke)return;const V=J.map(xe=>xe.id===O.id?{...ke,name:{"en-US":z}}:xe);M({...O,name:{"en-US":z}}),a([...V])},value:O.name["en-US"],options:p.filter(z=>!r.find(J=>J.name["en-US"]===z.name["en-US"])).map(z=>z.name["en-US"]),leftAddonOptions:p.filter(z=>{var J;return((J=z.images)==null?void 0:J.length)>0}).map(z=>({value:z.name["en-US"],addon:Y(z.images)}))}),g==="input"&&s.jsx(cn,{onChange:z=>{const ke=[...r].map(V=>V.id===O.id?{...O,name:{"en-US":z}}:V);a([...ke])},value:O.name["en-US"],placeholder:S}),g==="image"&&s.jsx(Lr,{onChange:z=>{const ke=[...r].map(V=>V.id===O.id?{...O,images:z}:V);a([...ke])},activeImage:(ie=r.find(z=>z.id===O.id))!=null&&ie.images?(ue=r.find(z=>z.id===O.id))==null?void 0:ue.images[0]:void 0,tip:D}),s.jsxs("div",{className:Qe.buttons,children:[T&&T>r.length&&m&&s.jsx("div",{className:Qe.deleteButton,children:s.jsx(Z,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{$(O,X)}})}),u&&s.jsx("div",{className:Qe.deleteButton,children:s.jsx(Z,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:z=>{ye(z,O)}})}),f&&s.jsx("div",{className:Qe.deleteButton,children:s.jsx(Z,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>a(r.filter(z=>z.id!==O.id))})})]})]});return d?s.jsx($2,{product:O,index:X,children:K},O.id):s.jsx("div",{className:Qe.product,children:K},O.id)};return s.jsxs("div",{className:Qe.productsBlock,children:[(c||n!==void 0)&&s.jsxs("div",{className:Qe.top,children:[c&&s.jsx("h3",{className:Qe.title,children:c}),n!==void 0&&s.jsx(Dn,{current:n,onChange:O=>o==null?void 0:o(O)})]}),N&&u&&C&&he&&s.jsx(sI,{ref:ce,activeItem:N,setActiveItem:M,popupPosition:q,modalOptions:C,setIsOpenModal:me}),(n===void 0||n)&&I&&w&&s.jsx(ad,{...w}),(n===void 0||n)&&s.jsxs("div",{className:Qe.products,children:[l&&s.jsx("h5",{className:Qe.subtitle,children:l}),d?s.jsx(Yu,{sensors:Ce,onDragEnd:ne,children:s.jsx(td,{items:r.map(O=>O.id),strategy:Ju,children:r.map((O,X)=>oe(O,X))})}):r.map((O,X)=>oe(O,X)),m&&s.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:s.jsx(Fo,{withoutHover:!0,className:te(Qe.button,{[Qe.disabled]:!!(T&&T<=r.length||r.length===(p==null?void 0:p.length))}),size:"s",disabled:!!(T&&T<=r.length||r.length===(p==null?void 0:p.length)),onClick:()=>{const O=[...r];let X=null;if(p){for(let K=0;K<p.length;K++)if(!r.find(ie=>ie.id===p[K].id)){X=p[K];break}}g==="select"&&p?O.push({name:X?X.name:p[0].name,id:(X==null?void 0:X.id)||p[0].id,...x}):g==="input"?O.push({name:{"en-US":""},id:Ge(),...x}):O.push({name:{"en-US":`Image ${r.length+1}`},id:Ge(),...x}),a(O)},style:{width:"fit-content"},children:s.jsxs("div",{className:Qe.addButton,children:[s.jsx("span",{children:"Add Option"}),s.jsx(Z,{name:"Plus",width:16,height:16})]})})})]}),v&&P&&s.jsx(no,{value:v,label:"Aspect Ratio",options:Object.keys(Ul),onChange:O=>P(O),leftAddonOptions:$l}),(n===void 0||n)&&i!==void 0&&s.jsx(Au,{otherTitle:"Other",items:i}),(n===void 0||n)&&_!==void 0&&s.jsx(cn,{label:_.title||"Auto scroll interval",type:"number",value:String(_.autoInterval),onChange:O=>_.setAutoInterval(Number(O)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},W2="_title_cx65i_1",q2="_subtitle_cx65i_5",Z2="_productsBlock_cx65i_14",G2="_top_cx65i_26",z2="_products_cx65i_14",Y2="_product_cx65i_14",X2="_button_cx65i_80",K2="_disabled_cx65i_91",J2="_buttons_cx65i_118",Q2="_modal_cx65i_125",e4="_link_cx65i_146",t4="_modalOptions_cx65i_152",n4="_addButton_cx65i_165",o4="_deleteButton_cx65i_180",r4="_closeIcon_cx65i_192",ho={title:W2,subtitle:q2,productsBlock:Z2,top:G2,products:z2,product:Y2,button:X2,disabled:K2,buttons:J2,modal:Q2,link:e4,modalOptions:t4,addButton:n4,deleteButton:o4,closeIcon:r4},a4=y.forwardRef((t,n)=>{const{activeItem:o,setActiveItem:r,popupPosition:a,modalOptions:i,setIsOpenModal:c}=t;return Ho(n,()=>{r(null),c(!1)}),s.jsxs("div",{ref:n,className:ho.modal,onClick:l=>{l.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[s.jsxs("div",{className:ho.top,children:[s.jsx("h3",{className:ho.title,children:o.name["en-US"]}),s.jsx("div",{className:ho.closeIcon,children:s.jsx(Z,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{r(null),c(!1)}})})]}),s.jsx("div",{className:ho.modalOptions,children:i.map(l=>{if(l.type==="image")return s.jsx(Lr,{label:"Put up an attractive image",activeImage:o[l.field],onChange:u=>{const d={...o,[l.field]:u};r(d)}},String(l.field));if(l.type==="text")return s.jsx(Ts,{isActiveText:!0,typesText:o[l.field.type],setTypesText:u=>{const d={...o,[l.field.type]:u};r(d)},alignText:o[l.field.alignText],setAlignText:u=>{const d={...o,[l.field.alignText]:u};r(d)},text:o[l.field.text]["en-US"]||"",setText:u=>{const d={...o,[l.field.text]:{"en-US":u}};r(d)},typeFont:o[l.field.type],setTypeFont:u=>{const d={...o,[l.field.type]:u};r(d)},subtitle:l.label});if(l.type==="input")return s.jsx(cn,{onChange:u=>{const d={...o,[l.field]:{"en-US":u}};r(d)},value:o[l.field]["en-US"]||"",label:l.label,placeholder:l.placeholder});if(l.type==="inputNumber")return s.jsx(cn,{onChange:u=>{const d={...o,[l.field]:u};r(d)},value:o[l.field]||"",label:l.label,placeholder:l.placeholder,type:"number"});if(l.type==="inputSwitch")return s.jsxs("div",{className:ho.link,children:[s.jsx(cn,{onChange:u=>{const d={...o,[l.field.text]:{"en-US":u}};r(d)},value:o[l.field.text]["en-US"]||"",label:l.inputLabel,placeholder:l.placeholder}),s.jsx(Dn,{current:!!o[l.field.switch]||!1,label:l.switchLabel,onChange:u=>{const d={...o,[l.field.switch]:u};r(d)}})]});if(l.type==="select")return s.jsx(no,{options:l.itemsOptions,onChange:u=>{const d={...o,[l.field]:u};r(d)},label:l.label,value:o[l.field]||"String",leftAddonOptions:l.leftAddonOptions})})})]})}),i4="_title_hvj8m_1",s4="_buttonsBlock_hvj8m_15",c4="_top_hvj8m_26",l4="_modal_hvj8m_120",u4="_options_hvj8m_146",d4="_closeIcon_hvj8m_154",Mo={title:i4,buttonsBlock:s4,top:c4,modal:l4,options:u4,closeIcon:d4},h4=y.forwardRef((t,n)=>{var x;const{activeButton:o,setActiveButton:r,popupPosition:a,editableLink:i=!0}=t,[c,l]=y.useState(o.typesText),[u,d]=y.useState(o.destination),[h,f]=y.useState(o.page),[m,g]=y.useState(o.link||""),[S,p]=y.useState(o.text||{"en-US":""}),[I,w]=y.useState(o.openInNewTab),{pages:C}=qn();return Ho(n,()=>{r(null)}),y.useEffect(()=>{r({...o,...{text:S,link:m,destination:u,typesText:c,page:h,openInNewTab:I}})},[c,u,m,S,h,I]),s.jsxs("div",{className:Mo.modal,onClick:T=>{T.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},ref:n,children:[s.jsxs("div",{className:Mo.top,children:[s.jsx("h3",{className:Mo.title,children:o.type}),s.jsx("div",{className:Mo.closeIcon,children:s.jsx(Z,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>r(null)})})]}),s.jsxs("div",{className:Mo.options,children:[i&&s.jsx(no,{label:"Destination",onChange:T=>d(T),options:["Go to Page","Open Link"].filter(T=>T!==u),value:u}),i&&(u==="Go to Page"?s.jsx(no,{label:"Go to",onChange:T=>{if(T==="Sign In")f("/customer-dash");else if(C){for(const _ in C)if(C[_].name===T){f(C[_].path);break}}else f(Vl[0])},options:C?[...Object.values(C).filter(T=>T.path!==h).map(T=>T.name),"Sign In"]:["Sign In"],value:C?h==="/customer-dash"?"Sign In":((x=Object.values(C).find(T=>T.path===h))==null?void 0:x.name)||"Home":"Home"}):s.jsx(cn,{onChange:T=>g(T),value:m,placeholder:"https://",label:"Link"})),i&&s.jsx(Dn,{current:o.openInNewTab,label:"Open in new tab",onChange:T=>w(T)}),s.jsx(xs,{onChange:T=>p({"en-US":T}),value:S["en-US"],label:"Text"}),s.jsx(ws,{typesText:c,setTypesText:l})]})]})}),f4="_wrapper_m18qi_1",p4="_subtitle_m18qi_7",m4="_content_m18qi_14",g4="_range_m18qi_22",I4="_track_m18qi_27",C4="_progress_m18qi_36",S4="_dots_m18qi_46",y4="_dot_m18qi_46",v4="_active_m18qi_65",b4="_input_m18qi_77",w4="_countBlock_m18qi_91",x4="_controls_m18qi_107",_4="_button_m18qi_113",Lt={wrapper:f4,subtitle:p4,content:m4,range:g4,track:I4,progress:C4,dots:S4,dot:y4,active:v4,input:b4,countBlock:w4,controls:x4,button:_4},ad=t=>{const{label:n,min:o=1,max:r=4,step:a=1,count:i,setCount:c}=t,[l,u]=y.useState(!1),d=Array.from({length:(r-o)/a+1}),h=(i-o)/(r-o)*100,f=()=>{i<r&&c(i+a)},m=()=>{i>o&&c(i-a)},g=S=>{const p=o+S*a;c(p)};return s.jsxs("div",{className:Lt.wrapper,children:[n&&s.jsx("h5",{className:Lt.subtitle,children:n}),s.jsxs("div",{className:Lt.content,children:[s.jsxs("div",{className:Lt.range,children:[s.jsx("div",{className:Lt.track}),s.jsx("div",{className:Lt.progress,style:{width:`${h}%`}}),s.jsx("div",{className:Lt.dots,children:d.map((S,p)=>{const I=p<=(i-o)/a;return s.jsx("button",{onClick:()=>g(p),className:te(Lt.dot,{[Lt.active]:I,[Lt.inactive]:!I,[Lt.dragging]:l}),"aria-label":`Set value to ${o+p*a}`},p)})}),s.jsx("input",{type:"range",min:o,max:r,step:a,value:i,onChange:S=>c(Number(S.target.value)),onMouseDown:()=>u(!0),onMouseUp:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1),className:Lt.input})]}),s.jsxs("div",{className:Lt.countBlock,children:[s.jsx(cn,{type:"number",min:o,max:r,paddingless:!0,onChange:S=>{const p=Number(S);p>r?c(r):p<o?c(o):c(p)},value:String(i)}),s.jsxs("div",{className:Lt.controls,children:[s.jsx("button",{onClick:f,disabled:i>=r,className:Lt.button,"aria-label":"Increment count",children:s.jsx(Z,{name:"CaretUp",width:15,height:15})}),s.jsx("button",{onClick:m,disabled:i<=o,className:Lt.button,"aria-label":"Decrement count",children:s.jsx(Z,{name:"CaretDown",width:15,height:15})})]})]})]})]})},T4="_title_11jyy_1",k4="_subtitle_11jyy_5",P4="_productsBlock_11jyy_14",L4="_top_11jyy_26",A4="_products_11jyy_14",E4="_product_11jyy_14",R4="_button_11jyy_80",D4="_buttons_11jyy_114",M4="_modal_11jyy_121",N4="_modalOptions_11jyy_148",B4="_addButton_11jyy_161",F4="_deleteButton_11jyy_176",j4="_closeIcon_11jyy_188",ir={title:T4,subtitle:k4,productsBlock:P4,top:L4,products:A4,product:E4,button:R4,buttons:D4,modal:M4,modalOptions:N4,addButton:B4,deleteButton:F4,closeIcon:j4},id=({render:t,block:n})=>t(n),sd=({settings:t,pageContext:n})=>{const{footer:o}=$n(),{settings:r}=_r(),{pageContext:a}=qn(),{footer:i}=vo();if(!i||!o)return null;const c=new i;return Object.keys(o).map(l=>{c[l]=o[l]}),c.renderBlock((t==null?void 0:t.blockSettings)||r,n||a)},cd=({settings:t,pageContext:n})=>{const{header:o}=$n(),{settings:r}=_r(),{pageContext:a}=qn(),{header:i}=vo();if(!i||!o)return null;const c=new i;return Object.keys(o).map(l=>{c[l]=o[l]}),c.renderBlock((t==null?void 0:t.blockSettings)||r,n||a)},ld=({settings:t,pageContext:n})=>{const{announcement:o}=$n(),{settings:r}=_r(),{pageContext:a}=qn(),{announcement:i}=vo();if(!i||!o)return null;const c=new i;return Object.keys(o).map(l=>{c[l]=o[l]}),c.renderBlock(t||r,n||a)},O4=async t=>{var i,c;const n=ct?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,o=gs.getState(),r=localStorage.getItem("shopPassword");if((i=o.general)!=null&&i.info.passwordProtected&&!r)return null;const a=`${Tu}/v2/shops/${n}/pages/${t}`+((c=o.general)!=null&&c.info.passwordProtected?`?password=${r}`:"");try{return await ze({url:a,withToken:!0,method:"get"})}catch(l){if(Oe.isAxiosError(l)&&l.response&&l.response.status===404)return null}},H4="_wrapper_5w9s8_1",V4={wrapper:H4},Ki=t=>{const{error:n}=t;return s.jsx("div",{className:V4.wrapper,children:n})},U4=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${nn}/v1/balance/top-up/${n}`;return await ze({url:o,method:"post",body:t,withToken:!1})},Zo=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${Pr}/v2/${n}/customers/${t}`;return await ze({url:o,withToken:!0,method:"get",typeToken:"customer"})},$4=()=>Zo("dash/info"),W4=()=>Zo("dash/dashboard/home"),q4=()=>Zo("rewards"),Z4=()=>Zo("balance"),G4=()=>Zo("balance/top-up/settings"),z4=()=>Zo("referral-system"),Ji=10,za=async({url:t,PageNumber:n})=>{var c;const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${Pr}/v2/${o}/${t}?PageNumber=${n}&PageSize=${Ji}`,a=await ze({url:r,withToken:!0,method:"get",typeToken:"customer"}),i=Number((c=a.headers)==null?void 0:c["x-pagination-total"]);return{list:a.data,totalCount:i}},Y4="https://customers-api.billgang.com";var jt=(t=>(t.Home="Home",t.Orders="Orders",t.Rewards="Rewards",t.Balance="Balance",t.Subscriptions="Subscriptions",t.Tickets="Tickets",t))(jt||{});const X4=[{caption:"Share link",description:"Send the link to your friends in all convenient ways"},{caption:"Purchase",description:"They buy a product from our store"},{caption:"Percentages",description:"You get rewards"}],ln=Fe(t=>({route:jt.Home,setRoute:n=>t(()=>({route:n})),dashInfo:null,setDashInfo:n=>t(()=>({dashInfo:n})),balance:null,setBalance:n=>t(()=>({balance:n})),otpRequest:{requested:!1,email:""},setOtpRequest:n=>t(()=>({otpRequest:n})),balanceSettings:null,setBalanceSettings:n=>t(()=>({balanceSettings:n})),gatewaysDetail:null,setGatewaysDetail:n=>t(()=>({gatewaysDetail:n}))})),_o=Fe(t=>({token:localStorage.getItem("token")||null,setToken:n=>t(()=>({token:n})),shopDomain:"",setShopDomain:n=>t(()=>({shopDomain:n})),shopId:"",setShopId:n=>t(()=>({shopId:n})),shopPassword:localStorage.getItem("shopPassword")||"",setShopPassword:n=>t(()=>({shopPassword:n})),shopGeneral:null,setShopGeneral:n=>t(()=>({shopGeneral:n})),shopTerms:null,setShopTerms:n=>t(()=>({shopTerms:n})),shopPrivacyPolicy:null,setShopPrivacyPolicy:n=>t(()=>({shopPrivacyPolicy:n})),shopRefundPolicy:null,setShopRefundPolicy:n=>t(()=>({shopRefundPolicy:n}))}));class sr extends Error{}sr.prototype.name="InvalidTokenError";function K4(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,o)=>{let r=o.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function J4(t){let n=t.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return K4(n)}catch{return atob(n)}}function ud(t,n){if(typeof t!="string")throw new sr("Invalid token specified: must be a string");n||(n={});const o=n.header===!0?0:1,r=t.split(".")[o];if(typeof r!="string")throw new sr(`Invalid token specified: missing part #${o+1}`);let a;try{a=J4(r)}catch(i){throw new sr(`Invalid token specified: invalid base64 for part #${o+1} (${i.message})`)}try{return JSON.parse(a)}catch(i){throw new sr(`Invalid token specified: invalid json for part #${o+1} (${i.message})`)}}const Q4={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null};let No=null;const Qc=localStorage.getItem("token");if(Qc)try{No=ud(JSON.parse(Qc)||"")}catch{No=null}const Un=Fe(t=>({cart:{...Q4,customerEmail:No?No.email:""},products:[],coupon:null,pending:!1,applyCouponPending:!1,customerEmail:No?No.email:"",recaptcha:"",priceAdjusment:null,setCart:n=>t(o=>({cart:typeof n=="function"?n(o.cart):n})),setProducts:n=>t(o=>({products:typeof n=="function"?n(o.products):n})),setRecaptcha:n=>t({recaptcha:n}),setCoupon:n=>t({coupon:n}),setPending:n=>t({pending:n}),setApplyCouponPending:n=>t({applyCouponPending:n}),setCustomerEmail:n=>t({customerEmail:n}),setPriceAdjustment:n=>t({priceAdjusment:n})})),Dr=Fe(t=>({page:1,setPage:n=>t(()=>({page:n}))})),eC=Fe(t=>({discordInfo:null,setDiscordInfo:n=>t(()=>({discordInfo:n}))})),tC=Fe(t=>({subscription:null,setSubscription:n=>t({subscription:n})})),Ms=async(t,n="get",o)=>{const r=ct?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${nn}/v1/orders/${r}/${t}`;return await ze({url:a,method:n,withToken:!0,body:o,typeToken:"customer"})},nC=t=>Ms("","post",t),oC=({PageNumber:t})=>za({url:"customers/orders",PageNumber:t}),rC=t=>Ms(t),aC=t=>Ms(t),iC=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${nn}/v1/${n}/subscriptions`;return await ze({url:o,method:"post",withToken:!1,body:t})},sC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v2/${o}/subscriptions/${t}/${n}`;return await ze({url:r,method:"get",withToken:!1})},cC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v1/${o}/subscriptions/${t}/${n}/upgrades`;return await ze({url:r,method:"get",withToken:!1})},lC=async(t,n,o)=>{const r=ct?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${nn}/v1/${r}/subscriptions/${t}/${n}/cancel`;return await ze({url:a,method:"post",withToken:!1,body:o})},uC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v2/${o}/subscriptions/${t}/change-gateway`;return await ze({url:r,method:"post",withToken:!1,body:{gateway:n}})},dC=({PageNumber:t})=>za({url:"customers/subscriptions",PageNumber:t}),hC=async({id:t,accessToken:n})=>await cC(t,n),fC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v2/${o}/subscriptions/${t}/order`;return await ze({url:r,method:"post",withToken:!1,body:n})},pC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v1/public/${o}/tickets/${t}/${n}`;return await ze({url:r,method:"get",withToken:!1})},mC=async(t,n,o,r)=>{const a=ct?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${nn}/v1/public/${a}/tickets/${t}/${n}/answer`;return(await ze({url:i,method:"post",body:{message:o,recaptcha:r},withToken:!1})).data},gC=({PageNumber:t})=>za({url:"customers/tickets",PageNumber:t}),IC=({PageNumber:t})=>za({url:"customers/balance/transactions",PageNumber:t}),dd=async t=>{const n=t.map(i=>["names",i]),o=new URLSearchParams(n),r=ct?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${nn}/v2/gateways?shopDomain=${r}&${o.toString()}`;return await ze({url:a,method:"get",withToken:!1})},CC=async({email:t,recaptcha:n})=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${Pr}/v2/${o}/auth/otp/request`;return(await ze({url:r,body:{email:t,recaptcha:n},method:"post",withToken:!1})).data?{requested:!0,email:t}:{requested:!1,email:void 0}},SC=async({email:t,otp:n,recaptcha:o})=>{const r=ct?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${Pr}/v2/${r}/auth/otp/login`,{data:i}=await ze({url:a,method:"post",body:{email:t,otp:n,recaptcha:o},withToken:!1});return _o.getState().setToken(i.data),localStorage.setItem("token",i.data),{token:i.data,requested:!1}},yC=async()=>{_o.getState().setToken(""),localStorage.removeItem("token")},vC=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${nn}/v2/coupons/${n}/validate`;return await ze({url:o,method:"post",body:t,withToken:!1})},bC=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${Y4}/v2/${n}/customers/referral-system/signup`;return(await ze({url:o,withToken:!0,method:"post",body:t,typeToken:"customer"})).data},wC=async()=>{const{data:t}=await z4();return t},xC=async t=>{const{data:n}=await bC(t);return n};async function _C(t){const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${Pr}/v2/${n}/customers/rewards/${t.id}/claim`;return ze({url:o,method:"post",withToken:!0,typeToken:"customer"})}const Ii="Balance",TC={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},kC={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null},el=(t,n)=>{var d;const{productId:o,productVariantId:r,quantity:a,chargeType:i}=n,c=t.find(h=>h.id===o);if(!c)throw new Error("Product does not exist");const l=c.variants.find(h=>h.id===r);if(!l)throw new Error("Variant does not exist");if(i==="RECURRING"&&!l.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(a!==void 0&&((d=l.quantity)!=null&&d.available)&&l.quantity.available<a)throw new Error("Not enough quantity available");const u=Un.getState().cart;if(u.parts.length>0){const h=t.find(m=>m.id===u.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===u.parts[0].productVariantId);if(f&&l.price.currency!==f.price.currency)throw new Error("Product have different currency")}return l},PC=(t,n)=>t.reduce((o,r)=>{var d,h;const a=n.find(f=>(f==null?void 0:f.id)===r.productId),i=a==null?void 0:a.variants.find(f=>f.id===r.productVariantId),{gateway:c}=Un.getState().cart,l=(i==null?void 0:i.gateways)||[],u=l.some(f=>f.name===c&&f.overrodePrice)?(d=l.find(f=>f.name===c))==null?void 0:d.overrodePrice:null;return r.chargeType==="ONE_TIME"?o+((u==null?void 0:u.amount)||(i==null?void 0:i.price.amount)||0)*r.quantity:i!=null&&i.subscriptionSettings?o+i.subscriptionSettings.price.amount+(((h=i.subscriptionSettings.entryFee)==null?void 0:h.amount)||0):o},0),LC=(t,n)=>({isRequired:n.some(r=>{var i;const a=t.find(c=>(c==null?void 0:c.id)===r.productId);return(i=a==null?void 0:a.variants.find(c=>c.id===r.productVariantId))==null?void 0:i.discordSettings.isRequired}),isEnabled:n.some(r=>{var i;const a=t.find(c=>(c==null?void 0:c.id)===r.productId);return(i=a==null?void 0:a.variants.find(c=>c.id===r.productVariantId))==null?void 0:i.discordSettings.isEnabled})}),tl=t=>new Set(t.gateways.map(n=>n.name)),nl={availableGateways:[],requiresSignInGateways:[]},ol=(t,n)=>{var i;if(n.length===0)return nl;const o=(i=n[0])==null?void 0:i.variants[0];if(!o)return nl;const r=tl(o);for(const c of t){const l=n.find(h=>h.id===c.productId);if(!l)continue;const u=l.variants.find(h=>h.id===c.productVariantId);if(!u)continue;const d=tl(u);for(const h of r)d.has(h)||r.delete(h)}return!localStorage.getItem("token")&&r.has(Ii)?(r.delete(Ii),{availableGateways:[...r],requiresSignInGateways:[Ii]}):{availableGateways:[...r],requiresSignInGateways:[]}},AC=(t,n)=>{if(t.length===0)return[];const r=t.map(i=>{const c=n.find(u=>u.id===i.productId),l=c==null?void 0:c.variants.find(u=>u.id===i.productVariantId);return(l==null?void 0:l.customFields)??[]}).flat().reduce((i,c)=>{const l=i[c.name];return l?(c.required&&!l.required&&(i[c.name]={...c,value:c.defaultValue}),i):(i[c.name]={...c,value:c.defaultValue},i)},{});return Object.values(r).map(i=>({...i,value:""}))},EC=(t,n)=>{const o=n.find(a=>a.id===t.productId),r=o==null?void 0:o.variants.find(a=>a.id===t.productVariantId);return t.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},RC=()=>{const{cart:t,products:n,coupon:o,pending:r,applyCouponPending:a,customerEmail:i,setCart:c,setProducts:l,setCoupon:u,setPending:d,setApplyCouponPending:h}=Un(),f=async p=>{var v;h(!0);const{cart:I}=Un.getState(),{gateway:w,parts:C}=I,{notifications:x,setNotifications:T}=Et.getState();w||(h(!1),T([...x,{message:"There should be a gateway for the coupon",status:"error",id:Ge()}]));const _=C.map(P=>P.productId);let D=null;try{const{data:P}=await vC({gateway:w,couponName:p,productIds:_});D=P.data,T([...x,{message:"Coupon is applied",status:"success",id:Ge()}]),c(N=>({...N,coupon:p}))}catch(P){const N=P;T([...x,{message:`Coupon is not applied: ${N.message}`,status:"error",id:Ge()}]),c(M=>({...M,coupon:null})),u(null),h(!1)}if(h(!1),(v=D==null?void 0:D.restrictToProductIds)!=null&&v.length&&!_.every(P=>{var N;return(N=D==null?void 0:D.restrictToProductIds)==null?void 0:N.includes(P)}))throw new Error("Coupon can't be applied to such products");return u(D),D},S={reset(){c({...kC})},addProducts:p=>{const I=Un.getState().products,w=p.filter(C=>!I.some(x=>x.id===C.id));l([...I,...w])},addProductToCart:p=>{const I=Un.getState().cart;try{el(n,p)}catch(C){throw new Error(C)}const w=I.parts.find(C=>C.productId===p.productId&&C.productVariantId===p.productVariantId&&C.chargeType===p.chargeType);if(w)return S.updateQuantityOfProduct({...w,quantity:(w.quantity||1)+(p.quantity||1),chargeType:p.chargeType});if(I.parts.length&&!ol([...I.parts,p],n).availableGateways.length)throw new Error("No common payment gateways available");c({...I,parts:[...I.parts,p]})},removeProduct({productId:p,productVariantId:I}){c(w=>({...w,parts:w.parts.filter(C=>C.productId!==p||C.productVariantId!==I)}))},getPossibleGateways(){return ol(t.parts,n)},removeCoupon(){u(null)},getDiscordSettings(){return LC(n,t.parts)},updateQuantityOfProduct(p){el(n,p),c(I=>({...I,parts:I.parts.map(w=>w.productId===p.productId&&w.productVariantId===p.productVariantId?{...w,quantity:p.quantity,chargeType:p.chargeType}:w)}))},getTotalAndDiscount(){const{coupon:p}=Un.getState(),I=PC(t.parts,n);let w;return p&&p.discount&&(!p.isFixed&&p.discount===100?w=0:w=p.isFixed?Math.max(0,I-p.discount):I*(1-p.discount/100)),{total:I,totalWithDiscount:w}},setGateway(p){c(I=>({...I,gateway:p})),t.coupon&&f(t.coupon)},setPaymentMethod(p){c(I=>({...I,paymentMethod:p}))},async submitCart(p){d(!0);const{cart:I}=Un.getState();let w;if(I.parts&&i&&EC(I.parts[0],n))try{const{data:C}=await iC({...I,partOrder:I.parts[0],referralCode:localStorage.getItem("referralCode"),customerEmail:i,recaptcha:p,customFields:{...I.customFields}});w=C.data}catch(C){console.error(C)}else try{const{data:C}=await nC({...I,referralCode:localStorage.getItem("referralCode"),recaptcha:p,customFields:{...I.customFields}});w=C.data}catch(C){const{notifications:x,setNotifications:T}=Et.getState();T([...x,{message:`Failed to create order: ${C}`,status:"error",id:Ge()}])}if(d(!1),w)return w;throw new Error("Failed to create order")},setDiscordSocialConnectId(p){c(I=>({...I,discordSocialConnectId:p}))},setCustomFields(p){c(I=>({...I,customFields:{...p}}))}};return y.useEffect(()=>{c(p=>({...p,customerEmail:i??""}))},[i,c]),{cart:t,products:n,coupon:o,pending:r,applyCouponPending:a,applyCoupon:f,...S}},Ya=()=>{const{notifications:t,setNotifications:n}=Et();return o=>{navigator.clipboard.writeText(o),n([...t,{status:"success",message:"Successfully copied",id:Ge()}])}};function hd(t,n=!0){if(!t||typeof t!="string")return"";if(/<[a-z][\s\S]*>/i.test(t))return t;const r=t.split(" "),a=20;if(n){let i="",c=[];return r.forEach(l=>{l.length>a?(c.length>0&&(i+=`<span style="hyphens: manual">${c.join(" ")} </span>`,c=[]),i+=`<span style="hyphens: auto" lang="en">${l} </span>`):c.push(l)}),c.length>0&&(i+=`<span style="hyphens: manual">${c.join(" ")}</span>`),i}else{const i=[];let c=[],l=0;return r.forEach(u=>{u.length>a?(c.length>0&&(i.push(s.jsxs("span",{style:{hyphens:"manual"},children:[c.join(" ")," "]},l++)),c=[]),i.push(s.jsxs("span",{style:{hyphens:"auto"},lang:"en",children:[u," "]},l++))):c.push(u)}),c.length>0&&i.push(s.jsx("span",{style:{hyphens:"manual"},children:c.join(" ")},l++)),i}}const DC=y.forwardRef((t,n)=>{const{activeItem:o,setActiveItem:r,popupPosition:a,setIsOpenModal:i,itemsOptions:c}=t,l=c.find(u=>u.id===o.listingId);return Ho(n,()=>{r(null),i(!1)}),l?s.jsxs("div",{className:ir.modal,onClick:u=>{u.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[s.jsxs("div",{className:ir.top,children:[s.jsx("h3",{dangerouslySetInnerHTML:{__html:hd(l.productData.name)}}),s.jsx("div",{className:ir.closeIcon,children:s.jsx(Z,{name:"X",height:20,width:20,onClick:()=>{i(!1),r(null)}})})]}),s.jsx("div",{className:ir.modalOptions,children:s.jsx(Lr,{label:"Put up an attractive image",activeImage:l.productData.images.length>0?l.productData.images[0].cfId:o.image?o.image:void 0,onChange:u=>{const d={...o,image:u[0]};r(d)}})})]}):null}),MC="_wrapper_235d9_1",NC="_label_235d9_9",BC="_input_235d9_18",FC="_disabled_235d9_31",jC="_paddingless_235d9_36",OC="_content_235d9_40",HC="_contentBorder_235d9_53",VC="_contentField_235d9_58",UC="_borderless_235d9_62",$C="_rightIcon_235d9_67",WC="_leftIcon_235d9_75",qC="_requiredStar_235d9_82",Ht={wrapper:MC,label:NC,input:BC,disabled:FC,paddingless:jC,content:OC,contentBorder:HC,contentField:VC,borderless:UC,rightIcon:$C,leftIcon:WC,requiredStar:qC},xo=t=>{const{onChange:n,style:o,label:r,value:a,type:i="text",min:c,max:l,placeholder:u,disabled:d=!1,required:h=!1,regex:f,paddingless:m=!1,borderless:g=!1,editable:S=!1,isSearch:p=!1,centered:I=!1,maxSymbols:w,rightIcon:C,onFocus:x,leftIcon:T}=t,{themeSettings:_}=bo(),{inputs:D}=_,[v,P]=y.useState(!1);function N(q){if(Number(q)<0)return String(c);const j=q.replace(/[^\d-]/g,"");return Number(j)<0?String(c):j}function M(q){return!h||!f?!0:new RegExp(f).test(q)}return s.jsxs("div",{className:Ht.wrapper,children:[r&&s.jsxs("label",{className:Ht.label,htmlFor:r,children:[r,h&&s.jsx("span",{className:Ht.requiredStar,children:"*"})]}),s.jsxs("div",{className:te(Ht.content,{[Ht.contentBorder]:D.border.active,[Ht.contentField]:D.field.active,[Ht.disabled]:d}),style:{...o},children:[T&&s.jsx("div",{className:Ht.leftIcon,children:T}),s.jsx("input",{maxLength:w,id:r,type:i||"text",onChange:q=>{if(i==="text")n(q.target.value);else{const j=N(q.target.value);n(j)}},value:a,autoComplete:"off",placeholder:u||"Type something...",className:te(Ht.input,{[Ht.required]:v&&h&&!M(a),[Ht.paddingless]:m,[Ht.borderless]:g}),min:i==="number"?c:void 0,max:i==="number"?l:void 0,onFocus:()=>{x&&x(),P(!0)},disabled:d,style:{textAlign:I?"center":"left",padding:p?`7px ${Number(D.general.size)+20}px 7px ${T?35:11}px`:`7px ${C?35:11}px 7px ${T?35:11}px`}}),C&&s.jsx("div",{className:Ht.rightIcon,children:C}),p&&s.jsx("div",{className:Ht.rightIcon,children:s.jsx(Z,{name:"MagnifyingGlass",fill:"var(--text-secondary)",width:D.general.size,height:D.general.size})}),S&&s.jsx("div",{children:s.jsx(Z,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},ZC="_button_3j1b9_1",GC="_primary_3j1b9_20",zC="_primaryHovered_3j1b9_30",YC="_secondary_3j1b9_35",XC="_secondaryHovered_3j1b9_45",KC="_tertiary_3j1b9_50",JC="_special_3j1b9_60",QC="_tertiaryHovered_3j1b9_64",e0="_content_3j1b9_69",On={button:ZC,primary:GC,primaryHovered:zC,secondary:YC,secondaryHovered:XC,tertiary:KC,special:JC,tertiaryHovered:QC,content:e0},t0=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,fd=({children:t,className:n,as:o="span",...r})=>{const[a,i]=y.useState(!1);return y.useEffect(()=>{typeof window<"u"&&i(t0())},[]),a?s.jsx(o,{className:n,...r,"data-stable-text":t,dangerouslySetInnerHTML:{__html:""}}):s.jsx(o,{className:n,...r,children:t})},st=t=>{const{children:n,onClick:o,style:r,className:a,disabled:i=!1,type:c="Primary",dangerouslySetInnerHTML:l}=t,{themeSettings:u}=bo(),d=S=>typeof S=="string"?s.jsx(fd,{children:S}):S,h={onClick:o,disabled:i,style:r,className:te(On.button,a,{[On.primary]:c==="Primary",[On.secondary]:c==="Secondary",[On.tertiary]:c==="Tertiary",[On.primaryHovered]:c==="Primary"&&!i&&u.buttons.primary.hover,[On.secondaryHovered]:c==="Secondary"&&!i&&u.buttons.secondary.hover,[On.tertiaryHovered]:c==="Tertiary"&&!i&&u.buttons.tertiary.hover})};if(c==="Special")return s.jsx("button",{...h,className:On.special,...l?{dangerouslySetInnerHTML:l}:{children:d(n)}});const f=c.toLowerCase(),m=u.buttons[f],g=c==="Tertiary"?s.jsxs("div",{className:On.content,children:[d(n),s.jsx(Z,{name:"ArrowRight",fill:"var(--text-tertiary)",width:20,height:20})]}):d(n);return s.jsx("button",{...h,style:{...r,textAlign:m.alignment},...l?{dangerouslySetInnerHTML:l}:{children:g}})},An=(t,n="auto")=>t==="not found"?"empty":`https://imagedelivery.net/${t}/w=${n}`,Zt=t=>{const n=new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD"});let o=t.amount;return t.quantity&&(o=o*t.quantity),n.format(o)},n0=(t,n)=>{if(t===0)throw new Error("Old value cannot be zero, as it would result in division by zero.");return(n-t)/Math.abs(t)*100},o0=t=>{if(Math.abs(t-365)<=15){const i=Math.round(t/365);return i===1?"year":`${i} years`}else if(Math.abs(t-30)<=5){const i=Math.round(t/30);return i===1?"month":`${i} months`}else return`${t} days`},r0=t=>new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),vr=t=>{const n=new Date(t),o={day:"2-digit",month:"2-digit",year:"numeric"},r={hour:"2-digit",minute:"2-digit"},a=n.toLocaleString("en-US",o),i=n.toLocaleString("en-US",r);return[a,i]},a0=t=>{const n=window.localStorage.getItem(t);if(n===null)return null;try{return JSON.parse(n)}catch{return n}},i0=(t,n)=>{(n===null||typeof n!="object")&&window.localStorage.setItem(t,String(n));const o=JSON.stringify(n);window.localStorage.setItem(t,o)},s0="_modal_1iz94_1",c0="_padding_1iz94_17",l0="_content_1iz94_21",u0="_close_1iz94_42",zr={modal:s0,padding:c0,content:l0,close:u0},Xa=t=>{const{close:n,children:o,withAnimation:r=!0,hasPadding:a=!0}=t,{isOpen:i,setIsOpen:c}=Zn(),l=()=>{c(!1),r?setTimeout(()=>{n(!1),c(!0)},300):(n(!1),c(!0))};return y.useEffect(()=>{const u=d=>{d.key==="Escape"&&l()};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[]),go.createPortal(s.jsx("div",{className:te(zr.modal,{[zr.padding]:a}),onClick:l,children:r?s.jsx("div",{className:te(zr.content,{[zr.close]:!i}),children:o}):s.jsx(s.Fragment,{children:o})}),document.body)},pd=({children:t,path:n,className:o,target:r="_self",id:a})=>{if(window.location.pathname.includes("/admin/builder"))return s.jsx("div",{className:o,role:"link",style:{cursor:"pointer"},id:a,children:t});const i=Rn(),c=/^https?:\/\//.test(n),l=u=>{c||r==="_blank"?r==="_blank"?window.open(n,"_blank"):window.open(n,"_self"):(u.preventDefault(),i(n,{replace:!1}))};return s.jsx("div",{onClick:l,className:o,role:"link",style:{cursor:"pointer"},id:a,children:t})},d0="_loader_3je9m_1",h0={loader:d0},un=t=>s.jsx("div",{className:h0.loader,...t}),f0="_container_6vcrl_1",p0="_wrapper_6vcrl_5",rl={container:f0,wrapper:p0};class m0{constructor(){Xo(this,"observer",null);Xo(this,"callbacks",new Map);Xo(this,"handleWindowResize",()=>{this.callbacks.forEach((n,o)=>{const r=o.getBoundingClientRect().width;n.forEach(a=>a(r))})});this.observer=new ResizeObserver(n=>{var o;for(const r of n){const a=r.contentRect.width,i=r.target;this.callbacks.has(i)&&((o=this.callbacks.get(i))==null||o.forEach(c=>c(a)))}}),window.addEventListener("resize",this.handleWindowResize)}observe(n,o){var a;if(!this.observer)return;this.callbacks.has(n)||(this.callbacks.set(n,[]),this.observer.observe(n)),(this.callbacks.get(n)||[]).includes(o)||(a=this.callbacks.get(n))==null||a.push(o)}unobserve(n,o){var r;if(!(!this.observer||!this.callbacks.has(n))){if(o){const a=this.callbacks.get(n)||[];this.callbacks.set(n,a.filter(i=>i!==o))}(r=this.callbacks.get(n))!=null&&r.length||(this.callbacks.delete(n),this.observer.unobserve(n))}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callbacks.clear(),window.removeEventListener("resize",this.handleWindowResize)}}const al=new m0;function md(t){const[n,o]=y.useState("desktop");return y.useEffect(()=>{const r=t.current;if(!r)return;const a=l=>l>=1081?"desktop":l>=720?"tablet":"mobile",i=l=>{const u=a(l);o(u)};al.observe(r,i);const c=r.getBoundingClientRect().width;return i(c),()=>{al.unobserve(r,i)}},[t]),n}const Yr=16,gd=({children:t,padding:n,style:o,notPadding:r=!1})=>{const a=y.useRef(null),i=md(a);return s.jsx("div",{className:rl.container,ref:a,style:o,children:s.jsx("div",{className:rl.wrapper,style:{maxWidth:"var(--max-width-store)",paddingTop:i==="desktop"?n==null?void 0:n.top:r?0:Yr,paddingBottom:i==="desktop"?n==null?void 0:n.bottom:r?0:Yr,paddingLeft:i==="desktop"?n==null?void 0:n.left:r?0:Yr,paddingRight:i==="desktop"?n==null?void 0:n.right:r?0:Yr,...o},children:t(i)})})},g0="_wrapper_oxpf7_1",I0="_label_oxpf7_10",C0="_contentBorder_oxpf7_19",S0="_textarea_oxpf7_23",y0="_contentField_oxpf7_35",v0="_length_oxpf7_49",lo={wrapper:g0,label:I0,contentBorder:C0,textarea:S0,contentField:y0,length:v0},b0=t=>{const{onChange:n,label:o,value:r,maxLength:a,placeholder:i="Type something...",type:c="text",required:l=!1}=t,[u,d]=y.useState(r.length),{themeSettings:h}=bo();function f(m){return c==="number"?m.replace(/[^\d\n]+/g,""):m}return s.jsxs("div",{className:lo.wrapper,children:[o&&s.jsxs("label",{className:lo.label,htmlFor:o,children:[o,l&&s.jsx("span",{className:lo.requiredStar,children:"*"})]}),s.jsx("textarea",{id:o,value:r,onChange:m=>{const g=f(m.target.value);d(g.length),n(g)},placeholder:i,className:te(lo.textarea,{[lo.contentBorder]:h.inputs.border.active,[lo.contentField]:h.inputs.field.active}),maxLength:a}),a&&s.jsxs("div",{className:lo.length,children:[u,"/",a]})]})},w0="_wrapper_ty9h3_2",x0="_label_ty9h3_9",_0="_top_ty9h3_17",T0="_select_ty9h3_23",k0="_borderFocused_ty9h3_42",P0="_input_ty9h3_49",L0="_icon_ty9h3_59",A0="_rotate_ty9h3_64",E0="_content_ty9h3_68",R0="_options_ty9h3_72",D0="_filteredOptions_ty9h3_93",M0="_open_ty9h3_97",N0="_option_ty9h3_72",B0="_focused_ty9h3_115",F0="_addon_ty9h3_119",j0="_value_ty9h3_130",O0="_postfix_ty9h3_135",H0="_leftAddon_ty9h3_139",St={wrapper:w0,label:x0,top:_0,select:T0,borderFocused:k0,input:P0,icon:L0,rotate:A0,content:E0,options:R0,filteredOptions:D0,open:M0,option:N0,focused:B0,addon:F0,value:j0,postfix:O0,leftAddon:H0};function V0(t,n){y.useEffect(()=>{function o(r){!t.current||t.current.contains(r.target)||n(r)}return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[t,n])}const Id=t=>{var P,N;const{onChange:n,label:o,value:r,options:a,style:i,switcher:c,postfixs:l,leftAddonOptions:u}=t,[d,h]=y.useState(!1),[f,m]=y.useState(""),[g,S]=y.useState(null),[p,I]=y.useState(!1),w=y.useRef(null);V0(w,()=>h(!1));function C(M){m(""),n(M),h(!1),S(null)}function x(M,q){return M?M.length>q+3?`${M.slice(0,q)}...`:M:""}function T(M){if(!d){(M.key==="Enter"||M.key==="ArrowDown")&&h(!0);return}const q=v;M.key==="ArrowDown"&&(M.preventDefault(),S(j=>j===null||j===q.length-1?0:j+1)),M.key==="ArrowUp"&&(M.preventDefault(),S(j=>j===null||j===0?q.length-1:j-1)),M.key==="Enter"&&g!==null&&(M.preventDefault(),C(q[g])),M.key==="Escape"&&h(!1)}const _=y.useRef(null),D=y.useMemo(()=>new Gn(a,{threshold:.4,minMatchCharLength:2}),[a]),v=y.useMemo(()=>p&&f.trim()!==""?D.search(f).map(M=>M.item):a,[f,a,p,D]);return s.jsxs("div",{className:St.wrapper,style:{...i},children:[o&&s.jsxs("div",{className:St.top,children:[s.jsx("label",{className:St.label,htmlFor:o,children:o}),c&&s.jsx(Dn,{current:c.value,onChange:c.onChange})]}),s.jsxs("label",{className:St.content,ref:w,children:[s.jsxs("div",{className:te(St.select,{[St.borderFocused]:d}),onKeyDown:T,onClick:M=>{M.stopPropagation(),h(q=>!q),I(!1)},ref:_,tabIndex:0,children:[u&&u.length>0&&s.jsx("div",{className:St.addon,children:(P=u.find(M=>M.value===r))==null?void 0:P.addon}),s.jsx("div",{className:St.input,id:"md",children:x(r,15)}),s.jsx("div",{className:te(St.icon,{[St.rotate]:d}),onClick:M=>{M.stopPropagation(),h(q=>!q)},children:s.jsx(Z,{name:"CaretDown",width:16,height:16,fill:"var(--text-primary)"})})]}),s.jsxs("div",{className:te(St.options,{[St.open]:d}),style:{top:((N=_.current)==null?void 0:N.clientHeight)+10},children:[a.length>6&&s.jsx(xo,{type:"text",value:f,placeholder:"Search...",onChange:M=>{m(M),I(!0)},isSearch:!0}),s.jsxs("div",{className:St.filteredOptions,children:[v.map((M,q)=>{var j;return s.jsxs("div",{className:te(St.option,{[St.focused]:q===g}),onClick:()=>{C(M),h(!1)},id:"md",children:[u&&u.length>0&&s.jsx("div",{className:St.leftAddon,children:(j=u.find(G=>G.value===M))==null?void 0:j.addon}),s.jsx("span",{className:St.value,id:"md",children:x(M,20)}),l&&s.jsx("span",{className:St.postfix,id:"md",children:l[q]})]},M)}),v.length===0&&s.jsx("div",{children:"No results found."})]})]})]})]})},U0="_wrapper_2vleg_1",$0="_label_2vleg_9",W0="_options_2vleg_17",q0="_radioLabel_2vleg_23",Z0="_radio_2vleg_23",G0="_custom_2vleg_38",z0="_option_2vleg_17",uo={wrapper:U0,label:$0,options:W0,radioLabel:q0,radio:Z0,custom:G0,option:z0},Y0=t=>{const{defaultValue:n,options:o,onChange:r,label:a,flexDirection:i="row"}=t,[c,l]=y.useState(n),u=d=>{const h=d.target.value;l(h),r(h)};return s.jsxs("div",{className:uo.wrapper,children:[s.jsx("span",{className:uo.label,children:a}),s.jsx("div",{className:uo.options,style:{flexDirection:i},children:o.map(d=>s.jsxs("label",{className:uo.radioLabel,children:[s.jsx("input",{type:"radio",value:d.value,checked:c===d.value,onChange:u,className:uo.radio}),s.jsx("span",{className:uo.custom}),s.jsx("span",{className:uo.option,children:d.label})]},d.value))})]})},X0="_content_eonwv_1",K0="_main_eonwv_12",J0="_block_eonwv_16",Q0="_active_eonwv_22",e3="_name_eonwv_32",t3="_addSection_eonwv_109",n3="_addSectionTop_eonwv_117",Yn={content:X0,main:K0,block:J0,active:Q0,name:e3,addSection:t3,addSectionTop:n3},o3="_sidebar_xhqpt_1",r3="_content_xhqpt_14",a3="_button_xhqpt_24",i3="_moveButton_xhqpt_40",s3="_deleteButton_xhqpt_49",Tn={sidebar:o3,content:r3,button:a3,moveButton:i3,deleteButton:s3},c3=()=>{var _;const{activeBlock:t,setActiveBlock:n}=Fa(),{blocks:o,removeBlock:r,moveBlock:a,duplicateBlock:i,setCurrentBlock:c}=$n(),{currentPage:l,pages:u}=qn(),{setTitle:d,setDescription:h,setOnConfirm:f}=ql(),{setActiveBlock:m}=vo(),g=(_=u==null?void 0:u[l])==null?void 0:_.path,S=g?o[g]:null,p=(S==null?void 0:S.order)||[],I=p.indexOf(t.id),w=D=>{D.stopPropagation(),I>0&&g&&(a(g,I,I-1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},C=D=>{D.stopPropagation(),I<p.length-1&&g&&(a(g,I,I+1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},x=D=>{D.stopPropagation(),g&&i(g,t.id)},T=()=>{g&&(r(g,t.id),c(null),m(null),n({id:null,neededScroll:!1}))};return s.jsx("div",{className:Tn.sidebar,children:s.jsxs("div",{className:Tn.content,children:[s.jsx("button",{onClick:w,className:te(Tn.button,Tn.moveButton),disabled:I===0,children:s.jsx(Z,{name:"ArrowUp"})}),s.jsx("button",{onClick:C,className:te(Tn.button,Tn.moveButton),disabled:I===p.length-1,children:s.jsx(Z,{name:"ArrowDown"})}),s.jsx("button",{onClick:x,className:te(Tn.button,Tn.moveButton),children:s.jsx(Z,{name:"Copy"})}),s.jsx("button",{className:te(Tn.button,Tn.deleteButton),onClick:D=>{D.stopPropagation(),d("Remove Block"),h(`Are you sure you want to delete ${(S==null?void 0:S.data[t.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),f(T)},children:s.jsx(Z,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})};function cr(t,n){if(!n||!n[t])return"unknown name";const o=new n[t];return!o.blockSettings||!o.blockSettings.displayName?"unknown name":o.blockSettings.displayName}const l3=y.memo(({scrollableRef:t})=>{const{setActiveBlock:n,activeBlock:o,zoomLevel:r}=Fa(),{blocks:a,sourceBlocks:i}=vo(),{blocks:c,setCurrentBlock:l,currentBlock:u,setPositionBlock:d,announcement:h}=$n(),{settings:f}=_r(),{currentPage:m,pages:g,pageContext:S}=qn(),{activeBlock:p,setActiveBlock:I}=bo(),{setError:w}=Wl(),{setActiveBlock:C}=vo(),x=y.useRef(o.id),T=y.useRef({});y.useEffect(()=>{if(o.id&&o.neededScroll&&T.current[o.id]){const v=T.current[o.id];if(v&&t.current){const P=v.offsetTop;t.current.scrollTo({top:P-30,behavior:"smooth"})}}},[o,t]);const _=Rn();y.useEffect(()=>{x.current=o.id},[o.id]);const D=v=>{if(!v||!v.name)return w({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:g&&g[m].id?[g[m].id]:[]}),s.jsx(Ki,{error:"Block or block.name is undefined."});if(!a||!a[v.name])return w({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:g&&g[m].id?[g[m].id]:[]}),s.jsx(Ki,{error:`Block "${v.name}" does not exist in blocks.`});const P=new a[v.name];return v.value&&Object.assign(P,v.value),P.renderBlock(f==null?void 0:f.blockSettings,S)};return s.jsxs("div",{onClick:v=>{v.stopPropagation()},className:Yn.content,style:{width:"100%",height:"100%",zoom:`${r}`},ref:t,children:[h&&s.jsx(ld,{}),s.jsx(cd,{}),s.jsx("div",{className:Yn.main,children:g&&g[m]&&c[g[m].path]&&c[g[m].path].data&&c[g[m].path].order.map(v=>s.jsxs("div",{ref:P=>T.current[v]=P,onClick:P=>{P.stopPropagation(),C(null),p&&I(null),n({id:v,neededScroll:!0}),setTimeout(()=>{n({id:v,neededScroll:!1})},100),l(null),u?setTimeout(()=>{l(o.id)},100):l(o.id)},onMouseEnter:P=>{P.stopPropagation(),o.neededScroll||n({id:v,neededScroll:!1})},onMouseLeave:P=>{P.stopPropagation(),o.neededScroll||n({id:null,neededScroll:!1})},className:te(Yn.block),children:[(o.id===v||u===v)&&s.jsx("div",{className:Yn.active}),(o.id===v||u===v)&&s.jsx("div",{className:Yn.name,children:cr(c[g[m].path].data[v].name,i)}),(o.id===v||u===v)&&cr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx(c3,{}),(o.id===v||u===v)&&cr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx("div",{className:Yn.addSection,children:s.jsx(Fo,{onClick:P=>{P.stopPropagation(),d(v,!0),l(null),n({id:null,neededScroll:!1}),C(null),_("/admin/builder/add")},children:"Add Section"})}),(o.id===v||u===v)&&cr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx("div",{className:te(Yn.addSection,Yn.addSectionTop),children:s.jsx(Fo,{onClick:P=>{P.stopPropagation(),d(v,!1),l(null),n({id:null,neededScroll:!1}),C(null),_("/admin/builder/add")},children:"Add Section"})}),a&&s.jsx(id,{render:D,block:c[g[m].path].data[v]})]},v))}),s.jsx(sd,{})]})}),u3="_statItem_fzeec_1",d3="_content_fzeec_44",h3="_withChildren_fzeec_50",f3="_info_fzeec_56",p3="_iconWrapper_fzeec_68",m3="_text_fzeec_78",g3="_title_fzeec_84",I3="_value_fzeec_88",C3="_emptyImage_fzeec_94",S3="_image_fzeec_11",y3="_imageTitle_fzeec_112",v3="_emptyImageText_fzeec_122",b3="_hoverable_fzeec_147",dt={statItem:u3,content:d3,withChildren:h3,info:f3,iconWrapper:p3,text:m3,title:g3,value:I3,emptyImage:C3,image:S3,imageTitle:y3,emptyImageText:v3,hoverable:b3},rn=({iconName:t,title:n,value:o,image:r,imageName:a,children:i,className:c,logo:l,productSlug:u})=>{const d=Rn();return s.jsxs("div",{className:`${dt.statItem} ${c}`,children:[r&&r!=="empty"&&s.jsxs("div",{style:{position:"relative"},onClick:()=>{u&&d(`/${u}`)},children:[s.jsx("div",{style:{background:"#000000"},children:s.jsx("img",{src:r,alt:a,className:te(dt.image,dt.emptyImage,{[dt.hoverable]:u})})}),s.jsx("div",{className:dt.emptyImageText,children:s.jsx("div",{className:te(dt.title,dt.imageTitle),id:"h5",children:a})})]}),r==="empty"&&s.jsx("div",{style:{background:"#000000"},children:s.jsxs("div",{className:te(dt.emptyImage,{[dt.hoverable]:u}),onClick:()=>{u&&d(`/${u}`)},children:[s.jsx(Z,{name:"Image",width:64,height:64,fill:"var(--text-secondary)"}),s.jsx("div",{className:dt.emptyImageText,children:s.jsx("div",{className:dt.title,id:"h5",children:a||"No Product"})})]})}),s.jsxs("div",{className:`${dt.content} ${i?dt.withChildren:""}`,children:[s.jsxs("div",{className:dt.info,children:[l?s.jsx("div",{className:dt.iconWrapper,children:s.jsx("img",{src:l,width:28,height:28})}):s.jsx(Z,{name:t||"File",className:dt.iconWrapper,width:28,height:28,fill:"var(--text-action)"}),s.jsxs("div",{className:dt.text,children:[s.jsx("div",{className:dt.title,id:"h5",children:n}),s.jsx("div",{className:dt.value,id:"h5-bold",children:o})]})]}),i]})]})},w3="_card_10fve_2",x3="_mobile_10fve_15",_3="_email_10fve_19",T3="_balance_10fve_25",k3="_sidebar_10fve_32",P3="_navList_10fve_56",L3="_navItem_10fve_71",A3="_activeNavItem_10fve_84",E3="_inactiveNavItem_10fve_89",R3="_logoutNavItem_10fve_98",D3="_iconWrapper_10fve_107",M3="_skeleton_10fve_112",Dt={card:w3,mobile:x3,email:_3,balance:T3,sidebar:k3,navList:P3,navItem:L3,activeNavItem:A3,inactiveNavItem:E3,logoutNavItem:R3,iconWrapper:D3,skeleton:M3},N3=({email:t,balance:n,adaptiveStyles:o})=>s.jsxs("div",{className:te(Dt.card,{[Dt.mobile]:o!=="desktop"}),children:[s.jsx("div",{className:Dt.email,id:"h5",children:t}),s.jsxs("div",{className:Dt.balance,id:"md",children:["Balance: ",n]})]}),B3=[[jt.Home,"House"],[jt.Orders,"CurrencyCircleDollar"],[jt.Rewards,"Medal"],[jt.Balance,"Wallet"],[jt.Subscriptions,"CalendarCheck"],[jt.Tickets,"Question"]],il=({children:t,className:n="",onClick:o})=>s.jsx("button",{type:"button",className:te(Dt.navItem,n),onClick:o,children:t}),F3=({adaptiveStyles:t})=>{const{route:n,setRoute:o}=ln();return s.jsxs("div",{className:te(Dt.navList,{[Dt.mobile]:t!=="desktop"}),children:[B3.map(([r,a])=>{const i=r===n;return s.jsxs(il,{onClick:()=>o(r),className:te(i?Dt.activeNavItem:Dt.inactiveNavItem),children:[s.jsx("div",{className:Dt.iconWrapper,children:s.jsx(Z,{name:a})}),s.jsx("div",{children:r})]},r)}),s.jsxs(il,{className:Dt.logoutNavItem,onClick:()=>{yC()},children:[s.jsx("div",{className:Dt.iconWrapper,children:s.jsx(Z,{name:"SignOut"})}),s.jsx("div",{children:"Sign Out"})]})]})};var Te=(t=>(t.New="NEW",t.Pending="PENDING",t.Completed="COMPLETED",t.Cancelled="CANCELLED",t.Expired="EXPIRED",t.FullDeliveryFailure="FULL_DELIVERY_FAILURE",t.PartiallyDelivered="PARTIALLY_DELIVERED",t.Refunded="REFUNDED",t.Failed="FAILED",t))(Te||{}),Ne=(t=>(t.Text="TEXT",t.Serial="SERIALS",t.Ebook="EBOOK",t.Link="LINK",t.Download="DOWNLOAD",t.Discord="DISCORD",t.Custom="CUSTOM",t))(Ne||{}),Hn=(t=>(t.RIAL="RIAL",t.AWAITING_PAYMENT="AWAITING_PAYMENT",t.ACTIVE="ACTIVE",t.PAST_DUE="PAST_DUE",t.CANCELLED="CANCELLED",t.EXPIRED="EXPIRED",t.CHANGED_GATEWAY="CHANGED_GATEWAY",t.REPLACED="REPLACED",t))(Hn||{});const Mr=async t=>(await dd(t)).data,Cd=async()=>{var o;const n=(await G4()).data;if(n.isEnabled){const r=(o=n==null?void 0:n.topUpSettings)==null?void 0:o.gateways;r&&Mr(r)}return n},Ns=async()=>{const n=(await Z4()).data;return{amount:n.realBalance+n.manualBalance,currency:n.currency}};var lr=(t=>(t.ADDED="ADDED",t.REMOVED="REMOVED",t))(lr||{}),Be=(t=>(t.NotPaid="NOT_PAID",t.Pending="PENDING",t.Paid="PAID",t.Expired="EXPIRED",t.Cancelled="CANCELLED",t))(Be||{}),br=(t=>(t.Balance="BALANCE",t.Product="PRODUCT",t))(br||{}),en=(t=>(t.Spend="SPEND_AMOUNT",t.Order="ORDER_COUNT",t.Referral="REFER_FRIEND",t.Review="LEAVE_REVIEW",t))(en||{});const j3=async()=>(await q4()).data;/*! *****************************************************************************
73
+ `},wI={onDragStart(t){let{active:n}=t;return"Picked up draggable item "+n.id+"."},onDragOver(t){let{active:n,over:o}=t;return o?"Draggable item "+n.id+" was moved over droppable area "+o.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(t){let{active:n,over:o}=t;return o?"Draggable item "+n.id+" was dropped over droppable area "+o.id:"Draggable item "+n.id+" was dropped."},onDragCancel(t){let{active:n}=t;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function xI(t){let{announcements:n=wI,container:o,hiddenTextDescribedById:r,screenReaderInstructions:a=bI}=t;const{announce:i,announcement:c}=SI(),l=Rr("DndLiveRegion"),[u,d]=y.useState(!1);if(y.useEffect(()=>{d(!0)},[]),yI(y.useMemo(()=>({onDragStart(f){let{active:m}=f;i(n.onDragStart({active:m}))},onDragMove(f){let{active:m,over:g}=f;n.onDragMove&&i(n.onDragMove({active:m,over:g}))},onDragOver(f){let{active:m,over:g}=f;i(n.onDragOver({active:m,over:g}))},onDragEnd(f){let{active:m,over:g}=f;i(n.onDragEnd({active:m,over:g}))},onDragCancel(f){let{active:m,over:g}=f;i(n.onDragCancel({active:m,over:g}))}}),[i,n])),!u)return null;const h=y.createElement(y.Fragment,null,y.createElement(II,{id:r,value:a.draggable}),y.createElement(CI,{id:l,announcement:c}));return o?go.createPortal(h,o):h}var ht;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(ht||(ht={}));function ka(){}function Mu(t,n){return y.useMemo(()=>({sensor:t,options:n??{}}),[t,n])}function Nu(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return y.useMemo(()=>[...n].filter(r=>r!=null),[...n])}const gn=Object.freeze({x:0,y:0});function _I(t,n){let{data:{value:o}}=t,{data:{value:r}}=n;return r-o}function TI(t,n){if(!t||t.length===0)return null;const[o]=t;return o[n]}function kI(t,n){const o=Math.max(n.top,t.top),r=Math.max(n.left,t.left),a=Math.min(n.left+n.width,t.left+t.width),i=Math.min(n.top+n.height,t.top+t.height),c=a-r,l=i-o;if(r<a&&o<i){const u=n.width*n.height,d=t.width*t.height,h=c*l,f=h/(u+d-h);return Number(f.toFixed(4))}return 0}const PI=t=>{let{collisionRect:n,droppableRects:o,droppableContainers:r}=t;const a=[];for(const i of r){const{id:c}=i,l=o.get(c);if(l){const u=kI(l,n);u>0&&a.push({id:c,data:{droppableContainer:i,value:u}})}}return a.sort(_I)};function LI(t,n,o){return{...t,scaleX:n&&o?n.width/o.width:1,scaleY:n&&o?n.height/o.height:1}}function Bu(t,n){return t&&n?{x:t.left-n.left,y:t.top-n.top}:gn}function AI(t){return function(o){for(var r=arguments.length,a=new Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];return a.reduce((c,l)=>({...c,top:c.top+t*l.y,bottom:c.bottom+t*l.y,left:c.left+t*l.x,right:c.right+t*l.x}),{...o})}}const EI=AI(1);function RI(t){if(t.startsWith("matrix3d(")){const n=t.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(t.startsWith("matrix(")){const n=t.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function DI(t,n,o){const r=RI(n);if(!r)return t;const{scaleX:a,scaleY:i,x:c,y:l}=r,u=t.left-c-(1-a)*parseFloat(o),d=t.top-l-(1-i)*parseFloat(o.slice(o.indexOf(" ")+1)),h=a?t.width/a:t.width,f=i?t.height/i:t.height;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u}}const MI={ignoreTransform:!1};function qo(t,n){n===void 0&&(n=MI);let o=t.getBoundingClientRect();if(n.ignoreTransform){const{transform:d,transformOrigin:h}=zt(t).getComputedStyle(t);d&&(o=DI(o,d,h))}const{top:r,left:a,width:i,height:c,bottom:l,right:u}=o;return{top:r,left:a,width:i,height:c,bottom:l,right:u}}function $c(t){return qo(t,{ignoreTransform:!0})}function NI(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}function BI(t,n){return n===void 0&&(n=zt(t).getComputedStyle(t)),n.position==="fixed"}function FI(t,n){n===void 0&&(n=zt(t).getComputedStyle(t));const o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const i=n[a];return typeof i=="string"?o.test(i):!1})}function Es(t,n){const o=[];function r(a){if(n!=null&&o.length>=n||!a)return o;if(Ps(a)&&a.scrollingElement!=null&&!o.includes(a.scrollingElement))return o.push(a.scrollingElement),o;if(!Ar(a)||Eu(a)||o.includes(a))return o;const i=zt(t).getComputedStyle(a);return a!==t&&FI(a,i)&&o.push(a),BI(a,i)?o:r(a.parentNode)}return t?r(t):o}function Fu(t){const[n]=Es(t,1);return n??null}function pi(t){return!Wa||!t?null:$o(t)?t:ks(t)?Ps(t)||t===Wo(t).scrollingElement?window:Ar(t)?t:null:null}function ju(t){return $o(t)?t.scrollX:t.scrollLeft}function Ou(t){return $o(t)?t.scrollY:t.scrollTop}function zi(t){return{x:ju(t),y:Ou(t)}}var yt;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(yt||(yt={}));function Hu(t){return!Wa||!t?!1:t===document.scrollingElement}function Vu(t){const n={x:0,y:0},o=Hu(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-o.width,y:t.scrollHeight-o.height},a=t.scrollTop<=n.y,i=t.scrollLeft<=n.x,c=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:a,isLeft:i,isBottom:c,isRight:l,maxScroll:r,minScroll:n}}const jI={x:.2,y:.2};function OI(t,n,o,r,a){let{top:i,left:c,right:l,bottom:u}=o;r===void 0&&(r=10),a===void 0&&(a=jI);const{isTop:d,isBottom:h,isLeft:f,isRight:m}=Vu(t),g={x:0,y:0},S={x:0,y:0},p={height:n.height*a.y,width:n.width*a.x};return!d&&i<=n.top+p.height?(g.y=yt.Backward,S.y=r*Math.abs((n.top+p.height-i)/p.height)):!h&&u>=n.bottom-p.height&&(g.y=yt.Forward,S.y=r*Math.abs((n.bottom-p.height-u)/p.height)),!m&&l>=n.right-p.width?(g.x=yt.Forward,S.x=r*Math.abs((n.right-p.width-l)/p.width)):!f&&c<=n.left+p.width&&(g.x=yt.Backward,S.x=r*Math.abs((n.left+p.width-c)/p.width)),{direction:g,speed:S}}function HI(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,height:c}}const{top:n,left:o,right:r,bottom:a}=t.getBoundingClientRect();return{top:n,left:o,right:r,bottom:a,width:t.clientWidth,height:t.clientHeight}}function Uu(t){return t.reduce((n,o)=>Bo(n,zi(o)),gn)}function VI(t){return t.reduce((n,o)=>n+ju(o),0)}function UI(t){return t.reduce((n,o)=>n+Ou(o),0)}function $I(t,n){if(n===void 0&&(n=qo),!t)return;const{top:o,left:r,bottom:a,right:i}=n(t);Fu(t)&&(a<=0||i<=0||o>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const WI=[["x",["left","right"],VI],["y",["top","bottom"],UI]];class Rs{constructor(n,o){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Es(o),a=Uu(r);this.rect={...n},this.width=n.width,this.height=n.height;for(const[i,c,l]of WI)for(const u of c)Object.defineProperty(this,u,{get:()=>{const d=l(r),h=a[i]-d;return this.rect[u]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class dr{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(o=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...o)})},this.target=n}add(n,o,r){var a;(a=this.target)==null||a.addEventListener(n,o,r),this.listeners.push([n,o,r])}}function qI(t){const{EventTarget:n}=zt(t);return t instanceof n?t:Wo(t)}function mi(t,n){const o=Math.abs(t.x),r=Math.abs(t.y);return typeof n=="number"?Math.sqrt(o**2+r**2)>n:"x"in n&&"y"in n?o>n.x&&r>n.y:"x"in n?o>n.x:"y"in n?r>n.y:!1}var an;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(an||(an={}));function Wc(t){t.preventDefault()}function ZI(t){t.stopPropagation()}var Ee;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Ee||(Ee={}));const $u={start:[Ee.Space,Ee.Enter],cancel:[Ee.Esc],end:[Ee.Space,Ee.Enter,Ee.Tab]},GI=(t,n)=>{let{currentCoordinates:o}=n;switch(t.code){case Ee.Right:return{...o,x:o.x+25};case Ee.Left:return{...o,x:o.x-25};case Ee.Down:return{...o,y:o.y+25};case Ee.Up:return{...o,y:o.y-25}}};class Wu{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:o}}=n;this.props=n,this.listeners=new dr(Wo(o)),this.windowListeners=new dr(zt(o)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(an.Resize,this.handleCancel),this.windowListeners.add(an.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(an.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:o}=this.props,r=n.node.current;r&&$I(r),o(gn)}handleKeyDown(n){if(As(n)){const{active:o,context:r,options:a}=this.props,{keyboardCodes:i=$u,coordinateGetter:c=GI,scrollBehavior:l="smooth"}=a,{code:u}=n;if(i.end.includes(u)){this.handleEnd(n);return}if(i.cancel.includes(u)){this.handleCancel(n);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:gn;this.referenceCoordinates||(this.referenceCoordinates=h);const f=c(n,{active:o,context:r.current,currentCoordinates:h});if(f){const m=Ta(f,h),g={x:0,y:0},{scrollableAncestors:S}=r.current;for(const p of S){const I=n.code,{isTop:w,isRight:C,isLeft:x,isBottom:T,maxScroll:_,minScroll:D}=Vu(p),v=HI(p),P={x:Math.min(I===Ee.Right?v.right-v.width/2:v.right,Math.max(I===Ee.Right?v.left:v.left+v.width/2,f.x)),y:Math.min(I===Ee.Down?v.bottom-v.height/2:v.bottom,Math.max(I===Ee.Down?v.top:v.top+v.height/2,f.y))},N=I===Ee.Right&&!C||I===Ee.Left&&!x,M=I===Ee.Down&&!T||I===Ee.Up&&!w;if(N&&P.x!==f.x){const q=p.scrollLeft+m.x,j=I===Ee.Right&&q<=_.x||I===Ee.Left&&q>=D.x;if(j&&!m.y){p.scrollTo({left:q,behavior:l});return}j?g.x=p.scrollLeft-q:g.x=I===Ee.Right?p.scrollLeft-_.x:p.scrollLeft-D.x,g.x&&p.scrollBy({left:-g.x,behavior:l});break}else if(M&&P.y!==f.y){const q=p.scrollTop+m.y,j=I===Ee.Down&&q<=_.y||I===Ee.Up&&q>=D.y;if(j&&!m.x){p.scrollTo({top:q,behavior:l});return}j?g.y=p.scrollTop-q:g.y=I===Ee.Down?p.scrollTop-_.y:p.scrollTop-D.y,g.y&&p.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(n,Bo(Ta(f,this.referenceCoordinates),g))}}}handleMove(n,o){const{onMove:r}=this.props;n.preventDefault(),r(o)}handleEnd(n){const{onEnd:o}=this.props;n.preventDefault(),this.detach(),o()}handleCancel(n){const{onCancel:o}=this.props;n.preventDefault(),this.detach(),o()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Wu.activators=[{eventName:"onKeyDown",handler:(t,n,o)=>{let{keyboardCodes:r=$u,onActivation:a}=n,{active:i}=o;const{code:c}=t.nativeEvent;if(r.start.includes(c)){const l=i.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),a==null||a({event:t.nativeEvent}),!0)}return!1}}];function qc(t){return!!(t&&"distance"in t)}function Zc(t){return!!(t&&"delay"in t)}class Ds{constructor(n,o,r){var a;r===void 0&&(r=qI(n.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=n,this.events=o;const{event:i}=n,{target:c}=i;this.props=n,this.events=o,this.document=Wo(c),this.documentListeners=new dr(this.document),this.listeners=new dr(r),this.windowListeners=new dr(zt(c)),this.initialCoordinates=(a=Gi(i))!=null?a:gn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:n,props:{options:{activationConstraint:o,bypassActivationConstraint:r}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(an.Resize,this.handleCancel),this.windowListeners.add(an.DragStart,Wc),this.windowListeners.add(an.VisibilityChange,this.handleCancel),this.windowListeners.add(an.ContextMenu,Wc),this.documentListeners.add(an.Keydown,this.handleKeydown),o){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Zc(o)){this.timeoutId=setTimeout(this.handleStart,o.delay),this.handlePending(o);return}if(qc(o)){this.handlePending(o);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(n,o){const{active:r,onPending:a}=this.props;a(r,n,this.initialCoordinates,o)}handleStart(){const{initialCoordinates:n}=this,{onStart:o}=this.props;n&&(this.activated=!0,this.documentListeners.add(an.Click,ZI,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(an.SelectionChange,this.removeTextSelection),o(n))}handleMove(n){var o;const{activated:r,initialCoordinates:a,props:i}=this,{onMove:c,options:{activationConstraint:l}}=i;if(!a)return;const u=(o=Gi(n))!=null?o:gn,d=Ta(a,u);if(!r&&l){if(qc(l)){if(l.tolerance!=null&&mi(d,l.tolerance))return this.handleCancel();if(mi(d,l.distance))return this.handleStart()}if(Zc(l)&&mi(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}n.cancelable&&n.preventDefault(),c(u)}handleEnd(){const{onAbort:n,onEnd:o}=this.props;this.detach(),this.activated||n(this.props.active),o()}handleCancel(){const{onAbort:n,onCancel:o}=this.props;this.detach(),this.activated||n(this.props.active),o()}handleKeydown(n){n.code===Ee.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const zI={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class qa extends Ds{constructor(n){const{event:o}=n,r=Wo(o.target);super(n,zI,r)}}qa.activators=[{eventName:"onPointerDown",handler:(t,n)=>{let{nativeEvent:o}=t,{onActivation:r}=n;return!o.isPrimary||o.button!==0?!1:(r==null||r({event:o}),!0)}}];const YI={move:{name:"mousemove"},end:{name:"mouseup"}};var Yi;(function(t){t[t.RightClick=2]="RightClick"})(Yi||(Yi={}));class XI extends Ds{constructor(n){super(n,YI,Wo(n.event.target))}}XI.activators=[{eventName:"onMouseDown",handler:(t,n)=>{let{nativeEvent:o}=t,{onActivation:r}=n;return o.button===Yi.RightClick?!1:(r==null||r({event:o}),!0)}}];const gi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class KI extends Ds{constructor(n){super(n,gi)}static setup(){return window.addEventListener(gi.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(gi.move.name,n)};function n(){}}}KI.activators=[{eventName:"onTouchStart",handler:(t,n)=>{let{nativeEvent:o}=t,{onActivation:r}=n;const{touches:a}=o;return a.length>1?!1:(r==null||r({event:o}),!0)}}];var hr;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(hr||(hr={}));var Pa;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Pa||(Pa={}));function JI(t){let{acceleration:n,activator:o=hr.Pointer,canScroll:r,draggingRect:a,enabled:i,interval:c=5,order:l=Pa.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:f,threshold:m}=t;const g=e2({delta:f,disabled:!i}),[S,p]=hI(),I=y.useRef({x:0,y:0}),w=y.useRef({x:0,y:0}),C=y.useMemo(()=>{switch(o){case hr.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case hr.DraggableRect:return a}},[o,a,u]),x=y.useRef(null),T=y.useCallback(()=>{const D=x.current;if(!D)return;const v=I.current.x*w.current.x,P=I.current.y*w.current.y;D.scrollBy(v,P)},[]),_=y.useMemo(()=>l===Pa.TreeOrder?[...d].reverse():d,[l,d]);y.useEffect(()=>{if(!i||!d.length||!C){p();return}for(const D of _){if((r==null?void 0:r(D))===!1)continue;const v=d.indexOf(D),P=h[v];if(!P)continue;const{direction:N,speed:M}=OI(D,P,C,n,m);for(const q of["x","y"])g[q][N[q]]||(M[q]=0,N[q]=0);if(M.x>0||M.y>0){p(),x.current=D,S(T,c),I.current=M,w.current=N;return}}I.current={x:0,y:0},w.current={x:0,y:0},p()},[n,T,r,p,i,c,JSON.stringify(C),JSON.stringify(g),S,d,_,h,JSON.stringify(m)])}const QI={x:{[yt.Backward]:!1,[yt.Forward]:!1},y:{[yt.Backward]:!1,[yt.Forward]:!1}};function e2(t){let{delta:n,disabled:o}=t;const r=Zi(n);return Er(a=>{if(o||!r||!a)return QI;const i={x:Math.sign(n.x-r.x),y:Math.sign(n.y-r.y)};return{x:{[yt.Backward]:a.x[yt.Backward]||i.x===-1,[yt.Forward]:a.x[yt.Forward]||i.x===1},y:{[yt.Backward]:a.y[yt.Backward]||i.y===-1,[yt.Forward]:a.y[yt.Forward]||i.y===1}}},[o,n,r])}function t2(t,n){const o=n!=null?t.get(n):void 0,r=o?o.node.current:null;return Er(a=>{var i;return n==null?null:(i=r??a)!=null?i:null},[r,n])}function n2(t,n){return y.useMemo(()=>t.reduce((o,r)=>{const{sensor:a}=r,i=a.activators.map(c=>({eventName:c.eventName,handler:n(c.handler,r)}));return[...o,...i]},[]),[t,n])}var yr;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(yr||(yr={}));var Xi;(function(t){t.Optimized="optimized"})(Xi||(Xi={}));const Gc=new Map;function o2(t,n){let{dragging:o,dependencies:r,config:a}=n;const[i,c]=y.useState(null),{frequency:l,measure:u,strategy:d}=a,h=y.useRef(t),f=I(),m=Sr(f),g=y.useCallback(function(w){w===void 0&&(w=[]),!m.current&&c(C=>C===null?w:C.concat(w.filter(x=>!C.includes(x))))},[m]),S=y.useRef(null),p=Er(w=>{if(f&&!o)return Gc;if(!w||w===Gc||h.current!==t||i!=null){const C=new Map;for(let x of t){if(!x)continue;if(i&&i.length>0&&!i.includes(x.id)&&x.rect.current){C.set(x.id,x.rect.current);continue}const T=x.node.current,_=T?new Rs(u(T),T):null;x.rect.current=_,_&&C.set(x.id,_)}return C}return w},[t,i,o,f,u]);return y.useEffect(()=>{h.current=t},[t]),y.useEffect(()=>{f||g()},[o,f]),y.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),y.useEffect(()=>{f||typeof l!="number"||S.current!==null||(S.current=setTimeout(()=>{g(),S.current=null},l))},[l,f,g,...r]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:i!=null};function I(){switch(d){case yr.Always:return!1;case yr.BeforeDragging:return o;default:return!o}}}function qu(t,n){return Er(o=>t?o||(typeof n=="function"?n(t):t):null,[n,t])}function r2(t,n){return qu(t,n)}function a2(t){let{callback:n,disabled:o}=t;const r=Ls(n),a=y.useMemo(()=>{if(o||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,o]);return y.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Za(t){let{callback:n,disabled:o}=t;const r=Ls(n),a=y.useMemo(()=>{if(o||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[o]);return y.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function i2(t){return new Rs(qo(t),t)}function zc(t,n,o){n===void 0&&(n=i2);const[r,a]=y.useState(null);function i(){a(u=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=u??o)!=null?d:null}const h=n(t);return JSON.stringify(u)===JSON.stringify(h)?u:h})}const c=a2({callback(u){if(t)for(const d of u){const{type:h,target:f}=d;if(h==="childList"&&f instanceof HTMLElement&&f.contains(t)){i();break}}}}),l=Za({callback:i});return En(()=>{i(),t?(l==null||l.observe(t),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),c==null||c.disconnect())},[t]),r}function s2(t){const n=qu(t);return Bu(t,n)}const Yc=[];function c2(t){const n=y.useRef(t),o=Er(r=>t?r&&r!==Yc&&t&&n.current&&t.parentNode===n.current.parentNode?r:Es(t):Yc,[t]);return y.useEffect(()=>{n.current=t},[t]),o}function l2(t){const[n,o]=y.useState(null),r=y.useRef(t),a=y.useCallback(i=>{const c=pi(i.target);c&&o(l=>l?(l.set(c,zi(c)),new Map(l)):null)},[]);return y.useEffect(()=>{const i=r.current;if(t!==i){c(i);const l=t.map(u=>{const d=pi(u);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,zi(d)]):null}).filter(u=>u!=null);o(l.length?new Map(l):null),r.current=t}return()=>{c(t),c(i)};function c(l){l.forEach(u=>{const d=pi(u);d==null||d.removeEventListener("scroll",a)})}},[a,t]),y.useMemo(()=>t.length?n?Array.from(n.values()).reduce((i,c)=>Bo(i,c),gn):Uu(t):gn,[t,n])}function Xc(t,n){n===void 0&&(n=[]);const o=y.useRef(null);return y.useEffect(()=>{o.current=null},n),y.useEffect(()=>{const r=t!==gn;r&&!o.current&&(o.current=t),!r&&o.current&&(o.current=null)},[t]),o.current?Ta(t,o.current):gn}function u2(t){y.useEffect(()=>{if(!Wa)return;const n=t.map(o=>{let{sensor:r}=o;return r.setup==null?void 0:r.setup()});return()=>{for(const o of n)o==null||o()}},t.map(n=>{let{sensor:o}=n;return o}))}function d2(t,n){return y.useMemo(()=>t.reduce((o,r)=>{let{eventName:a,handler:i}=r;return o[a]=c=>{i(c,n)},o},{}),[t,n])}function Zu(t){return y.useMemo(()=>t?NI(t):null,[t])}const Kc=[];function h2(t,n){n===void 0&&(n=qo);const[o]=t,r=Zu(o?zt(o):null),[a,i]=y.useState(Kc);function c(){i(()=>t.length?t.map(u=>Hu(u)?r:new Rs(n(u),u)):Kc)}const l=Za({callback:c});return En(()=>{l==null||l.disconnect(),c(),t.forEach(u=>l==null?void 0:l.observe(u))},[t]),a}function f2(t){if(!t)return null;if(t.children.length>1)return t;const n=t.children[0];return Ar(n)?n:t}function p2(t){let{measure:n}=t;const[o,r]=y.useState(null),a=y.useCallback(d=>{for(const{target:h}of d)if(Ar(h)){r(f=>{const m=n(h);return f?{...f,width:m.width,height:m.height}:m});break}},[n]),i=Za({callback:a}),c=y.useCallback(d=>{const h=f2(d);i==null||i.disconnect(),h&&(i==null||i.observe(h)),r(h?n(h):null)},[n,i]),[l,u]=_a(c);return y.useMemo(()=>({nodeRef:l,rect:o,setRef:u}),[o,l,u])}const m2=[{sensor:qa,options:{}},{sensor:Wu,options:{}}],g2={current:{}},fa={draggable:{measure:$c},droppable:{measure:$c,strategy:yr.WhileDragging,frequency:Xi.Optimized},dragOverlay:{measure:qo}};class fr extends Map{get(n){var o;return n!=null&&(o=super.get(n))!=null?o:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:o}=n;return!o})}getNodeFor(n){var o,r;return(o=(r=this.get(n))==null?void 0:r.node.current)!=null?o:void 0}}const I2={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ka},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:fa,measureDroppableContainers:ka,windowRect:null,measuringScheduled:!1},C2={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ka,draggableNodes:new Map,over:null,measureDroppableContainers:ka},Ga=y.createContext(C2),Gu=y.createContext(I2);function S2(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fr}}}function y2(t,n){switch(n.type){case ht.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case ht.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:n.coordinates.x-t.draggable.initialCoordinates.x,y:n.coordinates.y-t.draggable.initialCoordinates.y}}};case ht.DragEnd:case ht.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ht.RegisterDroppable:{const{element:o}=n,{id:r}=o,a=new fr(t.droppable.containers);return a.set(r,o),{...t,droppable:{...t.droppable,containers:a}}}case ht.SetDroppableDisabled:{const{id:o,key:r,disabled:a}=n,i=t.droppable.containers.get(o);if(!i||r!==i.key)return t;const c=new fr(t.droppable.containers);return c.set(o,{...i,disabled:a}),{...t,droppable:{...t.droppable,containers:c}}}case ht.UnregisterDroppable:{const{id:o,key:r}=n,a=t.droppable.containers.get(o);if(!a||r!==a.key)return t;const i=new fr(t.droppable.containers);return i.delete(o),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function v2(t){let{disabled:n}=t;const{active:o,activatorEvent:r,draggableNodes:a}=y.useContext(Ga),i=Zi(r),c=Zi(o==null?void 0:o.id);return y.useEffect(()=>{if(!n&&!r&&i&&c!=null){if(!As(i)||document.activeElement===i.target)return;const l=a.get(c);if(!l)return;const{activatorNode:u,node:d}=l;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const f=mI(h);if(f){f.focus();break}}})}},[r,n,a,c,i]),null}function b2(t,n){let{transform:o,...r}=n;return t!=null&&t.length?t.reduce((a,i)=>i({transform:a,...r}),o):o}function w2(t){return y.useMemo(()=>({draggable:{...fa.draggable,...t==null?void 0:t.draggable},droppable:{...fa.droppable,...t==null?void 0:t.droppable},dragOverlay:{...fa.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function x2(t){let{activeNode:n,measure:o,initialRect:r,config:a=!0}=t;const i=y.useRef(!1),{x:c,y:l}=typeof a=="boolean"?{x:a,y:a}:a;En(()=>{if(!c&&!l||!n){i.current=!1;return}if(i.current||!r)return;const d=n==null?void 0:n.node.current;if(!d||d.isConnected===!1)return;const h=o(d),f=Bu(h,r);if(c||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=Fu(d);m&&m.scrollBy({top:f.y,left:f.x})}},[n,c,l,r,o])}const zu=y.createContext({...gn,scaleX:1,scaleY:1});var Kn;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Kn||(Kn={}));const Yu=y.memo(function(n){var o,r,a,i;let{id:c,accessibility:l,autoScroll:u=!0,children:d,sensors:h=m2,collisionDetection:f=PI,measuring:m,modifiers:g,...S}=n;const p=y.useReducer(y2,void 0,S2),[I,w]=p,[C,x]=vI(),[T,_]=y.useState(Kn.Uninitialized),D=T===Kn.Initialized,{draggable:{active:v,nodes:P,translate:N},droppable:{containers:M}}=I,q=v!=null?P.get(v):null,j=y.useRef({initial:null,translated:null}),G=y.useMemo(()=>{var Ve;return v!=null?{id:v,data:(Ve=q==null?void 0:q.data)!=null?Ve:g2,rect:j}:null},[v,q]),H=y.useRef(null),[ce,he]=y.useState(null),[me,Ce]=y.useState(null),ye=Sr(S,Object.values(S)),$=Rr("DndDescribedBy",c),Y=y.useMemo(()=>M.getEnabled(),[M]),ne=w2(m),{droppableRects:oe,measureDroppableContainers:O,measuringScheduled:X}=o2(Y,{dragging:D,dependencies:[N.x,N.y],config:ne.droppable}),K=t2(P,v),ie=y.useMemo(()=>me?Gi(me):null,[me]),ue=Bn(),z=r2(K,ne.draggable.measure);x2({activeNode:v!=null?P.get(v):null,config:ue.layoutShiftCompensation,initialRect:z,measure:ne.draggable.measure});const J=zc(K,ne.draggable.measure,z),ke=zc(K?K.parentElement:null),V=y.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:oe,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=M.getNodeFor((o=V.current.over)==null?void 0:o.id),le=p2({measure:ne.dragOverlay.measure}),de=(r=le.nodeRef.current)!=null?r:K,Pe=D?(a=le.rect)!=null?a:J:null,et=!!(le.nodeRef.current&&le.rect),tt=s2(et?null:J),Le=Zu(de?zt(de):null),je=c2(D?xe??K:null),Yt=h2(je),We=b2(g,{transform:{x:N.x-tt.x,y:N.y-tt.y,scaleX:1,scaleY:1},activatorEvent:me,active:G,activeNodeRect:J,containerNodeRect:ke,draggingNodeRect:Pe,over:V.current.over,overlayNodeRect:le.rect,scrollableAncestors:je,scrollableAncestorRects:Yt,windowRect:Le}),Ot=ie?Bo(ie,N):null,qe=l2(je),lt=Xc(qe),Pt=Xc(qe,[J]),Ye=Bo(We,lt),nt=Pe?EI(Pe,We):null,Xe=G&&nt?f({active:G,collisionRect:nt,droppableRects:oe,droppableContainers:Y,pointerCoordinates:Ot}):null,yn=TI(Xe,"id"),[vt,zn]=y.useState(null),ot=et?We:Bo(We,Pt),vn=LI(ot,(i=vt==null?void 0:vt.rect)!=null?i:null,J),bn=y.useRef(null),io=y.useCallback((Ve,pt)=>{let{sensor:mt,options:Xt}=pt;if(H.current==null)return;const bt=P.get(H.current);if(!bt)return;const Ke=Ve.nativeEvent,gt=new mt({active:H.current,activeNode:bt,event:Ke,options:Xt,context:V,onAbort(Je){if(!P.get(Je))return;const{onDragAbort:L}=ye.current,R={id:Je};L==null||L(R),C({type:"onDragAbort",event:R})},onPending(Je,k,L,R){if(!P.get(Je))return;const{onDragPending:ee}=ye.current,se={id:Je,constraint:k,initialCoordinates:L,offset:R};ee==null||ee(se),C({type:"onDragPending",event:se})},onStart(Je){const k=H.current;if(k==null)return;const L=P.get(k);if(!L)return;const{onDragStart:R}=ye.current,W={activatorEvent:Ke,active:{id:k,data:L.data,rect:j}};go.unstable_batchedUpdates(()=>{R==null||R(W),_(Kn.Initializing),w({type:ht.DragStart,initialCoordinates:Je,active:k}),C({type:"onDragStart",event:W}),he(bn.current),Ce(Ke)})},onMove(Je){w({type:ht.DragMove,coordinates:Je})},onEnd:wn(ht.DragEnd),onCancel:wn(ht.DragCancel)});bn.current=gt;function wn(Je){return async function(){const{active:L,collisions:R,over:W,scrollAdjustedTranslate:ee}=V.current;let se=null;if(L&&ee){const{cancelDrop:b}=ye.current;se={activatorEvent:Ke,active:L,collisions:R,delta:ee,over:W},Je===ht.DragEnd&&typeof b=="function"&&await Promise.resolve(b(se))&&(Je=ht.DragCancel)}H.current=null,go.unstable_batchedUpdates(()=>{w({type:Je}),_(Kn.Uninitialized),zn(null),he(null),Ce(null),bn.current=null;const b=Je===ht.DragEnd?"onDragEnd":"onDragCancel";if(se){const A=ye.current[b];A==null||A(se),C({type:b,event:se})}})}}},[P]),zo=y.useCallback((Ve,pt)=>(mt,Xt)=>{const bt=mt.nativeEvent,Ke=P.get(Xt);if(H.current!==null||!Ke||bt.dndKit||bt.defaultPrevented)return;const gt={active:Ke};Ve(mt,pt.options,gt)===!0&&(bt.dndKit={capturedBy:pt.sensor},H.current=Xt,io(mt,pt))},[P,io]),Mn=n2(h,zo);u2(h),En(()=>{J&&T===Kn.Initializing&&_(Kn.Initialized)},[J,T]),y.useEffect(()=>{const{onDragMove:Ve}=ye.current,{active:pt,activatorEvent:mt,collisions:Xt,over:bt}=V.current;if(!pt||!mt)return;const Ke={active:pt,activatorEvent:mt,collisions:Xt,delta:{x:Ye.x,y:Ye.y},over:bt};go.unstable_batchedUpdates(()=>{Ve==null||Ve(Ke),C({type:"onDragMove",event:Ke})})},[Ye.x,Ye.y]),y.useEffect(()=>{const{active:Ve,activatorEvent:pt,collisions:mt,droppableContainers:Xt,scrollAdjustedTranslate:bt}=V.current;if(!Ve||H.current==null||!pt||!bt)return;const{onDragOver:Ke}=ye.current,gt=Xt.get(yn),wn=gt&&gt.rect.current?{id:gt.id,rect:gt.rect.current,data:gt.data,disabled:gt.disabled}:null,Je={active:Ve,activatorEvent:pt,collisions:mt,delta:{x:bt.x,y:bt.y},over:wn};go.unstable_batchedUpdates(()=>{zn(wn),Ke==null||Ke(Je),C({type:"onDragOver",event:Je})})},[yn]),En(()=>{V.current={activatorEvent:me,active:G,activeNode:K,collisionRect:nt,collisions:Xe,droppableRects:oe,draggableNodes:P,draggingNode:de,draggingNodeRect:Pe,droppableContainers:M,over:vt,scrollableAncestors:je,scrollAdjustedTranslate:Ye},j.current={initial:Pe,translated:nt}},[G,K,Xe,nt,P,de,Pe,oe,M,vt,je,Ye]),JI({...ue,delta:N,draggingRect:nt,pointerCoordinates:Ot,scrollableAncestors:je,scrollableAncestorRects:Yt});const Nn=y.useMemo(()=>({active:G,activeNode:K,activeNodeRect:J,activatorEvent:me,collisions:Xe,containerNodeRect:ke,dragOverlay:le,draggableNodes:P,droppableContainers:M,droppableRects:oe,over:vt,measureDroppableContainers:O,scrollableAncestors:je,scrollableAncestorRects:Yt,measuringConfiguration:ne,measuringScheduled:X,windowRect:Le}),[G,K,J,me,Xe,ke,le,P,M,oe,vt,O,je,Yt,ne,X,Le]),dn=y.useMemo(()=>({activatorEvent:me,activators:Mn,active:G,activeNodeRect:J,ariaDescribedById:{draggable:$},dispatch:w,draggableNodes:P,over:vt,measureDroppableContainers:O}),[me,Mn,G,J,w,$,P,vt,O]);return y.createElement(Du.Provider,{value:x},y.createElement(Ga.Provider,{value:dn},y.createElement(Gu.Provider,{value:Nn},y.createElement(zu.Provider,{value:vn},d)),y.createElement(v2,{disabled:(l==null?void 0:l.restoreFocus)===!1})),y.createElement(xI,{...l,hiddenTextDescribedById:$}));function Bn(){const Ve=(ce==null?void 0:ce.autoScrollEnabled)===!1,pt=typeof u=="object"?u.enabled===!1:u===!1,mt=D&&!Ve&&!pt;return typeof u=="object"?{...u,enabled:mt}:{enabled:mt}}}),_2=y.createContext(null),Jc="button",T2="Draggable";function k2(t){let{id:n,data:o,disabled:r=!1,attributes:a}=t;const i=Rr(T2),{activators:c,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:f,over:m}=y.useContext(Ga),{role:g=Jc,roleDescription:S="draggable",tabIndex:p=0}=a??{},I=(u==null?void 0:u.id)===n,w=y.useContext(I?zu:_2),[C,x]=_a(),[T,_]=_a(),D=d2(c,n),v=Sr(o);En(()=>(f.set(n,{id:n,key:i,node:C,activatorNode:T,data:v}),()=>{const N=f.get(n);N&&N.key===i&&f.delete(n)}),[f,n]);const P=y.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":r,"aria-pressed":I&&g===Jc?!0:void 0,"aria-roledescription":S,"aria-describedby":h.draggable}),[r,g,p,I,S,h.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:P,isDragging:I,listeners:r?void 0:D,node:C,over:m,setNodeRef:x,setActivatorNodeRef:_,transform:w}}function P2(){return y.useContext(Gu)}const L2="Droppable",A2={timeout:25};function E2(t){let{data:n,disabled:o=!1,id:r,resizeObserverConfig:a}=t;const i=Rr(L2),{active:c,dispatch:l,over:u,measureDroppableContainers:d}=y.useContext(Ga),h=y.useRef({disabled:o}),f=y.useRef(!1),m=y.useRef(null),g=y.useRef(null),{disabled:S,updateMeasurementsFor:p,timeout:I}={...A2,...a},w=Sr(p??r),C=y.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(w.current)?w.current:[w.current]),g.current=null},I)},[I]),x=Za({callback:C,disabled:S||!c}),T=y.useCallback((P,N)=>{x&&(N&&(x.unobserve(N),f.current=!1),P&&x.observe(P))},[x]),[_,D]=_a(T),v=Sr(n);return y.useEffect(()=>{!x||!_.current||(x.disconnect(),f.current=!1,x.observe(_.current))},[_,x]),y.useEffect(()=>(l({type:ht.RegisterDroppable,element:{id:r,key:i,disabled:o,node:_,rect:m,data:v}}),()=>l({type:ht.UnregisterDroppable,key:i,id:r})),[r]),y.useEffect(()=>{o!==h.current.disabled&&(l({type:ht.SetDroppableDisabled,id:r,key:i,disabled:o}),h.current.disabled=o)},[r,i,o,l]),{active:c,rect:m,isOver:(u==null?void 0:u.id)===r,node:_,over:u,setNodeRef:D}}function Xu(t,n,o){const r=t.slice();return r.splice(o<0?r.length+o:o,0,r.splice(n,1)[0]),r}function R2(t,n){return t.reduce((o,r,a)=>{const i=n.get(r);return i&&(o[a]=i),o},Array(t.length))}function Zr(t){return t!==null&&t>=0}function D2(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==n[o])return!1;return!0}function M2(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Ku=t=>{let{rects:n,activeIndex:o,overIndex:r,index:a}=t;const i=Xu(n,r,o),c=n[a],l=i[a];return!l||!c?null:{x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height}},Gr={scaleX:1,scaleY:1},Ju=t=>{var n;let{activeIndex:o,activeNodeRect:r,index:a,rects:i,overIndex:c}=t;const l=(n=i[o])!=null?n:r;if(!l)return null;if(a===o){const d=i[c];return d?{x:0,y:o<c?d.top+d.height-(l.top+l.height):d.top-l.top,...Gr}:null}const u=N2(i,a,o);return a>o&&a<=c?{x:0,y:-l.height-u,...Gr}:a<o&&a>=c?{x:0,y:l.height+u,...Gr}:{x:0,y:0,...Gr}};function N2(t,n,o){const r=t[n],a=t[n-1],i=t[n+1];return r?o<n?a?r.top-(a.top+a.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):a?r.top-(a.top+a.height):0:0}const Qu="Sortable",ed=y.createContext({activeIndex:-1,containerId:Qu,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Ku,disabled:{draggable:!1,droppable:!1}});function td(t){let{children:n,id:o,items:r,strategy:a=Ku,disabled:i=!1}=t;const{active:c,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:h}=P2(),f=Rr(Qu,o),m=l.rect!==null,g=y.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),S=c!=null,p=c?g.indexOf(c.id):-1,I=d?g.indexOf(d.id):-1,w=y.useRef(g),C=!D2(g,w.current),x=I!==-1&&p===-1||C,T=M2(i);En(()=>{C&&S&&h(g)},[C,g,S,h]),y.useEffect(()=>{w.current=g},[g]);const _=y.useMemo(()=>({activeIndex:p,containerId:f,disabled:T,disableTransforms:x,items:g,overIndex:I,useDragOverlay:m,sortedRects:R2(g,u),strategy:a}),[p,f,T.draggable,T.droppable,x,g,I,u,m,a]);return y.createElement(ed.Provider,{value:_},n)}const B2=t=>{let{id:n,items:o,activeIndex:r,overIndex:a}=t;return Xu(o,r,a).indexOf(n)},F2=t=>{let{containerId:n,isSorting:o,wasDragging:r,index:a,items:i,newIndex:c,previousItems:l,previousContainerId:u,transition:d}=t;return!d||!r||l!==i&&a===c?!1:o?!0:c!==a&&n===u},j2={duration:200,easing:"ease"},nd="transform",O2=jo.Transition.toString({property:nd,duration:0,easing:"linear"}),H2={roleDescription:"sortable"};function V2(t){let{disabled:n,index:o,node:r,rect:a}=t;const[i,c]=y.useState(null),l=y.useRef(o);return En(()=>{if(!n&&o!==l.current&&r.current){const u=a.current;if(u){const d=qo(r.current,{ignoreTransform:!0}),h={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(h.x||h.y)&&c(h)}}o!==l.current&&(l.current=o)},[n,o,r,a]),y.useEffect(()=>{i&&c(null)},[i]),i}function od(t){let{animateLayoutChanges:n=F2,attributes:o,disabled:r,data:a,getNewIndex:i=B2,id:c,strategy:l,resizeObserverConfig:u,transition:d=j2}=t;const{items:h,containerId:f,activeIndex:m,disabled:g,disableTransforms:S,sortedRects:p,overIndex:I,useDragOverlay:w,strategy:C}=y.useContext(ed),x=U2(r,g),T=h.indexOf(c),_=y.useMemo(()=>({sortable:{containerId:f,index:T,items:h},...a}),[f,a,T,h]),D=y.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:v,node:P,isOver:N,setNodeRef:M}=E2({id:c,data:_,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...u}}),{active:q,activatorEvent:j,activeNodeRect:G,attributes:H,setNodeRef:ce,listeners:he,isDragging:me,over:Ce,setActivatorNodeRef:ye,transform:$}=k2({id:c,data:_,attributes:{...H2,...o},disabled:x.draggable}),Y=dI(M,ce),ne=!!q,oe=ne&&!S&&Zr(m)&&Zr(I),O=!w&&me,X=O&&oe?$:null,ie=oe?X??(l??C)({rects:p,activeNodeRect:G,activeIndex:m,overIndex:I,index:T}):null,ue=Zr(m)&&Zr(I)?i({id:c,items:h,activeIndex:m,overIndex:I}):T,z=q==null?void 0:q.id,J=y.useRef({activeId:z,items:h,newIndex:ue,containerId:f}),ke=h!==J.current.items,V=n({active:q,containerId:f,isDragging:me,isSorting:ne,id:c,index:T,items:h,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:d,wasDragging:J.current.activeId!=null}),xe=V2({disabled:!V,index:T,node:P,rect:v});return y.useEffect(()=>{ne&&J.current.newIndex!==ue&&(J.current.newIndex=ue),f!==J.current.containerId&&(J.current.containerId=f),h!==J.current.items&&(J.current.items=h)},[ne,ue,f,h]),y.useEffect(()=>{if(z===J.current.activeId)return;if(z!=null&&J.current.activeId==null){J.current.activeId=z;return}const de=setTimeout(()=>{J.current.activeId=z},50);return()=>clearTimeout(de)},[z]),{active:q,activeIndex:m,attributes:H,data:_,rect:v,index:T,newIndex:ue,items:h,isOver:N,isSorting:ne,isDragging:me,listeners:he,node:P,overIndex:I,over:Ce,setNodeRef:Y,setActivatorNodeRef:ye,setDroppableNodeRef:M,setDraggableNodeRef:ce,transform:xe??ie,transition:le()};function le(){if(xe||ke&&J.current.newIndex===T)return O2;if(!(O&&!As(j)||!d)&&(ne||V))return jo.Transition.toString({...d,property:nd})}}function U2(t,n){var o,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(o=t==null?void 0:t.draggable)!=null?o:n.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:n.droppable}}Ee.Down,Ee.Right,Ee.Up,Ee.Left;function $2({product:t,children:n}){const{attributes:o,listeners:r,setNodeRef:a,transform:i,transition:c,isDragging:l}=od({id:t.id}),u={transform:jo.Transform.toString(i),transition:c};return s.jsx("div",{ref:a,style:u,className:`${Qe.product} ${l?Qe.dragging:""}`,...o,...r,children:n})}const rd=t=>{const{isActiveItems:n,setIsActiveItems:o,items:r,setItems:a,other:i,title:c,subtitle:l,editable:u=!0,draggable:d=!1,withImage:h=!1,deletable:f=!0,addable:m=!0,itemsType:g,itemsPlaceholder:S="",itemsOptions:p,hasRangeSelector:I=!1,rangeSelectorOptions:w,modalOptions:C,addableOptions:x={},limit:T,autoInterval:_,tip:D,aspectRatio:v,setAspectRatio:P}=t,[N,M]=y.useState(null),[q,j]=y.useState({top:0,left:0}),[G,H]=y.useState(null),ce=y.useRef(null),[he,me]=y.useState(!1),Ce=Nu(Mu(qa,{activationConstraint:{distance:5}}));y.useEffect(()=>{if(N){const O=[...r].map(X=>X.id===N.id?N:X);a(O)}},[N]),y.useEffect(()=>{if(ce.current&&G){const O=ce.current.getBoundingClientRect().height,X=window.innerHeight;let K=G.top;K+O>X+window.scrollY-200&&(K=X+window.scrollY-O-200),K<0&&(K=10),j({top:K-30,left:G.left})}},[ce.current,G]);const ye=(O,X)=>{O.stopPropagation();const K=O.target.getBoundingClientRect();H({top:K.top+window.scrollY-70,left:K.left-(m?30:65)}),M(X),me(!0)},$=(O,X)=>{const K=[...r],ie={...O,id:Math.random().toString(36).substr(2,9)};K.splice(X+1,0,ie),a(K)};function Y(O){if(h)return O?s.jsx("img",{src:`https://imagedelivery.net/${O[0]}/w=1000`,alt:"image",width:16,height:16}):s.jsx(Z,{name:"Image",width:16,height:16,fill:"#757575"})}const ne=O=>{const{active:X,over:K}=O;if(K&&X.id!==K.id){const ie=r.findIndex(z=>z.id===X.id),ue=r.findIndex(z=>z.id===K.id);if(ie!==-1&&ue!==-1){const z=[...r],[J]=z.splice(ie,1);z.splice(ue,0,J),a(z)}}},oe=(O,X)=>{var ie,ue;const K=s.jsxs(s.Fragment,{children:[d&&s.jsx("div",{children:s.jsx(Z,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&p&&s.jsx(no,{onChange:z=>{const J=[...r],ke=p.find(xe=>xe.name["en-US"]===z);if(!ke)return;const V=J.map(xe=>xe.id===O.id?{...ke,name:{"en-US":z}}:xe);M({...O,name:{"en-US":z}}),a([...V])},value:O.name["en-US"],options:p.filter(z=>!r.find(J=>J.name["en-US"]===z.name["en-US"])).map(z=>z.name["en-US"]),leftAddonOptions:p.filter(z=>{var J;return((J=z.images)==null?void 0:J.length)>0}).map(z=>({value:z.name["en-US"],addon:Y(z.images)}))}),g==="selectInfiniteList"&&p&&s.jsx(Cs,{onChange:z=>{const J=[...r],ke=p.find(xe=>xe.name["en-US"]===z);if(!ke)return;const V=J.map(xe=>xe.id===O.id?{...ke,name:{"en-US":z}}:xe);M({...O,name:{"en-US":z}}),a([...V])},value:O.name["en-US"],options:p.filter(z=>!r.find(J=>J.name["en-US"]===z.name["en-US"])).map(z=>z.name["en-US"]),leftAddonOptions:p.filter(z=>{var J;return((J=z.images)==null?void 0:J.length)>0}).map(z=>({value:z.name["en-US"],addon:Y(z.images)}))}),g==="input"&&s.jsx(cn,{onChange:z=>{const ke=[...r].map(V=>V.id===O.id?{...O,name:{"en-US":z}}:V);a([...ke])},value:O.name["en-US"],placeholder:S}),g==="image"&&s.jsx(Lr,{onChange:z=>{const ke=[...r].map(V=>V.id===O.id?{...O,images:z}:V);a([...ke])},activeImage:(ie=r.find(z=>z.id===O.id))!=null&&ie.images?(ue=r.find(z=>z.id===O.id))==null?void 0:ue.images[0]:void 0,tip:D}),s.jsxs("div",{className:Qe.buttons,children:[T&&T>r.length&&m&&s.jsx("div",{className:Qe.deleteButton,children:s.jsx(Z,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{$(O,X)}})}),u&&s.jsx("div",{className:Qe.deleteButton,children:s.jsx(Z,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:z=>{ye(z,O)}})}),f&&s.jsx("div",{className:Qe.deleteButton,children:s.jsx(Z,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>a(r.filter(z=>z.id!==O.id))})})]})]});return d?s.jsx($2,{product:O,index:X,children:K},O.id):s.jsx("div",{className:Qe.product,children:K},O.id)};return s.jsxs("div",{className:Qe.productsBlock,children:[(c||n!==void 0)&&s.jsxs("div",{className:Qe.top,children:[c&&s.jsx("h3",{className:Qe.title,children:c}),n!==void 0&&s.jsx(Dn,{current:n,onChange:O=>o==null?void 0:o(O)})]}),N&&u&&C&&he&&s.jsx(sI,{ref:ce,activeItem:N,setActiveItem:M,popupPosition:q,modalOptions:C,setIsOpenModal:me}),(n===void 0||n)&&I&&w&&s.jsx(ad,{...w}),(n===void 0||n)&&s.jsxs("div",{className:Qe.products,children:[l&&s.jsx("h5",{className:Qe.subtitle,children:l}),d?s.jsx(Yu,{sensors:Ce,onDragEnd:ne,children:s.jsx(td,{items:r.map(O=>O.id),strategy:Ju,children:r.map((O,X)=>oe(O,X))})}):r.map((O,X)=>oe(O,X)),m&&s.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:s.jsx(Fo,{withoutHover:!0,className:te(Qe.button,{[Qe.disabled]:!!(T&&T<=r.length||r.length===(p==null?void 0:p.length))}),size:"s",disabled:!!(T&&T<=r.length||r.length===(p==null?void 0:p.length)),onClick:()=>{const O=[...r];let X=null;if(p){for(let K=0;K<p.length;K++)if(!r.find(ie=>ie.id===p[K].id)){X=p[K];break}}g==="select"&&p?O.push({name:X?X.name:p[0].name,id:(X==null?void 0:X.id)||p[0].id,...x}):g==="input"?O.push({name:{"en-US":""},id:Ge(),...x}):O.push({name:{"en-US":`Image ${r.length+1}`},id:Ge(),...x}),a(O)},style:{width:"fit-content"},children:s.jsxs("div",{className:Qe.addButton,children:[s.jsx("span",{children:"Add Option"}),s.jsx(Z,{name:"Plus",width:16,height:16})]})})})]}),v&&P&&s.jsx(no,{value:v,label:"Aspect Ratio",options:Object.keys(Ul),onChange:O=>P(O),leftAddonOptions:$l}),(n===void 0||n)&&i!==void 0&&s.jsx(Au,{otherTitle:"Other",items:i}),(n===void 0||n)&&_!==void 0&&s.jsx(cn,{label:_.title||"Auto scroll interval",type:"number",value:String(_.autoInterval),onChange:O=>_.setAutoInterval(Number(O)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},W2="_title_cx65i_1",q2="_subtitle_cx65i_5",Z2="_productsBlock_cx65i_14",G2="_top_cx65i_26",z2="_products_cx65i_14",Y2="_product_cx65i_14",X2="_button_cx65i_80",K2="_disabled_cx65i_91",J2="_buttons_cx65i_118",Q2="_modal_cx65i_125",e4="_link_cx65i_146",t4="_modalOptions_cx65i_152",n4="_addButton_cx65i_165",o4="_deleteButton_cx65i_180",r4="_closeIcon_cx65i_192",ho={title:W2,subtitle:q2,productsBlock:Z2,top:G2,products:z2,product:Y2,button:X2,disabled:K2,buttons:J2,modal:Q2,link:e4,modalOptions:t4,addButton:n4,deleteButton:o4,closeIcon:r4},a4=y.forwardRef((t,n)=>{const{activeItem:o,setActiveItem:r,popupPosition:a,modalOptions:i,setIsOpenModal:c}=t;return Ho(n,()=>{r(null),c(!1)}),s.jsxs("div",{ref:n,className:ho.modal,onClick:l=>{l.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[s.jsxs("div",{className:ho.top,children:[s.jsx("h3",{className:ho.title,children:o.name["en-US"]}),s.jsx("div",{className:ho.closeIcon,children:s.jsx(Z,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{r(null),c(!1)}})})]}),s.jsx("div",{className:ho.modalOptions,children:i.map(l=>{if(l.type==="image")return s.jsx(Lr,{label:"Put up an attractive image",activeImage:o[l.field],onChange:u=>{const d={...o,[l.field]:u};r(d)}},String(l.field));if(l.type==="text")return s.jsx(Ts,{isActiveText:!0,typesText:o[l.field.type],setTypesText:u=>{const d={...o,[l.field.type]:u};r(d)},alignText:o[l.field.alignText],setAlignText:u=>{const d={...o,[l.field.alignText]:u};r(d)},text:o[l.field.text]["en-US"]||"",setText:u=>{const d={...o,[l.field.text]:{"en-US":u}};r(d)},typeFont:o[l.field.type],setTypeFont:u=>{const d={...o,[l.field.type]:u};r(d)},subtitle:l.label});if(l.type==="input")return s.jsx(cn,{onChange:u=>{const d={...o,[l.field]:{"en-US":u}};r(d)},value:o[l.field]["en-US"]||"",label:l.label,placeholder:l.placeholder});if(l.type==="inputNumber")return s.jsx(cn,{onChange:u=>{const d={...o,[l.field]:u};r(d)},value:o[l.field]||"",label:l.label,placeholder:l.placeholder,type:"number"});if(l.type==="inputSwitch")return s.jsxs("div",{className:ho.link,children:[s.jsx(cn,{onChange:u=>{const d={...o,[l.field.text]:{"en-US":u}};r(d)},value:o[l.field.text]["en-US"]||"",label:l.inputLabel,placeholder:l.placeholder}),s.jsx(Dn,{current:!!o[l.field.switch]||!1,label:l.switchLabel,onChange:u=>{const d={...o,[l.field.switch]:u};r(d)}})]});if(l.type==="select")return s.jsx(no,{options:l.itemsOptions,onChange:u=>{const d={...o,[l.field]:u};r(d)},label:l.label,value:o[l.field]||"String",leftAddonOptions:l.leftAddonOptions})})})]})}),i4="_title_hvj8m_1",s4="_buttonsBlock_hvj8m_15",c4="_top_hvj8m_26",l4="_modal_hvj8m_120",u4="_options_hvj8m_146",d4="_closeIcon_hvj8m_154",Mo={title:i4,buttonsBlock:s4,top:c4,modal:l4,options:u4,closeIcon:d4},h4=y.forwardRef((t,n)=>{var x;const{activeButton:o,setActiveButton:r,popupPosition:a,editableLink:i=!0}=t,[c,l]=y.useState(o.typesText),[u,d]=y.useState(o.destination),[h,f]=y.useState(o.page),[m,g]=y.useState(o.link||""),[S,p]=y.useState(o.text||{"en-US":""}),[I,w]=y.useState(o.openInNewTab),{pages:C}=qn();return Ho(n,()=>{r(null)}),y.useEffect(()=>{r({...o,...{text:S,link:m,destination:u,typesText:c,page:h,openInNewTab:I}})},[c,u,m,S,h,I]),s.jsxs("div",{className:Mo.modal,onClick:T=>{T.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},ref:n,children:[s.jsxs("div",{className:Mo.top,children:[s.jsx("h3",{className:Mo.title,children:o.type}),s.jsx("div",{className:Mo.closeIcon,children:s.jsx(Z,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>r(null)})})]}),s.jsxs("div",{className:Mo.options,children:[i&&s.jsx(no,{label:"Destination",onChange:T=>d(T),options:["Go to Page","Open Link"].filter(T=>T!==u),value:u}),i&&(u==="Go to Page"?s.jsx(no,{label:"Go to",onChange:T=>{if(T==="Sign In")f("/customer-dash");else if(C){for(const _ in C)if(C[_].name===T){f(C[_].path);break}}else f(Vl[0])},options:C?[...Object.values(C).filter(T=>T.path!==h).map(T=>T.name),"Sign In"]:["Sign In"],value:C?h==="/customer-dash"?"Sign In":((x=Object.values(C).find(T=>T.path===h))==null?void 0:x.name)||"Home":"Home"}):s.jsx(cn,{onChange:T=>g(T),value:m,placeholder:"https://",label:"Link"})),i&&s.jsx(Dn,{current:o.openInNewTab,label:"Open in new tab",onChange:T=>w(T)}),s.jsx(xs,{onChange:T=>p({"en-US":T}),value:S["en-US"],label:"Text"}),s.jsx(ws,{typesText:c,setTypesText:l})]})]})}),f4="_wrapper_m18qi_1",p4="_subtitle_m18qi_7",m4="_content_m18qi_14",g4="_range_m18qi_22",I4="_track_m18qi_27",C4="_progress_m18qi_36",S4="_dots_m18qi_46",y4="_dot_m18qi_46",v4="_active_m18qi_65",b4="_input_m18qi_77",w4="_countBlock_m18qi_91",x4="_controls_m18qi_107",_4="_button_m18qi_113",Lt={wrapper:f4,subtitle:p4,content:m4,range:g4,track:I4,progress:C4,dots:S4,dot:y4,active:v4,input:b4,countBlock:w4,controls:x4,button:_4},ad=t=>{const{label:n,min:o=1,max:r=4,step:a=1,count:i,setCount:c}=t,[l,u]=y.useState(!1),d=Array.from({length:(r-o)/a+1}),h=(i-o)/(r-o)*100,f=()=>{i<r&&c(i+a)},m=()=>{i>o&&c(i-a)},g=S=>{const p=o+S*a;c(p)};return s.jsxs("div",{className:Lt.wrapper,children:[n&&s.jsx("h5",{className:Lt.subtitle,children:n}),s.jsxs("div",{className:Lt.content,children:[s.jsxs("div",{className:Lt.range,children:[s.jsx("div",{className:Lt.track}),s.jsx("div",{className:Lt.progress,style:{width:`${h}%`}}),s.jsx("div",{className:Lt.dots,children:d.map((S,p)=>{const I=p<=(i-o)/a;return s.jsx("button",{onClick:()=>g(p),className:te(Lt.dot,{[Lt.active]:I,[Lt.inactive]:!I,[Lt.dragging]:l}),"aria-label":`Set value to ${o+p*a}`},p)})}),s.jsx("input",{type:"range",min:o,max:r,step:a,value:i,onChange:S=>c(Number(S.target.value)),onMouseDown:()=>u(!0),onMouseUp:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1),className:Lt.input})]}),s.jsxs("div",{className:Lt.countBlock,children:[s.jsx(cn,{type:"number",min:o,max:r,paddingless:!0,onChange:S=>{const p=Number(S);p>r?c(r):p<o?c(o):c(p)},value:String(i)}),s.jsxs("div",{className:Lt.controls,children:[s.jsx("button",{onClick:f,disabled:i>=r,className:Lt.button,"aria-label":"Increment count",children:s.jsx(Z,{name:"CaretUp",width:15,height:15})}),s.jsx("button",{onClick:m,disabled:i<=o,className:Lt.button,"aria-label":"Decrement count",children:s.jsx(Z,{name:"CaretDown",width:15,height:15})})]})]})]})]})},T4="_title_11jyy_1",k4="_subtitle_11jyy_5",P4="_productsBlock_11jyy_14",L4="_top_11jyy_26",A4="_products_11jyy_14",E4="_product_11jyy_14",R4="_button_11jyy_80",D4="_buttons_11jyy_114",M4="_modal_11jyy_121",N4="_modalOptions_11jyy_148",B4="_addButton_11jyy_161",F4="_deleteButton_11jyy_176",j4="_closeIcon_11jyy_188",ir={title:T4,subtitle:k4,productsBlock:P4,top:L4,products:A4,product:E4,button:R4,buttons:D4,modal:M4,modalOptions:N4,addButton:B4,deleteButton:F4,closeIcon:j4},id=({render:t,block:n})=>t(n),sd=({settings:t,pageContext:n})=>{const{footer:o}=$n(),{settings:r}=_r(),{pageContext:a}=qn(),{footer:i}=vo();if(!i||!o)return null;const c=new i;return Object.keys(o).map(l=>{c[l]=o[l]}),c.renderBlock((t==null?void 0:t.blockSettings)||r,n||a)},cd=({settings:t,pageContext:n})=>{const{header:o}=$n(),{settings:r}=_r(),{pageContext:a}=qn(),{header:i}=vo();if(!i||!o)return null;const c=new i;return Object.keys(o).map(l=>{c[l]=o[l]}),c.renderBlock((t==null?void 0:t.blockSettings)||r,n||a)},ld=({settings:t,pageContext:n})=>{const{announcement:o}=$n(),{settings:r}=_r(),{pageContext:a}=qn(),{announcement:i}=vo();if(!i||!o)return null;const c=new i;return Object.keys(o).map(l=>{c[l]=o[l]}),c.renderBlock(t||r,n||a)},O4=async t=>{var i,c;const n=ct?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,o=gs.getState(),r=localStorage.getItem("shopPassword");if((i=o.general)!=null&&i.info.passwordProtected&&!r)return null;const a=`${Tu}/v2/shops/${n}/pages/${t}`+((c=o.general)!=null&&c.info.passwordProtected?`?password=${r}`:"");try{return await ze({url:a,withToken:!0,method:"get"})}catch(l){if(Oe.isAxiosError(l)&&l.response&&l.response.status===404)return null}},H4="_wrapper_5w9s8_1",V4={wrapper:H4},Ki=t=>{const{error:n}=t;return s.jsx("div",{className:V4.wrapper,children:n})},U4=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${nn}/v1/balance/top-up/${n}`;return await ze({url:o,method:"post",body:t,withToken:!1})},Zo=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${Pr}/v2/${n}/customers/${t}`;return await ze({url:o,withToken:!0,method:"get",typeToken:"customer"})},$4=()=>Zo("dash/info"),W4=()=>Zo("dash/dashboard/home"),q4=()=>Zo("rewards"),Z4=()=>Zo("balance"),G4=()=>Zo("balance/top-up/settings"),z4=()=>Zo("referral-system"),Ji=10,za=async({url:t,PageNumber:n})=>{var c;const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${Pr}/v2/${o}/${t}?PageNumber=${n}&PageSize=${Ji}`,a=await ze({url:r,withToken:!0,method:"get",typeToken:"customer"}),i=Number((c=a.headers)==null?void 0:c["x-pagination-total"]);return{list:a.data,totalCount:i}},Y4="https://customers-api.billgang.com";var jt=(t=>(t.Home="Home",t.Orders="Orders",t.Rewards="Rewards",t.Balance="Balance",t.Subscriptions="Subscriptions",t.Tickets="Tickets",t))(jt||{});const X4=[{caption:"Share link",description:"Send the link to your friends in all convenient ways"},{caption:"Purchase",description:"They buy a product from our store"},{caption:"Percentages",description:"You get rewards"}],ln=Fe(t=>({route:jt.Home,setRoute:n=>t(()=>({route:n})),dashInfo:null,setDashInfo:n=>t(()=>({dashInfo:n})),balance:null,setBalance:n=>t(()=>({balance:n})),otpRequest:{requested:!1,email:""},setOtpRequest:n=>t(()=>({otpRequest:n})),balanceSettings:null,setBalanceSettings:n=>t(()=>({balanceSettings:n})),gatewaysDetail:null,setGatewaysDetail:n=>t(()=>({gatewaysDetail:n}))})),_o=Fe(t=>({token:localStorage.getItem("token")||null,setToken:n=>t(()=>({token:n})),shopDomain:"",setShopDomain:n=>t(()=>({shopDomain:n})),shopId:"",setShopId:n=>t(()=>({shopId:n})),shopLogo:null,setShopLogo:n=>t(()=>({shopLogo:n})),shopPassword:localStorage.getItem("shopPassword")||"",setShopPassword:n=>t(()=>({shopPassword:n})),shopGeneral:null,setShopGeneral:n=>t(()=>({shopGeneral:n})),shopTerms:null,setShopTerms:n=>t(()=>({shopTerms:n})),shopPrivacyPolicy:null,setShopPrivacyPolicy:n=>t(()=>({shopPrivacyPolicy:n})),shopRefundPolicy:null,setShopRefundPolicy:n=>t(()=>({shopRefundPolicy:n}))}));class sr extends Error{}sr.prototype.name="InvalidTokenError";function K4(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,o)=>{let r=o.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function J4(t){let n=t.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return K4(n)}catch{return atob(n)}}function ud(t,n){if(typeof t!="string")throw new sr("Invalid token specified: must be a string");n||(n={});const o=n.header===!0?0:1,r=t.split(".")[o];if(typeof r!="string")throw new sr(`Invalid token specified: missing part #${o+1}`);let a;try{a=J4(r)}catch(i){throw new sr(`Invalid token specified: invalid base64 for part #${o+1} (${i.message})`)}try{return JSON.parse(a)}catch(i){throw new sr(`Invalid token specified: invalid json for part #${o+1} (${i.message})`)}}const Q4={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null};let No=null;const Qc=localStorage.getItem("token");if(Qc)try{No=ud(JSON.parse(Qc)||"")}catch{No=null}const Un=Fe(t=>({cart:{...Q4,customerEmail:No?No.email:""},products:[],coupon:null,pending:!1,applyCouponPending:!1,customerEmail:No?No.email:"",recaptcha:"",priceAdjusment:null,setCart:n=>t(o=>({cart:typeof n=="function"?n(o.cart):n})),setProducts:n=>t(o=>({products:typeof n=="function"?n(o.products):n})),setRecaptcha:n=>t({recaptcha:n}),setCoupon:n=>t({coupon:n}),setPending:n=>t({pending:n}),setApplyCouponPending:n=>t({applyCouponPending:n}),setCustomerEmail:n=>t({customerEmail:n}),setPriceAdjustment:n=>t({priceAdjusment:n})})),Dr=Fe(t=>({page:1,setPage:n=>t(()=>({page:n}))})),eC=Fe(t=>({discordInfo:null,setDiscordInfo:n=>t(()=>({discordInfo:n}))})),tC=Fe(t=>({subscription:null,setSubscription:n=>t({subscription:n})})),Ms=async(t,n="get",o)=>{const r=ct?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${nn}/v1/orders/${r}/${t}`;return await ze({url:a,method:n,withToken:!0,body:o,typeToken:"customer"})},nC=t=>Ms("","post",t),oC=({PageNumber:t})=>za({url:"customers/orders",PageNumber:t}),rC=t=>Ms(t),aC=t=>Ms(t),iC=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${nn}/v1/${n}/subscriptions`;return await ze({url:o,method:"post",withToken:!1,body:t})},sC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v2/${o}/subscriptions/${t}/${n}`;return await ze({url:r,method:"get",withToken:!1})},cC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v1/${o}/subscriptions/${t}/${n}/upgrades`;return await ze({url:r,method:"get",withToken:!1})},lC=async(t,n,o)=>{const r=ct?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${nn}/v1/${r}/subscriptions/${t}/${n}/cancel`;return await ze({url:a,method:"post",withToken:!1,body:o})},uC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v2/${o}/subscriptions/${t}/change-gateway`;return await ze({url:r,method:"post",withToken:!1,body:{gateway:n}})},dC=({PageNumber:t})=>za({url:"customers/subscriptions",PageNumber:t}),hC=async({id:t,accessToken:n})=>await cC(t,n),fC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v2/${o}/subscriptions/${t}/order`;return await ze({url:r,method:"post",withToken:!1,body:n})},pC=async(t,n)=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${nn}/v1/public/${o}/tickets/${t}/${n}`;return await ze({url:r,method:"get",withToken:!1})},mC=async(t,n,o,r)=>{const a=ct?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${nn}/v1/public/${a}/tickets/${t}/${n}/answer`;return(await ze({url:i,method:"post",body:{message:o,recaptcha:r},withToken:!1})).data},gC=({PageNumber:t})=>za({url:"customers/tickets",PageNumber:t}),IC=({PageNumber:t})=>za({url:"customers/balance/transactions",PageNumber:t}),dd=async t=>{const n=t.map(i=>["names",i]),o=new URLSearchParams(n),r=ct?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${nn}/v2/gateways?shopDomain=${r}&${o.toString()}`;return await ze({url:a,method:"get",withToken:!1})},CC=async({email:t,recaptcha:n})=>{const o=ct?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${Pr}/v2/${o}/auth/otp/request`;return(await ze({url:r,body:{email:t,recaptcha:n},method:"post",withToken:!1})).data?{requested:!0,email:t}:{requested:!1,email:void 0}},SC=async({email:t,otp:n,recaptcha:o})=>{const r=ct?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${Pr}/v2/${r}/auth/otp/login`,{data:i}=await ze({url:a,method:"post",body:{email:t,otp:n,recaptcha:o},withToken:!1});return _o.getState().setToken(i.data),localStorage.setItem("token",i.data),{token:i.data,requested:!1}},yC=async()=>{_o.getState().setToken(""),localStorage.removeItem("token")},vC=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${nn}/v2/coupons/${n}/validate`;return await ze({url:o,method:"post",body:t,withToken:!1})},bC=async t=>{const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${Y4}/v2/${n}/customers/referral-system/signup`;return(await ze({url:o,withToken:!0,method:"post",body:t,typeToken:"customer"})).data},wC=async()=>{const{data:t}=await z4();return t},xC=async t=>{const{data:n}=await bC(t);return n};async function _C(t){const n=ct?localStorage.getItem("fakeDomain"):window.location.hostname,o=`${Pr}/v2/${n}/customers/rewards/${t.id}/claim`;return ze({url:o,method:"post",withToken:!0,typeToken:"customer"})}const Ii="Balance",TC={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},kC={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null},el=(t,n)=>{var d;const{productId:o,productVariantId:r,quantity:a,chargeType:i}=n,c=t.find(h=>h.id===o);if(!c)throw new Error("Product does not exist");const l=c.variants.find(h=>h.id===r);if(!l)throw new Error("Variant does not exist");if(i==="RECURRING"&&!l.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(a!==void 0&&((d=l.quantity)!=null&&d.available)&&l.quantity.available<a)throw new Error("Not enough quantity available");const u=Un.getState().cart;if(u.parts.length>0){const h=t.find(m=>m.id===u.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===u.parts[0].productVariantId);if(f&&l.price.currency!==f.price.currency)throw new Error("Product have different currency")}return l},PC=(t,n)=>t.reduce((o,r)=>{var d,h;const a=n.find(f=>(f==null?void 0:f.id)===r.productId),i=a==null?void 0:a.variants.find(f=>f.id===r.productVariantId),{gateway:c}=Un.getState().cart,l=(i==null?void 0:i.gateways)||[],u=l.some(f=>f.name===c&&f.overrodePrice)?(d=l.find(f=>f.name===c))==null?void 0:d.overrodePrice:null;return r.chargeType==="ONE_TIME"?o+((u==null?void 0:u.amount)||(i==null?void 0:i.price.amount)||0)*r.quantity:i!=null&&i.subscriptionSettings?o+i.subscriptionSettings.price.amount+(((h=i.subscriptionSettings.entryFee)==null?void 0:h.amount)||0):o},0),LC=(t,n)=>({isRequired:n.some(r=>{var i;const a=t.find(c=>(c==null?void 0:c.id)===r.productId);return(i=a==null?void 0:a.variants.find(c=>c.id===r.productVariantId))==null?void 0:i.discordSettings.isRequired}),isEnabled:n.some(r=>{var i;const a=t.find(c=>(c==null?void 0:c.id)===r.productId);return(i=a==null?void 0:a.variants.find(c=>c.id===r.productVariantId))==null?void 0:i.discordSettings.isEnabled})}),tl=t=>new Set(t.gateways.map(n=>n.name)),nl={availableGateways:[],requiresSignInGateways:[]},ol=(t,n)=>{var i;if(n.length===0)return nl;const o=(i=n[0])==null?void 0:i.variants[0];if(!o)return nl;const r=tl(o);for(const c of t){const l=n.find(h=>h.id===c.productId);if(!l)continue;const u=l.variants.find(h=>h.id===c.productVariantId);if(!u)continue;const d=tl(u);for(const h of r)d.has(h)||r.delete(h)}return!localStorage.getItem("token")&&r.has(Ii)?(r.delete(Ii),{availableGateways:[...r],requiresSignInGateways:[Ii]}):{availableGateways:[...r],requiresSignInGateways:[]}},AC=(t,n)=>{if(t.length===0)return[];const r=t.map(i=>{const c=n.find(u=>u.id===i.productId),l=c==null?void 0:c.variants.find(u=>u.id===i.productVariantId);return(l==null?void 0:l.customFields)??[]}).flat().reduce((i,c)=>{const l=i[c.name];return l?(c.required&&!l.required&&(i[c.name]={...c,value:c.defaultValue}),i):(i[c.name]={...c,value:c.defaultValue},i)},{});return Object.values(r).map(i=>({...i,value:""}))},EC=(t,n)=>{const o=n.find(a=>a.id===t.productId),r=o==null?void 0:o.variants.find(a=>a.id===t.productVariantId);return t.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},RC=()=>{const{cart:t,products:n,coupon:o,pending:r,applyCouponPending:a,customerEmail:i,setCart:c,setProducts:l,setCoupon:u,setPending:d,setApplyCouponPending:h}=Un(),f=async p=>{var v;h(!0);const{cart:I}=Un.getState(),{gateway:w,parts:C}=I,{notifications:x,setNotifications:T}=Et.getState();w||(h(!1),T([...x,{message:"There should be a gateway for the coupon",status:"error",id:Ge()}]));const _=C.map(P=>P.productId);let D=null;try{const{data:P}=await vC({gateway:w,couponName:p,productIds:_});D=P.data,T([...x,{message:"Coupon is applied",status:"success",id:Ge()}]),c(N=>({...N,coupon:p}))}catch(P){const N=P;T([...x,{message:`Coupon is not applied: ${N.message}`,status:"error",id:Ge()}]),c(M=>({...M,coupon:null})),u(null),h(!1)}if(h(!1),(v=D==null?void 0:D.restrictToProductIds)!=null&&v.length&&!_.every(P=>{var N;return(N=D==null?void 0:D.restrictToProductIds)==null?void 0:N.includes(P)}))throw new Error("Coupon can't be applied to such products");return u(D),D},S={reset(){c({...kC})},addProducts:p=>{const I=Un.getState().products,w=p.filter(C=>!I.some(x=>x.id===C.id));l([...I,...w])},addProductToCart:p=>{const I=Un.getState().cart;try{el(n,p)}catch(C){throw new Error(C)}const w=I.parts.find(C=>C.productId===p.productId&&C.productVariantId===p.productVariantId&&C.chargeType===p.chargeType);if(w)return S.updateQuantityOfProduct({...w,quantity:(w.quantity||1)+(p.quantity||1),chargeType:p.chargeType});if(I.parts.length&&!ol([...I.parts,p],n).availableGateways.length)throw new Error("No common payment gateways available");c({...I,parts:[...I.parts,p]})},removeProduct({productId:p,productVariantId:I}){c(w=>({...w,parts:w.parts.filter(C=>C.productId!==p||C.productVariantId!==I)}))},getPossibleGateways(){return ol(t.parts,n)},removeCoupon(){u(null)},getDiscordSettings(){return LC(n,t.parts)},updateQuantityOfProduct(p){el(n,p),c(I=>({...I,parts:I.parts.map(w=>w.productId===p.productId&&w.productVariantId===p.productVariantId?{...w,quantity:p.quantity,chargeType:p.chargeType}:w)}))},getTotalAndDiscount(){const{coupon:p}=Un.getState(),I=PC(t.parts,n);let w;return p&&p.discount&&(!p.isFixed&&p.discount===100?w=0:w=p.isFixed?Math.max(0,I-p.discount):I*(1-p.discount/100)),{total:I,totalWithDiscount:w}},setGateway(p){c(I=>({...I,gateway:p})),t.coupon&&f(t.coupon)},setPaymentMethod(p){c(I=>({...I,paymentMethod:p}))},async submitCart(p){d(!0);const{cart:I}=Un.getState();let w;if(I.parts&&i&&EC(I.parts[0],n))try{const{data:C}=await iC({...I,partOrder:I.parts[0],referralCode:localStorage.getItem("referralCode"),customerEmail:i,recaptcha:p,customFields:{...I.customFields}});w=C.data}catch(C){console.error(C)}else try{const{data:C}=await nC({...I,referralCode:localStorage.getItem("referralCode"),recaptcha:p,customFields:{...I.customFields}});w=C.data}catch(C){const{notifications:x,setNotifications:T}=Et.getState();T([...x,{message:`Failed to create order: ${C}`,status:"error",id:Ge()}])}if(d(!1),w)return w;throw new Error("Failed to create order")},setDiscordSocialConnectId(p){c(I=>({...I,discordSocialConnectId:p}))},setCustomFields(p){c(I=>({...I,customFields:{...p}}))}};return y.useEffect(()=>{c(p=>({...p,customerEmail:i??""}))},[i,c]),{cart:t,products:n,coupon:o,pending:r,applyCouponPending:a,applyCoupon:f,...S}},Ya=()=>{const{notifications:t,setNotifications:n}=Et();return o=>{navigator.clipboard.writeText(o),n([...t,{status:"success",message:"Successfully copied",id:Ge()}])}};function hd(t,n=!0){if(!t||typeof t!="string")return"";if(/<[a-z][\s\S]*>/i.test(t))return t;const r=t.split(" "),a=20;if(n){let i="",c=[];return r.forEach(l=>{l.length>a?(c.length>0&&(i+=`<span style="hyphens: manual">${c.join(" ")} </span>`,c=[]),i+=`<span style="hyphens: auto" lang="en">${l} </span>`):c.push(l)}),c.length>0&&(i+=`<span style="hyphens: manual">${c.join(" ")}</span>`),i}else{const i=[];let c=[],l=0;return r.forEach(u=>{u.length>a?(c.length>0&&(i.push(s.jsxs("span",{style:{hyphens:"manual"},children:[c.join(" ")," "]},l++)),c=[]),i.push(s.jsxs("span",{style:{hyphens:"auto"},lang:"en",children:[u," "]},l++))):c.push(u)}),c.length>0&&i.push(s.jsx("span",{style:{hyphens:"manual"},children:c.join(" ")},l++)),i}}const DC=y.forwardRef((t,n)=>{const{activeItem:o,setActiveItem:r,popupPosition:a,setIsOpenModal:i,itemsOptions:c}=t,l=c.find(u=>u.id===o.listingId);return Ho(n,()=>{r(null),i(!1)}),l?s.jsxs("div",{className:ir.modal,onClick:u=>{u.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[s.jsxs("div",{className:ir.top,children:[s.jsx("h3",{dangerouslySetInnerHTML:{__html:hd(l.productData.name)}}),s.jsx("div",{className:ir.closeIcon,children:s.jsx(Z,{name:"X",height:20,width:20,onClick:()=>{i(!1),r(null)}})})]}),s.jsx("div",{className:ir.modalOptions,children:s.jsx(Lr,{label:"Put up an attractive image",activeImage:l.productData.images.length>0?l.productData.images[0].cfId:o.image?o.image:void 0,onChange:u=>{const d={...o,image:u[0]};r(d)}})})]}):null}),MC="_wrapper_235d9_1",NC="_label_235d9_9",BC="_input_235d9_18",FC="_disabled_235d9_31",jC="_paddingless_235d9_36",OC="_content_235d9_40",HC="_contentBorder_235d9_53",VC="_contentField_235d9_58",UC="_borderless_235d9_62",$C="_rightIcon_235d9_67",WC="_leftIcon_235d9_75",qC="_requiredStar_235d9_82",Ht={wrapper:MC,label:NC,input:BC,disabled:FC,paddingless:jC,content:OC,contentBorder:HC,contentField:VC,borderless:UC,rightIcon:$C,leftIcon:WC,requiredStar:qC},xo=t=>{const{onChange:n,style:o,label:r,value:a,type:i="text",min:c,max:l,placeholder:u,disabled:d=!1,required:h=!1,regex:f,paddingless:m=!1,borderless:g=!1,editable:S=!1,isSearch:p=!1,centered:I=!1,maxSymbols:w,rightIcon:C,onFocus:x,leftIcon:T}=t,{themeSettings:_}=bo(),{inputs:D}=_,[v,P]=y.useState(!1);function N(q){if(Number(q)<0)return String(c);const j=q.replace(/[^\d-]/g,"");return Number(j)<0?String(c):j}function M(q){return!h||!f?!0:new RegExp(f).test(q)}return s.jsxs("div",{className:Ht.wrapper,children:[r&&s.jsxs("label",{className:Ht.label,htmlFor:r,children:[r,h&&s.jsx("span",{className:Ht.requiredStar,children:"*"})]}),s.jsxs("div",{className:te(Ht.content,{[Ht.contentBorder]:D.border.active,[Ht.contentField]:D.field.active,[Ht.disabled]:d}),style:{...o},children:[T&&s.jsx("div",{className:Ht.leftIcon,children:T}),s.jsx("input",{maxLength:w,id:r,type:i||"text",onChange:q=>{if(i==="text")n(q.target.value);else{const j=N(q.target.value);n(j)}},value:a,autoComplete:"off",placeholder:u||"Type something...",className:te(Ht.input,{[Ht.required]:v&&h&&!M(a),[Ht.paddingless]:m,[Ht.borderless]:g}),min:i==="number"?c:void 0,max:i==="number"?l:void 0,onFocus:()=>{x&&x(),P(!0)},disabled:d,style:{textAlign:I?"center":"left",padding:p?`7px ${Number(D.general.size)+20}px 7px ${T?35:11}px`:`7px ${C?35:11}px 7px ${T?35:11}px`}}),C&&s.jsx("div",{className:Ht.rightIcon,children:C}),p&&s.jsx("div",{className:Ht.rightIcon,children:s.jsx(Z,{name:"MagnifyingGlass",fill:"var(--text-secondary)",width:D.general.size,height:D.general.size})}),S&&s.jsx("div",{children:s.jsx(Z,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},ZC="_button_3j1b9_1",GC="_primary_3j1b9_20",zC="_primaryHovered_3j1b9_30",YC="_secondary_3j1b9_35",XC="_secondaryHovered_3j1b9_45",KC="_tertiary_3j1b9_50",JC="_special_3j1b9_60",QC="_tertiaryHovered_3j1b9_64",e0="_content_3j1b9_69",On={button:ZC,primary:GC,primaryHovered:zC,secondary:YC,secondaryHovered:XC,tertiary:KC,special:JC,tertiaryHovered:QC,content:e0},t0=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,fd=({children:t,className:n,as:o="span",...r})=>{const[a,i]=y.useState(!1);return y.useEffect(()=>{typeof window<"u"&&i(t0())},[]),a?s.jsx(o,{className:n,...r,"data-stable-text":t,dangerouslySetInnerHTML:{__html:""}}):s.jsx(o,{className:n,...r,children:t})},st=t=>{const{children:n,onClick:o,style:r,className:a,disabled:i=!1,type:c="Primary",dangerouslySetInnerHTML:l}=t,{themeSettings:u}=bo(),d=S=>typeof S=="string"?s.jsx(fd,{children:S}):S,h={onClick:o,disabled:i,style:r,className:te(On.button,a,{[On.primary]:c==="Primary",[On.secondary]:c==="Secondary",[On.tertiary]:c==="Tertiary",[On.primaryHovered]:c==="Primary"&&!i&&u.buttons.primary.hover,[On.secondaryHovered]:c==="Secondary"&&!i&&u.buttons.secondary.hover,[On.tertiaryHovered]:c==="Tertiary"&&!i&&u.buttons.tertiary.hover})};if(c==="Special")return s.jsx("button",{...h,className:On.special,...l?{dangerouslySetInnerHTML:l}:{children:d(n)}});const f=c.toLowerCase(),m=u.buttons[f],g=c==="Tertiary"?s.jsxs("div",{className:On.content,children:[d(n),s.jsx(Z,{name:"ArrowRight",fill:"var(--text-tertiary)",width:20,height:20})]}):d(n);return s.jsx("button",{...h,style:{...r,textAlign:m.alignment},...l?{dangerouslySetInnerHTML:l}:{children:g}})},An=(t,n="auto")=>t==="not found"?"empty":`https://imagedelivery.net/${t}/w=${n}`,Zt=t=>{const n=new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD"});let o=t.amount;return t.quantity&&(o=o*t.quantity),n.format(o)},n0=(t,n)=>{if(t===0)throw new Error("Old value cannot be zero, as it would result in division by zero.");return(n-t)/Math.abs(t)*100},o0=t=>{if(Math.abs(t-365)<=15){const i=Math.round(t/365);return i===1?"year":`${i} years`}else if(Math.abs(t-30)<=5){const i=Math.round(t/30);return i===1?"month":`${i} months`}else return`${t} days`},r0=t=>new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),vr=t=>{const n=new Date(t),o={day:"2-digit",month:"2-digit",year:"numeric"},r={hour:"2-digit",minute:"2-digit"},a=n.toLocaleString("en-US",o),i=n.toLocaleString("en-US",r);return[a,i]},a0=t=>{const n=window.localStorage.getItem(t);if(n===null)return null;try{return JSON.parse(n)}catch{return n}},i0=(t,n)=>{(n===null||typeof n!="object")&&window.localStorage.setItem(t,String(n));const o=JSON.stringify(n);window.localStorage.setItem(t,o)},s0="_modal_1iz94_1",c0="_padding_1iz94_17",l0="_content_1iz94_21",u0="_close_1iz94_42",zr={modal:s0,padding:c0,content:l0,close:u0},Xa=t=>{const{close:n,children:o,withAnimation:r=!0,hasPadding:a=!0}=t,{isOpen:i,setIsOpen:c}=Zn(),l=()=>{c(!1),r?setTimeout(()=>{n(!1),c(!0)},300):(n(!1),c(!0))};return y.useEffect(()=>{const u=d=>{d.key==="Escape"&&l()};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[]),go.createPortal(s.jsx("div",{className:te(zr.modal,{[zr.padding]:a}),onClick:l,children:r?s.jsx("div",{className:te(zr.content,{[zr.close]:!i}),children:o}):s.jsx(s.Fragment,{children:o})}),document.body)},pd=({children:t,path:n,className:o,target:r="_self",id:a})=>{if(window.location.pathname.includes("/admin/builder"))return s.jsx("div",{className:o,role:"link",style:{cursor:"pointer"},id:a,children:t});const i=Rn(),c=/^https?:\/\//.test(n),l=u=>{c||r==="_blank"?r==="_blank"?window.open(n,"_blank"):window.open(n,"_self"):(u.preventDefault(),i(n,{replace:!1}))};return s.jsx("div",{onClick:l,className:o,role:"link",style:{cursor:"pointer"},id:a,children:t})},d0="_loader_3je9m_1",h0={loader:d0},un=t=>s.jsx("div",{className:h0.loader,...t}),f0="_container_6vcrl_1",p0="_wrapper_6vcrl_5",rl={container:f0,wrapper:p0};class m0{constructor(){Xo(this,"observer",null);Xo(this,"callbacks",new Map);Xo(this,"handleWindowResize",()=>{this.callbacks.forEach((n,o)=>{const r=o.getBoundingClientRect().width;n.forEach(a=>a(r))})});this.observer=new ResizeObserver(n=>{var o;for(const r of n){const a=r.contentRect.width,i=r.target;this.callbacks.has(i)&&((o=this.callbacks.get(i))==null||o.forEach(c=>c(a)))}}),window.addEventListener("resize",this.handleWindowResize)}observe(n,o){var a;if(!this.observer)return;this.callbacks.has(n)||(this.callbacks.set(n,[]),this.observer.observe(n)),(this.callbacks.get(n)||[]).includes(o)||(a=this.callbacks.get(n))==null||a.push(o)}unobserve(n,o){var r;if(!(!this.observer||!this.callbacks.has(n))){if(o){const a=this.callbacks.get(n)||[];this.callbacks.set(n,a.filter(i=>i!==o))}(r=this.callbacks.get(n))!=null&&r.length||(this.callbacks.delete(n),this.observer.unobserve(n))}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callbacks.clear(),window.removeEventListener("resize",this.handleWindowResize)}}const al=new m0;function md(t){const[n,o]=y.useState("desktop");return y.useEffect(()=>{const r=t.current;if(!r)return;const a=l=>l>=1081?"desktop":l>=720?"tablet":"mobile",i=l=>{const u=a(l);o(u)};al.observe(r,i);const c=r.getBoundingClientRect().width;return i(c),()=>{al.unobserve(r,i)}},[t]),n}const Yr=16,gd=({children:t,padding:n,style:o,notPadding:r=!1})=>{const a=y.useRef(null),i=md(a);return s.jsx("div",{className:rl.container,ref:a,style:o,children:s.jsx("div",{className:rl.wrapper,style:{maxWidth:"var(--max-width-store)",paddingTop:i==="desktop"?n==null?void 0:n.top:r?0:Yr,paddingBottom:i==="desktop"?n==null?void 0:n.bottom:r?0:Yr,paddingLeft:i==="desktop"?n==null?void 0:n.left:r?0:Yr,paddingRight:i==="desktop"?n==null?void 0:n.right:r?0:Yr,...o},children:t(i)})})},g0="_wrapper_oxpf7_1",I0="_label_oxpf7_10",C0="_contentBorder_oxpf7_19",S0="_textarea_oxpf7_23",y0="_contentField_oxpf7_35",v0="_length_oxpf7_49",lo={wrapper:g0,label:I0,contentBorder:C0,textarea:S0,contentField:y0,length:v0},b0=t=>{const{onChange:n,label:o,value:r,maxLength:a,placeholder:i="Type something...",type:c="text",required:l=!1}=t,[u,d]=y.useState(r.length),{themeSettings:h}=bo();function f(m){return c==="number"?m.replace(/[^\d\n]+/g,""):m}return s.jsxs("div",{className:lo.wrapper,children:[o&&s.jsxs("label",{className:lo.label,htmlFor:o,children:[o,l&&s.jsx("span",{className:lo.requiredStar,children:"*"})]}),s.jsx("textarea",{id:o,value:r,onChange:m=>{const g=f(m.target.value);d(g.length),n(g)},placeholder:i,className:te(lo.textarea,{[lo.contentBorder]:h.inputs.border.active,[lo.contentField]:h.inputs.field.active}),maxLength:a}),a&&s.jsxs("div",{className:lo.length,children:[u,"/",a]})]})},w0="_wrapper_ty9h3_2",x0="_label_ty9h3_9",_0="_top_ty9h3_17",T0="_select_ty9h3_23",k0="_borderFocused_ty9h3_42",P0="_input_ty9h3_49",L0="_icon_ty9h3_59",A0="_rotate_ty9h3_64",E0="_content_ty9h3_68",R0="_options_ty9h3_72",D0="_filteredOptions_ty9h3_93",M0="_open_ty9h3_97",N0="_option_ty9h3_72",B0="_focused_ty9h3_115",F0="_addon_ty9h3_119",j0="_value_ty9h3_130",O0="_postfix_ty9h3_135",H0="_leftAddon_ty9h3_139",St={wrapper:w0,label:x0,top:_0,select:T0,borderFocused:k0,input:P0,icon:L0,rotate:A0,content:E0,options:R0,filteredOptions:D0,open:M0,option:N0,focused:B0,addon:F0,value:j0,postfix:O0,leftAddon:H0};function V0(t,n){y.useEffect(()=>{function o(r){!t.current||t.current.contains(r.target)||n(r)}return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[t,n])}const Id=t=>{var P,N;const{onChange:n,label:o,value:r,options:a,style:i,switcher:c,postfixs:l,leftAddonOptions:u}=t,[d,h]=y.useState(!1),[f,m]=y.useState(""),[g,S]=y.useState(null),[p,I]=y.useState(!1),w=y.useRef(null);V0(w,()=>h(!1));function C(M){m(""),n(M),h(!1),S(null)}function x(M,q){return M?M.length>q+3?`${M.slice(0,q)}...`:M:""}function T(M){if(!d){(M.key==="Enter"||M.key==="ArrowDown")&&h(!0);return}const q=v;M.key==="ArrowDown"&&(M.preventDefault(),S(j=>j===null||j===q.length-1?0:j+1)),M.key==="ArrowUp"&&(M.preventDefault(),S(j=>j===null||j===0?q.length-1:j-1)),M.key==="Enter"&&g!==null&&(M.preventDefault(),C(q[g])),M.key==="Escape"&&h(!1)}const _=y.useRef(null),D=y.useMemo(()=>new Gn(a,{threshold:.4,minMatchCharLength:2}),[a]),v=y.useMemo(()=>p&&f.trim()!==""?D.search(f).map(M=>M.item):a,[f,a,p,D]);return s.jsxs("div",{className:St.wrapper,style:{...i},children:[o&&s.jsxs("div",{className:St.top,children:[s.jsx("label",{className:St.label,htmlFor:o,children:o}),c&&s.jsx(Dn,{current:c.value,onChange:c.onChange})]}),s.jsxs("label",{className:St.content,ref:w,children:[s.jsxs("div",{className:te(St.select,{[St.borderFocused]:d}),onKeyDown:T,onClick:M=>{M.stopPropagation(),h(q=>!q),I(!1)},ref:_,tabIndex:0,children:[u&&u.length>0&&s.jsx("div",{className:St.addon,children:(P=u.find(M=>M.value===r))==null?void 0:P.addon}),s.jsx("div",{className:St.input,id:"md",children:x(r,15)}),s.jsx("div",{className:te(St.icon,{[St.rotate]:d}),onClick:M=>{M.stopPropagation(),h(q=>!q)},children:s.jsx(Z,{name:"CaretDown",width:16,height:16,fill:"var(--text-primary)"})})]}),s.jsxs("div",{className:te(St.options,{[St.open]:d}),style:{top:((N=_.current)==null?void 0:N.clientHeight)+10},children:[a.length>6&&s.jsx(xo,{type:"text",value:f,placeholder:"Search...",onChange:M=>{m(M),I(!0)},isSearch:!0}),s.jsxs("div",{className:St.filteredOptions,children:[v.map((M,q)=>{var j;return s.jsxs("div",{className:te(St.option,{[St.focused]:q===g}),onClick:()=>{C(M),h(!1)},id:"md",children:[u&&u.length>0&&s.jsx("div",{className:St.leftAddon,children:(j=u.find(G=>G.value===M))==null?void 0:j.addon}),s.jsx("span",{className:St.value,id:"md",children:x(M,20)}),l&&s.jsx("span",{className:St.postfix,id:"md",children:l[q]})]},M)}),v.length===0&&s.jsx("div",{children:"No results found."})]})]})]})]})},U0="_wrapper_2vleg_1",$0="_label_2vleg_9",W0="_options_2vleg_17",q0="_radioLabel_2vleg_23",Z0="_radio_2vleg_23",G0="_custom_2vleg_38",z0="_option_2vleg_17",uo={wrapper:U0,label:$0,options:W0,radioLabel:q0,radio:Z0,custom:G0,option:z0},Y0=t=>{const{defaultValue:n,options:o,onChange:r,label:a,flexDirection:i="row"}=t,[c,l]=y.useState(n),u=d=>{const h=d.target.value;l(h),r(h)};return s.jsxs("div",{className:uo.wrapper,children:[s.jsx("span",{className:uo.label,children:a}),s.jsx("div",{className:uo.options,style:{flexDirection:i},children:o.map(d=>s.jsxs("label",{className:uo.radioLabel,children:[s.jsx("input",{type:"radio",value:d.value,checked:c===d.value,onChange:u,className:uo.radio}),s.jsx("span",{className:uo.custom}),s.jsx("span",{className:uo.option,children:d.label})]},d.value))})]})},X0="_content_eonwv_1",K0="_main_eonwv_12",J0="_block_eonwv_16",Q0="_active_eonwv_22",e3="_name_eonwv_32",t3="_addSection_eonwv_109",n3="_addSectionTop_eonwv_117",Yn={content:X0,main:K0,block:J0,active:Q0,name:e3,addSection:t3,addSectionTop:n3},o3="_sidebar_xhqpt_1",r3="_content_xhqpt_14",a3="_button_xhqpt_24",i3="_moveButton_xhqpt_40",s3="_deleteButton_xhqpt_49",Tn={sidebar:o3,content:r3,button:a3,moveButton:i3,deleteButton:s3},c3=()=>{var _;const{activeBlock:t,setActiveBlock:n}=Fa(),{blocks:o,removeBlock:r,moveBlock:a,duplicateBlock:i,setCurrentBlock:c}=$n(),{currentPage:l,pages:u}=qn(),{setTitle:d,setDescription:h,setOnConfirm:f}=ql(),{setActiveBlock:m}=vo(),g=(_=u==null?void 0:u[l])==null?void 0:_.path,S=g?o[g]:null,p=(S==null?void 0:S.order)||[],I=p.indexOf(t.id),w=D=>{D.stopPropagation(),I>0&&g&&(a(g,I,I-1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},C=D=>{D.stopPropagation(),I<p.length-1&&g&&(a(g,I,I+1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},x=D=>{D.stopPropagation(),g&&i(g,t.id)},T=()=>{g&&(r(g,t.id),c(null),m(null),n({id:null,neededScroll:!1}))};return s.jsx("div",{className:Tn.sidebar,children:s.jsxs("div",{className:Tn.content,children:[s.jsx("button",{onClick:w,className:te(Tn.button,Tn.moveButton),disabled:I===0,children:s.jsx(Z,{name:"ArrowUp"})}),s.jsx("button",{onClick:C,className:te(Tn.button,Tn.moveButton),disabled:I===p.length-1,children:s.jsx(Z,{name:"ArrowDown"})}),s.jsx("button",{onClick:x,className:te(Tn.button,Tn.moveButton),children:s.jsx(Z,{name:"Copy"})}),s.jsx("button",{className:te(Tn.button,Tn.deleteButton),onClick:D=>{D.stopPropagation(),d("Remove Block"),h(`Are you sure you want to delete ${(S==null?void 0:S.data[t.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),f(T)},children:s.jsx(Z,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})};function cr(t,n){if(!n||!n[t])return"unknown name";const o=new n[t];return!o.blockSettings||!o.blockSettings.displayName?"unknown name":o.blockSettings.displayName}const l3=y.memo(({scrollableRef:t})=>{const{setActiveBlock:n,activeBlock:o,zoomLevel:r}=Fa(),{blocks:a,sourceBlocks:i}=vo(),{blocks:c,setCurrentBlock:l,currentBlock:u,setPositionBlock:d,announcement:h}=$n(),{settings:f}=_r(),{currentPage:m,pages:g,pageContext:S}=qn(),{activeBlock:p,setActiveBlock:I}=bo(),{setError:w}=Wl(),{setActiveBlock:C}=vo(),x=y.useRef(o.id),T=y.useRef({});y.useEffect(()=>{if(o.id&&o.neededScroll&&T.current[o.id]){const v=T.current[o.id];if(v&&t.current){const P=v.offsetTop;t.current.scrollTo({top:P-30,behavior:"smooth"})}}},[o,t]);const _=Rn();y.useEffect(()=>{x.current=o.id},[o.id]);const D=v=>{if(!v||!v.name)return w({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:g&&g[m].id?[g[m].id]:[]}),s.jsx(Ki,{error:"Block or block.name is undefined."});if(!a||!a[v.name])return w({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:g&&g[m].id?[g[m].id]:[]}),s.jsx(Ki,{error:`Block "${v.name}" does not exist in blocks.`});const P=new a[v.name];return v.value&&Object.assign(P,v.value),P.renderBlock(f==null?void 0:f.blockSettings,S)};return s.jsxs("div",{onClick:v=>{v.stopPropagation()},className:Yn.content,style:{width:"100%",height:"100%",zoom:`${r}`},ref:t,children:[h&&s.jsx(ld,{}),s.jsx(cd,{}),s.jsx("div",{className:Yn.main,children:g&&g[m]&&c[g[m].path]&&c[g[m].path].data&&c[g[m].path].order.map(v=>s.jsxs("div",{ref:P=>T.current[v]=P,onClick:P=>{P.stopPropagation(),C(null),p&&I(null),n({id:v,neededScroll:!0}),setTimeout(()=>{n({id:v,neededScroll:!1})},100),l(null),u?setTimeout(()=>{l(o.id)},100):l(o.id)},onMouseEnter:P=>{P.stopPropagation(),o.neededScroll||n({id:v,neededScroll:!1})},onMouseLeave:P=>{P.stopPropagation(),o.neededScroll||n({id:null,neededScroll:!1})},className:te(Yn.block),children:[(o.id===v||u===v)&&s.jsx("div",{className:Yn.active}),(o.id===v||u===v)&&s.jsx("div",{className:Yn.name,children:cr(c[g[m].path].data[v].name,i)}),(o.id===v||u===v)&&cr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx(c3,{}),(o.id===v||u===v)&&cr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx("div",{className:Yn.addSection,children:s.jsx(Fo,{onClick:P=>{P.stopPropagation(),d(v,!0),l(null),n({id:null,neededScroll:!1}),C(null),_("/admin/builder/add")},children:"Add Section"})}),(o.id===v||u===v)&&cr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx("div",{className:te(Yn.addSection,Yn.addSectionTop),children:s.jsx(Fo,{onClick:P=>{P.stopPropagation(),d(v,!1),l(null),n({id:null,neededScroll:!1}),C(null),_("/admin/builder/add")},children:"Add Section"})}),a&&s.jsx(id,{render:D,block:c[g[m].path].data[v]})]},v))}),s.jsx(sd,{})]})}),u3="_statItem_fzeec_1",d3="_content_fzeec_44",h3="_withChildren_fzeec_50",f3="_info_fzeec_56",p3="_iconWrapper_fzeec_68",m3="_text_fzeec_78",g3="_title_fzeec_84",I3="_value_fzeec_88",C3="_emptyImage_fzeec_94",S3="_image_fzeec_11",y3="_imageTitle_fzeec_112",v3="_emptyImageText_fzeec_122",b3="_hoverable_fzeec_147",dt={statItem:u3,content:d3,withChildren:h3,info:f3,iconWrapper:p3,text:m3,title:g3,value:I3,emptyImage:C3,image:S3,imageTitle:y3,emptyImageText:v3,hoverable:b3},rn=({iconName:t,title:n,value:o,image:r,imageName:a,children:i,className:c,logo:l,productSlug:u})=>{const d=Rn();return s.jsxs("div",{className:`${dt.statItem} ${c}`,children:[r&&r!=="empty"&&s.jsxs("div",{style:{position:"relative"},onClick:()=>{u&&d(`/${u}`)},children:[s.jsx("div",{style:{background:"#000000"},children:s.jsx("img",{src:r,alt:a,className:te(dt.image,dt.emptyImage,{[dt.hoverable]:u})})}),s.jsx("div",{className:dt.emptyImageText,children:s.jsx("div",{className:te(dt.title,dt.imageTitle),id:"h5",children:a})})]}),r==="empty"&&s.jsx("div",{style:{background:"#000000"},children:s.jsxs("div",{className:te(dt.emptyImage,{[dt.hoverable]:u}),onClick:()=>{u&&d(`/${u}`)},children:[s.jsx(Z,{name:"Image",width:64,height:64,fill:"var(--text-secondary)"}),s.jsx("div",{className:dt.emptyImageText,children:s.jsx("div",{className:dt.title,id:"h5",children:a||"No Product"})})]})}),s.jsxs("div",{className:`${dt.content} ${i?dt.withChildren:""}`,children:[s.jsxs("div",{className:dt.info,children:[l?s.jsx("div",{className:dt.iconWrapper,children:s.jsx("img",{src:l,width:28,height:28})}):s.jsx(Z,{name:t||"File",className:dt.iconWrapper,width:28,height:28,fill:"var(--text-action)"}),s.jsxs("div",{className:dt.text,children:[s.jsx("div",{className:dt.title,id:"h5",children:n}),s.jsx("div",{className:dt.value,id:"h5-bold",children:o})]})]}),i]})]})},w3="_card_10fve_2",x3="_mobile_10fve_15",_3="_email_10fve_19",T3="_balance_10fve_25",k3="_sidebar_10fve_32",P3="_navList_10fve_56",L3="_navItem_10fve_71",A3="_activeNavItem_10fve_84",E3="_inactiveNavItem_10fve_89",R3="_logoutNavItem_10fve_98",D3="_iconWrapper_10fve_107",M3="_skeleton_10fve_112",Dt={card:w3,mobile:x3,email:_3,balance:T3,sidebar:k3,navList:P3,navItem:L3,activeNavItem:A3,inactiveNavItem:E3,logoutNavItem:R3,iconWrapper:D3,skeleton:M3},N3=({email:t,balance:n,adaptiveStyles:o})=>s.jsxs("div",{className:te(Dt.card,{[Dt.mobile]:o!=="desktop"}),children:[s.jsx("div",{className:Dt.email,id:"h5",children:t}),s.jsxs("div",{className:Dt.balance,id:"md",children:["Balance: ",n]})]}),B3=[[jt.Home,"House"],[jt.Orders,"CurrencyCircleDollar"],[jt.Rewards,"Medal"],[jt.Balance,"Wallet"],[jt.Subscriptions,"CalendarCheck"],[jt.Tickets,"Question"]],il=({children:t,className:n="",onClick:o})=>s.jsx("button",{type:"button",className:te(Dt.navItem,n),onClick:o,children:t}),F3=({adaptiveStyles:t})=>{const{route:n,setRoute:o}=ln();return s.jsxs("div",{className:te(Dt.navList,{[Dt.mobile]:t!=="desktop"}),children:[B3.map(([r,a])=>{const i=r===n;return s.jsxs(il,{onClick:()=>o(r),className:te(i?Dt.activeNavItem:Dt.inactiveNavItem),children:[s.jsx("div",{className:Dt.iconWrapper,children:s.jsx(Z,{name:a})}),s.jsx("div",{children:r})]},r)}),s.jsxs(il,{className:Dt.logoutNavItem,onClick:()=>{yC()},children:[s.jsx("div",{className:Dt.iconWrapper,children:s.jsx(Z,{name:"SignOut"})}),s.jsx("div",{children:"Sign Out"})]})]})};var Te=(t=>(t.New="NEW",t.Pending="PENDING",t.Completed="COMPLETED",t.Cancelled="CANCELLED",t.Expired="EXPIRED",t.FullDeliveryFailure="FULL_DELIVERY_FAILURE",t.PartiallyDelivered="PARTIALLY_DELIVERED",t.Refunded="REFUNDED",t.Failed="FAILED",t))(Te||{}),Ne=(t=>(t.Text="TEXT",t.Serial="SERIALS",t.Ebook="EBOOK",t.Link="LINK",t.Download="DOWNLOAD",t.Discord="DISCORD",t.Custom="CUSTOM",t))(Ne||{}),Hn=(t=>(t.RIAL="RIAL",t.AWAITING_PAYMENT="AWAITING_PAYMENT",t.ACTIVE="ACTIVE",t.PAST_DUE="PAST_DUE",t.CANCELLED="CANCELLED",t.EXPIRED="EXPIRED",t.CHANGED_GATEWAY="CHANGED_GATEWAY",t.REPLACED="REPLACED",t))(Hn||{});const Mr=async t=>(await dd(t)).data,Cd=async()=>{var o;const n=(await G4()).data;if(n.isEnabled){const r=(o=n==null?void 0:n.topUpSettings)==null?void 0:o.gateways;r&&Mr(r)}return n},Ns=async()=>{const n=(await Z4()).data;return{amount:n.realBalance+n.manualBalance,currency:n.currency}};var lr=(t=>(t.ADDED="ADDED",t.REMOVED="REMOVED",t))(lr||{}),Be=(t=>(t.NotPaid="NOT_PAID",t.Pending="PENDING",t.Paid="PAID",t.Expired="EXPIRED",t.Cancelled="CANCELLED",t))(Be||{}),br=(t=>(t.Balance="BALANCE",t.Product="PRODUCT",t))(br||{}),en=(t=>(t.Spend="SPEND_AMOUNT",t.Order="ORDER_COUNT",t.Referral="REFER_FRIEND",t.Review="LEAVE_REVIEW",t))(en||{});const j3=async()=>(await q4()).data;/*! *****************************************************************************
74
74
  Copyright (c) Microsoft Corporation. All rights reserved.
75
75
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
76
76
  this file except in compliance with the License. You may obtain a copy of the
@@ -16888,6 +16888,8 @@ const Yhe = [
16888
16888
  setShopDomain: (t) => e(() => ({ shopDomain: t })),
16889
16889
  shopId: "",
16890
16890
  setShopId: (t) => e(() => ({ shopId: t })),
16891
+ shopLogo: null,
16892
+ setShopLogo: (t) => e(() => ({ shopLogo: t })),
16891
16893
  shopPassword: localStorage.getItem("shopPassword") || "",
16892
16894
  setShopPassword: (t) => e(() => ({ shopPassword: t })),
16893
16895
  shopGeneral: null,
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-BpzsK4Qg.cjs");exports.App=e.App;exports.ColorVariables=e.ColorVariables;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.removeNotification=e.removeNotification;exports.showNotification=e.showNotification;exports.useBuilderPages=e.useBuilderPages;exports.useCreateTicket=e.useCreateTicket;exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.aspectRatioOptions=t.aspectRatioOptions;exports.formatPrice=t.formatPrice;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useCart=t.useCart;exports.useReCaptcha=t.useReCaptcha;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-Cl-PoWyp.cjs");exports.App=e.App;exports.Checkout=e.Checkout;exports.ColorVariables=e.ColorVariables;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.removeNotification=e.removeNotification;exports.showNotification=e.showNotification;exports.useBuilderPages=e.useBuilderPages;exports.useCreateTicket=e.useCreateTicket;exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.aspectRatioOptions=t.aspectRatioOptions;exports.formatPrice=t.formatPrice;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useCart=t.useCart;exports.useReCaptcha=t.useReCaptcha;
package/dist/index.es.js CHANGED
@@ -1,19 +1,20 @@
1
- import { App as s, ColorVariables as t, hotReload as o, iconNames as i, removeNotification as r, showNotification as p, useBuilderPages as c, useCreateTicket as u } from "./builder.es.js";
2
- import { R as l, a as n, f as m, s as C, c as R, b as d, u as h } from "./index-DywuD4hr.js";
1
+ import { App as s, Checkout as t, ColorVariables as o, hotReload as i, iconNames as r, removeNotification as p, showNotification as c, useBuilderPages as u, useCreateTicket as f } from "./builder.es.js";
2
+ import { R as n, a as C, f as h, s as m, c as R, b as d, u as v } from "./index-hNu3o6sr.js";
3
3
  export {
4
4
  s as App,
5
- t as ColorVariables,
6
- l as ReCaptchaProvider,
7
- n as aspectRatioOptions,
8
- m as formatPrice,
9
- o as hotReload,
10
- i as iconNames,
11
- r as removeNotification,
12
- p as showNotification,
13
- C as splitTextIntoSpans,
5
+ t as Checkout,
6
+ o as ColorVariables,
7
+ n as ReCaptchaProvider,
8
+ C as aspectRatioOptions,
9
+ h as formatPrice,
10
+ i as hotReload,
11
+ r as iconNames,
12
+ p as removeNotification,
13
+ c as showNotification,
14
+ m as splitTextIntoSpans,
14
15
  R as useAdaptiveStyles,
15
- c as useBuilderPages,
16
+ u as useBuilderPages,
16
17
  d as useCart,
17
- u as useCreateTicket,
18
- h as useReCaptcha
18
+ f as useCreateTicket,
19
+ v as useReCaptcha
19
20
  };
@@ -1 +1,6 @@
1
- export declare const Checkout: () => import("react/jsx-runtime").JSX.Element;
1
+ import React from 'react';
2
+ interface CheckoutProps {
3
+ isAntistock?: boolean;
4
+ }
5
+ export declare const Checkout: React.FC<CheckoutProps>;
6
+ export {};
@@ -20,6 +20,7 @@ interface CheckoutOperationalProps {
20
20
  setCustomFieldsToCart: (customFields: Record<string, string>) => void;
21
21
  setDiscordSocialConnectId: (id: string) => void;
22
22
  reset: () => void;
23
+ isAntistock: boolean;
23
24
  }
24
25
  export declare const CheckoutOperational: React.FC<CheckoutOperationalProps>;
25
26
  export {};
@@ -13,6 +13,7 @@ interface PaymentMethodsProps {
13
13
  totalWithDiscount: number | undefined;
14
14
  };
15
15
  onSignInClick: () => void;
16
+ isAntistock?: boolean;
16
17
  }
17
18
  export declare const PaymentMethods: React.FC<PaymentMethodsProps>;
18
19
  export {};
@@ -1,9 +1,11 @@
1
1
  import { type ReactNode } from 'react';
2
+ import React from 'react';
2
3
  type CustomerDashboardType = {
3
4
  shopDomain: string;
4
5
  shopId: string;
5
6
  shopPassword?: string;
7
+ shopLogo?: React.ReactElement;
6
8
  children: ReactNode;
7
9
  };
8
- export declare const BillgangProvider: ({ children, shopDomain, shopId, shopPassword, }: CustomerDashboardType) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const BillgangProvider: ({ children, shopDomain, shopId, shopPassword, shopLogo, }: CustomerDashboardType) => import("react/jsx-runtime").JSX.Element;
9
11
  export {};
@@ -16,6 +16,8 @@ interface StorefrontOptions {
16
16
  setShopPrivacyPolicy: (policy: ShopPrivacyPolicy | null) => void;
17
17
  shopRefundPolicy: ShopRefundPolicy | null;
18
18
  setShopRefundPolicy: (policy: ShopRefundPolicy | null) => void;
19
+ shopLogo: React.ReactElement | null;
20
+ setShopLogo: (logo: React.ReactElement | null) => void;
19
21
  }
20
22
  export declare const useStorefrontStore: import("zustand").UseBoundStore<import("zustand").StoreApi<StorefrontOptions>>;
21
23
  export {};