@billgangcom/theme-lib 1.89.0 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.cjs.js +3 -3
- package/dist/builder.es.js +4 -4
- package/dist/{index-DKhpiN96.js → index-CzVYT8u-.js} +9 -9
- package/dist/{index-j68jgVxH.cjs → index-DpI09Eg2.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +2 -2
- package/package.json +1 -1
|
@@ -17715,16 +17715,16 @@ const F7e = D.forwardRef(
|
|
|
17715
17715
|
}
|
|
17716
17716
|
) : null;
|
|
17717
17717
|
}
|
|
17718
|
-
), Hfe = "
|
|
17718
|
+
), Hfe = "_wrapper_ipyfg_1", Vfe = "_label_ipyfg_9", $fe = "_input_ipyfg_18", Ufe = "_disabled_ipyfg_31", Wfe = "_paddingless_ipyfg_36", Zfe = "_content_ipyfg_47", zfe = "_contentBorder_ipyfg_60", qfe = "_contentField_ipyfg_65", Gfe = "_contentIsAntistock_ipyfg_69", Yfe = "_borderless_ipyfg_74", Xfe = "_rightIcon_ipyfg_79", Kfe = "_leftIcon_ipyfg_87", Jfe = "_requiredStar_ipyfg_94", Ut = {
|
|
17719
17719
|
wrapper: Hfe,
|
|
17720
17720
|
label: Vfe,
|
|
17721
17721
|
input: $fe,
|
|
17722
17722
|
disabled: Ufe,
|
|
17723
17723
|
paddingless: Wfe,
|
|
17724
|
-
|
|
17725
|
-
|
|
17726
|
-
|
|
17727
|
-
|
|
17724
|
+
content: Zfe,
|
|
17725
|
+
contentBorder: zfe,
|
|
17726
|
+
contentField: qfe,
|
|
17727
|
+
contentIsAntistock: Gfe,
|
|
17728
17728
|
borderless: Yfe,
|
|
17729
17729
|
rightIcon: Xfe,
|
|
17730
17730
|
leftIcon: Kfe,
|
|
@@ -17779,9 +17779,10 @@ const F7e = D.forwardRef(
|
|
|
17779
17779
|
"div",
|
|
17780
17780
|
{
|
|
17781
17781
|
className: ee(Ut.content, {
|
|
17782
|
-
[Ut.contentBorder]: C.border.active,
|
|
17782
|
+
[Ut.contentBorder]: !R && C.border.active,
|
|
17783
17783
|
[Ut.contentField]: C.field.active,
|
|
17784
|
-
[Ut.disabled]: u
|
|
17784
|
+
[Ut.disabled]: u,
|
|
17785
|
+
[Ut.contentIsAntistock]: R
|
|
17785
17786
|
}),
|
|
17786
17787
|
style: {
|
|
17787
17788
|
...n
|
|
@@ -17807,8 +17808,7 @@ const F7e = D.forwardRef(
|
|
|
17807
17808
|
className: ee(Ut.input, {
|
|
17808
17809
|
[Ut.required]: T && d && !W(o),
|
|
17809
17810
|
[Ut.paddingless]: p,
|
|
17810
|
-
[Ut.borderless]: m
|
|
17811
|
-
[Ut.isAntistock]: R
|
|
17811
|
+
[Ut.borderless]: m
|
|
17812
17812
|
}),
|
|
17813
17813
|
min: a === "number" ? i : void 0,
|
|
17814
17814
|
max: a === "number" ? c : void 0,
|
|
@@ -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
|
-
`},X5={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 K5(t){let{announcements:n=X5,container:o,hiddenTextDescribedById:r,screenReaderInstructions:a=Y5}=t;const{announce:i,announcement:c}=Z5(),l=jr("DndLiveRegion"),[u,d]=y.useState(!1);if(y.useEffect(()=>{d(!0)},[]),G5(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(W5,{id:r,value:a.draggable}),y.createElement(q5,{id:l,announcement:c}));return o?Co.createPortal(h,o):h}var pt;(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"})(pt||(pt={}));function Pa(){}function Ou(t,n){return y.useMemo(()=>({sensor:t,options:n??{}}),[t,n])}function Hu(){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 J5(t,n){let{data:{value:o}}=t,{data:{value:r}}=n;return r-o}function Q5(t,n){if(!t||t.length===0)return null;const[o]=t;return o[n]}function e0(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 t0=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=e0(l,n);u>0&&a.push({id:c,data:{droppableContainer:i,value:u}})}}return a.sort(J5)};function n0(t,n,o){return{...t,scaleX:n&&o?n.width/o.width:1,scaleY:n&&o?n.height/o.height:1}}function Vu(t,n){return t&&n?{x:t.left-n.left,y:t.top-n.top}:gn}function o0(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 r0=o0(1);function a0(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 i0(t,n,o){const r=a0(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 s0={ignoreTransform:!1};function Go(t,n){n===void 0&&(n=s0);let o=t.getBoundingClientRect();if(n.ignoreTransform){const{transform:d,transformOrigin:h}=Yt(t).getComputedStyle(t);d&&(o=i0(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 Yc(t){return Go(t,{ignoreTransform:!0})}function c0(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}function l0(t,n){return n===void 0&&(n=Yt(t).getComputedStyle(t)),n.position==="fixed"}function u0(t,n){n===void 0&&(n=Yt(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 Ns(t,n){const o=[];function r(a){if(n!=null&&o.length>=n||!a)return o;if(Rs(a)&&a.scrollingElement!=null&&!o.includes(a.scrollingElement))return o.push(a.scrollingElement),o;if(!Br(a)||Bu(a)||o.includes(a))return o;const i=Yt(t).getComputedStyle(a);return a!==t&&u0(a,i)&&o.push(a),l0(a,i)?o:r(a.parentNode)}return t?r(t):o}function Uu(t){const[n]=Ns(t,1);return n??null}function Ci(t){return!Ga||!t?null:qo(t)?t:Es(t)?Rs(t)||t===Zo(t).scrollingElement?window:Br(t)?t:null:null}function $u(t){return qo(t)?t.scrollX:t.scrollLeft}function Wu(t){return qo(t)?t.scrollY:t.scrollTop}function Qi(t){return{x:$u(t),y:Wu(t)}}var bt;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(bt||(bt={}));function qu(t){return!Ga||!t?!1:t===document.scrollingElement}function Zu(t){const n={x:0,y:0},o=qu(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 d0={x:.2,y:.2};function h0(t,n,o,r,a){let{top:i,left:c,right:l,bottom:u}=o;r===void 0&&(r=10),a===void 0&&(a=d0);const{isTop:d,isBottom:h,isLeft:f,isRight:m}=Zu(t),g={x:0,y:0},I={x:0,y:0},p={height:n.height*a.y,width:n.width*a.x};return!d&&i<=n.top+p.height?(g.y=bt.Backward,I.y=r*Math.abs((n.top+p.height-i)/p.height)):!h&&u>=n.bottom-p.height&&(g.y=bt.Forward,I.y=r*Math.abs((n.bottom-p.height-u)/p.height)),!m&&l>=n.right-p.width?(g.x=bt.Forward,I.x=r*Math.abs((n.right-p.width-l)/p.width)):!f&&c<=n.left+p.width&&(g.x=bt.Backward,I.x=r*Math.abs((n.left+p.width-c)/p.width)),{direction:g,speed:I}}function f0(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 Gu(t){return t.reduce((n,o)=>jo(n,Qi(o)),gn)}function p0(t){return t.reduce((n,o)=>n+$u(o),0)}function m0(t){return t.reduce((n,o)=>n+Wu(o),0)}function g0(t,n){if(n===void 0&&(n=Go),!t)return;const{top:o,left:r,bottom:a,right:i}=n(t);Uu(t)&&(a<=0||i<=0||o>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const I0=[["x",["left","right"],p0],["y",["top","bottom"],m0]];class Bs{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=Ns(o),a=Gu(r);this.rect={...n},this.width=n.width,this.height=n.height;for(const[i,c,l]of I0)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 Ir{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 C0(t){const{EventTarget:n}=Yt(t);return t instanceof n?t:Zo(t)}function Si(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 sn;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(sn||(sn={}));function Xc(t){t.preventDefault()}function S0(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 zu={start:[Ee.Space,Ee.Enter],cancel:[Ee.Esc],end:[Ee.Space,Ee.Enter,Ee.Tab]},y0=(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 Yu{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 Ir(Zo(o)),this.windowListeners=new Ir(Yt(o)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(sn.Resize,this.handleCancel),this.windowListeners.add(sn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(sn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:o}=this.props,r=n.node.current;r&&g0(r),o(gn)}handleKeyDown(n){if(Ms(n)){const{active:o,context:r,options:a}=this.props,{keyboardCodes:i=zu,coordinateGetter:c=y0,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=Aa(f,h),g={x:0,y:0},{scrollableAncestors:I}=r.current;for(const p of I){const C=n.code,{isTop:b,isRight:S,isLeft:x,isBottom:T,maxScroll:_,minScroll:D}=Zu(p),v=f0(p),L={x:Math.min(C===Ee.Right?v.right-v.width/2:v.right,Math.max(C===Ee.Right?v.left:v.left+v.width/2,f.x)),y:Math.min(C===Ee.Down?v.bottom-v.height/2:v.bottom,Math.max(C===Ee.Down?v.top:v.top+v.height/2,f.y))},N=C===Ee.Right&&!S||C===Ee.Left&&!x,M=C===Ee.Down&&!T||C===Ee.Up&&!b;if(N&&L.x!==f.x){const q=p.scrollLeft+m.x,j=C===Ee.Right&&q<=_.x||C===Ee.Left&&q>=D.x;if(j&&!m.y){p.scrollTo({left:q,behavior:l});return}j?g.x=p.scrollLeft-q:g.x=C===Ee.Right?p.scrollLeft-_.x:p.scrollLeft-D.x,g.x&&p.scrollBy({left:-g.x,behavior:l});break}else if(M&&L.y!==f.y){const q=p.scrollTop+m.y,j=C===Ee.Down&&q<=_.y||C===Ee.Up&&q>=D.y;if(j&&!m.x){p.scrollTo({top:q,behavior:l});return}j?g.y=p.scrollTop-q:g.y=C===Ee.Down?p.scrollTop-_.y:p.scrollTop-D.y,g.y&&p.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(n,jo(Aa(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()}}Yu.activators=[{eventName:"onKeyDown",handler:(t,n,o)=>{let{keyboardCodes:r=zu,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 Kc(t){return!!(t&&"distance"in t)}function Jc(t){return!!(t&&"delay"in t)}class Fs{constructor(n,o,r){var a;r===void 0&&(r=C0(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=Zo(c),this.documentListeners=new Ir(this.document),this.listeners=new Ir(r),this.windowListeners=new Ir(Yt(c)),this.initialCoordinates=(a=Ji(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(sn.Resize,this.handleCancel),this.windowListeners.add(sn.DragStart,Xc),this.windowListeners.add(sn.VisibilityChange,this.handleCancel),this.windowListeners.add(sn.ContextMenu,Xc),this.documentListeners.add(sn.Keydown,this.handleKeydown),o){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Jc(o)){this.timeoutId=setTimeout(this.handleStart,o.delay),this.handlePending(o);return}if(Kc(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(sn.Click,S0,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(sn.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=Ji(n))!=null?o:gn,d=Aa(a,u);if(!r&&l){if(Kc(l)){if(l.tolerance!=null&&Si(d,l.tolerance))return this.handleCancel();if(Si(d,l.distance))return this.handleStart()}if(Jc(l)&&Si(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 v0={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class za extends Fs{constructor(n){const{event:o}=n,r=Zo(o.target);super(n,v0,r)}}za.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 b0={move:{name:"mousemove"},end:{name:"mouseup"}};var es;(function(t){t[t.RightClick=2]="RightClick"})(es||(es={}));class w0 extends Fs{constructor(n){super(n,b0,Zo(n.event.target))}}w0.activators=[{eventName:"onMouseDown",handler:(t,n)=>{let{nativeEvent:o}=t,{onActivation:r}=n;return o.button===es.RightClick?!1:(r==null||r({event:o}),!0)}}];const yi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class x0 extends Fs{constructor(n){super(n,yi)}static setup(){return window.addEventListener(yi.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(yi.move.name,n)};function n(){}}}x0.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 Cr;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Cr||(Cr={}));var Ea;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ea||(Ea={}));function _0(t){let{acceleration:n,activator:o=Cr.Pointer,canScroll:r,draggingRect:a,enabled:i,interval:c=5,order:l=Ea.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:f,threshold:m}=t;const g=k0({delta:f,disabled:!i}),[I,p]=O5(),C=y.useRef({x:0,y:0}),b=y.useRef({x:0,y:0}),S=y.useMemo(()=>{switch(o){case Cr.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Cr.DraggableRect:return a}},[o,a,u]),x=y.useRef(null),T=y.useCallback(()=>{const D=x.current;if(!D)return;const v=C.current.x*b.current.x,L=C.current.y*b.current.y;D.scrollBy(v,L)},[]),_=y.useMemo(()=>l===Ea.TreeOrder?[...d].reverse():d,[l,d]);y.useEffect(()=>{if(!i||!d.length||!S){p();return}for(const D of _){if((r==null?void 0:r(D))===!1)continue;const v=d.indexOf(D),L=h[v];if(!L)continue;const{direction:N,speed:M}=h0(D,L,S,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,I(T,c),C.current=M,b.current=N;return}}C.current={x:0,y:0},b.current={x:0,y:0},p()},[n,T,r,p,i,c,JSON.stringify(S),JSON.stringify(g),I,d,_,h,JSON.stringify(m)])}const T0={x:{[bt.Backward]:!1,[bt.Forward]:!1},y:{[bt.Backward]:!1,[bt.Forward]:!1}};function k0(t){let{delta:n,disabled:o}=t;const r=Ki(n);return Fr(a=>{if(o||!r||!a)return T0;const i={x:Math.sign(n.x-r.x),y:Math.sign(n.y-r.y)};return{x:{[bt.Backward]:a.x[bt.Backward]||i.x===-1,[bt.Forward]:a.x[bt.Forward]||i.x===1},y:{[bt.Backward]:a.y[bt.Backward]||i.y===-1,[bt.Forward]:a.y[bt.Forward]||i.y===1}}},[o,n,r])}function L0(t,n){const o=n!=null?t.get(n):void 0,r=o?o.node.current:null;return Fr(a=>{var i;return n==null?null:(i=r??a)!=null?i:null},[r,n])}function A0(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 kr;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(kr||(kr={}));var ts;(function(t){t.Optimized="optimized"})(ts||(ts={}));const Qc=new Map;function P0(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=C(),m=Tr(f),g=y.useCallback(function(b){b===void 0&&(b=[]),!m.current&&c(S=>S===null?b:S.concat(b.filter(x=>!S.includes(x))))},[m]),I=y.useRef(null),p=Fr(b=>{if(f&&!o)return Qc;if(!b||b===Qc||h.current!==t||i!=null){const S=new Map;for(let x of t){if(!x)continue;if(i&&i.length>0&&!i.includes(x.id)&&x.rect.current){S.set(x.id,x.rect.current);continue}const T=x.node.current,_=T?new Bs(u(T),T):null;x.rect.current=_,_&&S.set(x.id,_)}return S}return b},[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"||I.current!==null||(I.current=setTimeout(()=>{g(),I.current=null},l))},[l,f,g,...r]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:i!=null};function C(){switch(d){case kr.Always:return!1;case kr.BeforeDragging:return o;default:return!o}}}function Xu(t,n){return Fr(o=>t?o||(typeof n=="function"?n(t):t):null,[n,t])}function E0(t,n){return Xu(t,n)}function R0(t){let{callback:n,disabled:o}=t;const r=Ds(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 Ya(t){let{callback:n,disabled:o}=t;const r=Ds(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 D0(t){return new Bs(Go(t),t)}function el(t,n,o){n===void 0&&(n=D0);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=R0({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=Ya({callback:i});return Rn(()=>{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 M0(t){const n=Xu(t);return Vu(t,n)}const tl=[];function N0(t){const n=y.useRef(t),o=Fr(r=>t?r&&r!==tl&&t&&n.current&&t.parentNode===n.current.parentNode?r:Ns(t):tl,[t]);return y.useEffect(()=>{n.current=t},[t]),o}function B0(t){const[n,o]=y.useState(null),r=y.useRef(t),a=y.useCallback(i=>{const c=Ci(i.target);c&&o(l=>l?(l.set(c,Qi(c)),new Map(l)):null)},[]);return y.useEffect(()=>{const i=r.current;if(t!==i){c(i);const l=t.map(u=>{const d=Ci(u);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,Qi(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=Ci(u);d==null||d.removeEventListener("scroll",a)})}},[a,t]),y.useMemo(()=>t.length?n?Array.from(n.values()).reduce((i,c)=>jo(i,c),gn):Gu(t):gn,[t,n])}function nl(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?Aa(t,o.current):gn}function F0(t){y.useEffect(()=>{if(!Ga)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 j0(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 Ku(t){return y.useMemo(()=>t?c0(t):null,[t])}const ol=[];function O0(t,n){n===void 0&&(n=Go);const[o]=t,r=Ku(o?Yt(o):null),[a,i]=y.useState(ol);function c(){i(()=>t.length?t.map(u=>qu(u)?r:new Bs(n(u),u)):ol)}const l=Ya({callback:c});return Rn(()=>{l==null||l.disconnect(),c(),t.forEach(u=>l==null?void 0:l.observe(u))},[t]),a}function H0(t){if(!t)return null;if(t.children.length>1)return t;const n=t.children[0];return Br(n)?n:t}function V0(t){let{measure:n}=t;const[o,r]=y.useState(null),a=y.useCallback(d=>{for(const{target:h}of d)if(Br(h)){r(f=>{const m=n(h);return f?{...f,width:m.width,height:m.height}:m});break}},[n]),i=Ya({callback:a}),c=y.useCallback(d=>{const h=H0(d);i==null||i.disconnect(),h&&(i==null||i.observe(h)),r(h?n(h):null)},[n,i]),[l,u]=La(c);return y.useMemo(()=>({nodeRef:l,rect:o,setRef:u}),[o,l,u])}const U0=[{sensor:za,options:{}},{sensor:Yu,options:{}}],$0={current:{}},ga={draggable:{measure:Yc},droppable:{measure:Yc,strategy:kr.WhileDragging,frequency:ts.Optimized},dragOverlay:{measure:Go}};class Sr 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 W0={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Sr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Pa},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ga,measureDroppableContainers:Pa,windowRect:null,measuringScheduled:!1},q0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Pa,draggableNodes:new Map,over:null,measureDroppableContainers:Pa},Xa=y.createContext(q0),Ju=y.createContext(W0);function Z0(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Sr}}}function G0(t,n){switch(n.type){case pt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case pt.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 pt.DragEnd:case pt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case pt.RegisterDroppable:{const{element:o}=n,{id:r}=o,a=new Sr(t.droppable.containers);return a.set(r,o),{...t,droppable:{...t.droppable,containers:a}}}case pt.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 Sr(t.droppable.containers);return c.set(o,{...i,disabled:a}),{...t,droppable:{...t.droppable,containers:c}}}case pt.UnregisterDroppable:{const{id:o,key:r}=n,a=t.droppable.containers.get(o);if(!a||r!==a.key)return t;const i=new Sr(t.droppable.containers);return i.delete(o),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function z0(t){let{disabled:n}=t;const{active:o,activatorEvent:r,draggableNodes:a}=y.useContext(Xa),i=Ki(r),c=Ki(o==null?void 0:o.id);return y.useEffect(()=>{if(!n&&!r&&i&&c!=null){if(!Ms(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=U5(h);if(f){f.focus();break}}})}},[r,n,a,c,i]),null}function Y0(t,n){let{transform:o,...r}=n;return t!=null&&t.length?t.reduce((a,i)=>i({transform:a,...r}),o):o}function X0(t){return y.useMemo(()=>({draggable:{...ga.draggable,...t==null?void 0:t.draggable},droppable:{...ga.droppable,...t==null?void 0:t.droppable},dragOverlay:{...ga.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 K0(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;Rn(()=>{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=Vu(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=Uu(d);m&&m.scrollBy({top:f.y,left:f.x})}},[n,c,l,r,o])}const Qu=y.createContext({...gn,scaleX:1,scaleY:1});var Qn;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Qn||(Qn={}));const ed=y.memo(function(n){var o,r,a,i;let{id:c,accessibility:l,autoScroll:u=!0,children:d,sensors:h=U0,collisionDetection:f=t0,measuring:m,modifiers:g,...I}=n;const p=y.useReducer(G0,void 0,Z0),[C,b]=p,[S,x]=z5(),[T,_]=y.useState(Qn.Uninitialized),D=T===Qn.Initialized,{draggable:{active:v,nodes:L,translate:N},droppable:{containers:M}}=C,q=v!=null?L.get(v):null,j=y.useRef({initial:null,translated:null}),Z=y.useMemo(()=>{var Ue;return v!=null?{id:v,data:(Ue=q==null?void 0:q.data)!=null?Ue:$0,rect:j}:null},[v,q]),H=y.useRef(null),[ce,he]=y.useState(null),[me,Ce]=y.useState(null),ye=Tr(I,Object.values(I)),$=jr("DndDescribedBy",c),Y=y.useMemo(()=>M.getEnabled(),[M]),ne=X0(m),{droppableRects:oe,measureDroppableContainers:O,measuringScheduled:X}=P0(Y,{dragging:D,dependencies:[N.x,N.y],config:ne.droppable}),K=L0(L,v),ie=y.useMemo(()=>me?Ji(me):null,[me]),ue=jn(),z=E0(K,ne.draggable.measure);K0({activeNode:v!=null?L.get(v):null,config:ue.layoutShiftCompensation,initialRect:z,measure:ne.draggable.measure});const J=el(K,ne.draggable.measure,z),ke=el(K?K.parentElement:null),V=y.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:oe,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=M.getNodeFor((o=V.current.over)==null?void 0:o.id),le=V0({measure:ne.dragOverlay.measure}),de=(r=le.nodeRef.current)!=null?r:K,Le=D?(a=le.rect)!=null?a:J:null,nt=!!(le.nodeRef.current&&le.rect),ot=M0(nt?null:J),Ae=Ku(de?Yt(de):null),Oe=N0(D?xe??K:null),Xt=O0(Oe),qe=Y0(g,{transform:{x:N.x-ot.x,y:N.y-ot.y,scaleX:1,scaleY:1},activatorEvent:me,active:Z,activeNodeRect:J,containerNodeRect:ke,draggingNodeRect:Le,over:V.current.over,overlayNodeRect:le.rect,scrollableAncestors:Oe,scrollableAncestorRects:Xt,windowRect:Ae}),Vt=ie?jo(ie,N):null,Ze=B0(Oe),dt=nl(Ze),Pt=nl(Ze,[J]),Ke=jo(qe,dt),rt=Le?r0(Le,qe):null,Je=Z&&rt?f({active:Z,collisionRect:rt,droppableRects:oe,droppableContainers:Y,pointerCoordinates:Vt}):null,yn=Q5(Je,"id"),[wt,Xn]=y.useState(null),at=nt?qe:jo(qe,Pt),vn=n0(at,(i=wt==null?void 0:wt.rect)!=null?i:null,J),bn=y.useRef(null),co=y.useCallback((Ue,gt)=>{let{sensor:It,options:Kt}=gt;if(H.current==null)return;const xt=L.get(H.current);if(!xt)return;const Qe=Ue.nativeEvent,Ct=new It({active:H.current,activeNode:xt,event:Qe,options:Kt,context:V,onAbort(et){if(!L.get(et))return;const{onDragAbort:A}=ye.current,R={id:et};A==null||A(R),S({type:"onDragAbort",event:R})},onPending(et,k,A,R){if(!L.get(et))return;const{onDragPending:ee}=ye.current,se={id:et,constraint:k,initialCoordinates:A,offset:R};ee==null||ee(se),S({type:"onDragPending",event:se})},onStart(et){const k=H.current;if(k==null)return;const A=L.get(k);if(!A)return;const{onDragStart:R}=ye.current,W={activatorEvent:Qe,active:{id:k,data:A.data,rect:j}};Co.unstable_batchedUpdates(()=>{R==null||R(W),_(Qn.Initializing),b({type:pt.DragStart,initialCoordinates:et,active:k}),S({type:"onDragStart",event:W}),he(bn.current),Ce(Qe)})},onMove(et){b({type:pt.DragMove,coordinates:et})},onEnd:wn(pt.DragEnd),onCancel:wn(pt.DragCancel)});bn.current=Ct;function wn(et){return async function(){const{active:A,collisions:R,over:W,scrollAdjustedTranslate:ee}=V.current;let se=null;if(A&&ee){const{cancelDrop:w}=ye.current;se={activatorEvent:Qe,active:A,collisions:R,delta:ee,over:W},et===pt.DragEnd&&typeof w=="function"&&await Promise.resolve(w(se))&&(et=pt.DragCancel)}H.current=null,Co.unstable_batchedUpdates(()=>{b({type:et}),_(Qn.Uninitialized),Xn(null),he(null),Ce(null),bn.current=null;const w=et===pt.DragEnd?"onDragEnd":"onDragCancel";if(se){const P=ye.current[w];P==null||P(se),S({type:w,event:se})}})}}},[L]),Xo=y.useCallback((Ue,gt)=>(It,Kt)=>{const xt=It.nativeEvent,Qe=L.get(Kt);if(H.current!==null||!Qe||xt.dndKit||xt.defaultPrevented)return;const Ct={active:Qe};Ue(It,gt.options,Ct)===!0&&(xt.dndKit={capturedBy:gt.sensor},H.current=Kt,co(It,gt))},[L,co]),Bn=A0(h,Xo);F0(h),Rn(()=>{J&&T===Qn.Initializing&&_(Qn.Initialized)},[J,T]),y.useEffect(()=>{const{onDragMove:Ue}=ye.current,{active:gt,activatorEvent:It,collisions:Kt,over:xt}=V.current;if(!gt||!It)return;const Qe={active:gt,activatorEvent:It,collisions:Kt,delta:{x:Ke.x,y:Ke.y},over:xt};Co.unstable_batchedUpdates(()=>{Ue==null||Ue(Qe),S({type:"onDragMove",event:Qe})})},[Ke.x,Ke.y]),y.useEffect(()=>{const{active:Ue,activatorEvent:gt,collisions:It,droppableContainers:Kt,scrollAdjustedTranslate:xt}=V.current;if(!Ue||H.current==null||!gt||!xt)return;const{onDragOver:Qe}=ye.current,Ct=Kt.get(yn),wn=Ct&&Ct.rect.current?{id:Ct.id,rect:Ct.rect.current,data:Ct.data,disabled:Ct.disabled}:null,et={active:Ue,activatorEvent:gt,collisions:It,delta:{x:xt.x,y:xt.y},over:wn};Co.unstable_batchedUpdates(()=>{Xn(wn),Qe==null||Qe(et),S({type:"onDragOver",event:et})})},[yn]),Rn(()=>{V.current={activatorEvent:me,active:Z,activeNode:K,collisionRect:rt,collisions:Je,droppableRects:oe,draggableNodes:L,draggingNode:de,draggingNodeRect:Le,droppableContainers:M,over:wt,scrollableAncestors:Oe,scrollAdjustedTranslate:Ke},j.current={initial:Le,translated:rt}},[Z,K,Je,rt,L,de,Le,oe,M,wt,Oe,Ke]),_0({...ue,delta:N,draggingRect:rt,pointerCoordinates:Vt,scrollableAncestors:Oe,scrollableAncestorRects:Xt});const Fn=y.useMemo(()=>({active:Z,activeNode:K,activeNodeRect:J,activatorEvent:me,collisions:Je,containerNodeRect:ke,dragOverlay:le,draggableNodes:L,droppableContainers:M,droppableRects:oe,over:wt,measureDroppableContainers:O,scrollableAncestors:Oe,scrollableAncestorRects:Xt,measuringConfiguration:ne,measuringScheduled:X,windowRect:Ae}),[Z,K,J,me,Je,ke,le,L,M,oe,wt,O,Oe,Xt,ne,X,Ae]),hn=y.useMemo(()=>({activatorEvent:me,activators:Bn,active:Z,activeNodeRect:J,ariaDescribedById:{draggable:$},dispatch:b,draggableNodes:L,over:wt,measureDroppableContainers:O}),[me,Bn,Z,J,b,$,L,wt,O]);return y.createElement(ju.Provider,{value:x},y.createElement(Xa.Provider,{value:hn},y.createElement(Ju.Provider,{value:Fn},y.createElement(Qu.Provider,{value:vn},d)),y.createElement(z0,{disabled:(l==null?void 0:l.restoreFocus)===!1})),y.createElement(K5,{...l,hiddenTextDescribedById:$}));function jn(){const Ue=(ce==null?void 0:ce.autoScrollEnabled)===!1,gt=typeof u=="object"?u.enabled===!1:u===!1,It=D&&!Ue&&!gt;return typeof u=="object"?{...u,enabled:It}:{enabled:It}}}),J0=y.createContext(null),rl="button",Q0="Draggable";function eI(t){let{id:n,data:o,disabled:r=!1,attributes:a}=t;const i=jr(Q0),{activators:c,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:f,over:m}=y.useContext(Xa),{role:g=rl,roleDescription:I="draggable",tabIndex:p=0}=a??{},C=(u==null?void 0:u.id)===n,b=y.useContext(C?Qu:J0),[S,x]=La(),[T,_]=La(),D=j0(c,n),v=Tr(o);Rn(()=>(f.set(n,{id:n,key:i,node:S,activatorNode:T,data:v}),()=>{const N=f.get(n);N&&N.key===i&&f.delete(n)}),[f,n]);const L=y.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":r,"aria-pressed":C&&g===rl?!0:void 0,"aria-roledescription":I,"aria-describedby":h.draggable}),[r,g,p,C,I,h.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:L,isDragging:C,listeners:r?void 0:D,node:S,over:m,setNodeRef:x,setActivatorNodeRef:_,transform:b}}function tI(){return y.useContext(Ju)}const nI="Droppable",oI={timeout:25};function rI(t){let{data:n,disabled:o=!1,id:r,resizeObserverConfig:a}=t;const i=jr(nI),{active:c,dispatch:l,over:u,measureDroppableContainers:d}=y.useContext(Xa),h=y.useRef({disabled:o}),f=y.useRef(!1),m=y.useRef(null),g=y.useRef(null),{disabled:I,updateMeasurementsFor:p,timeout:C}={...oI,...a},b=Tr(p??r),S=y.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(b.current)?b.current:[b.current]),g.current=null},C)},[C]),x=Ya({callback:S,disabled:I||!c}),T=y.useCallback((L,N)=>{x&&(N&&(x.unobserve(N),f.current=!1),L&&x.observe(L))},[x]),[_,D]=La(T),v=Tr(n);return y.useEffect(()=>{!x||!_.current||(x.disconnect(),f.current=!1,x.observe(_.current))},[_,x]),y.useEffect(()=>(l({type:pt.RegisterDroppable,element:{id:r,key:i,disabled:o,node:_,rect:m,data:v}}),()=>l({type:pt.UnregisterDroppable,key:i,id:r})),[r]),y.useEffect(()=>{o!==h.current.disabled&&(l({type:pt.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 td(t,n,o){const r=t.slice();return r.splice(o<0?r.length+o:o,0,r.splice(n,1)[0]),r}function aI(t,n){return t.reduce((o,r,a)=>{const i=n.get(r);return i&&(o[a]=i),o},Array(t.length))}function Kr(t){return t!==null&&t>=0}function iI(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 sI(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const nd=t=>{let{rects:n,activeIndex:o,overIndex:r,index:a}=t;const i=td(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}},Jr={scaleX:1,scaleY:1},od=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,...Jr}:null}const u=cI(i,a,o);return a>o&&a<=c?{x:0,y:-l.height-u,...Jr}:a<o&&a>=c?{x:0,y:l.height+u,...Jr}:{x:0,y:0,...Jr}};function cI(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 rd="Sortable",ad=y.createContext({activeIndex:-1,containerId:rd,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:nd,disabled:{draggable:!1,droppable:!1}});function id(t){let{children:n,id:o,items:r,strategy:a=nd,disabled:i=!1}=t;const{active:c,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:h}=tI(),f=jr(rd,o),m=l.rect!==null,g=y.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),I=c!=null,p=c?g.indexOf(c.id):-1,C=d?g.indexOf(d.id):-1,b=y.useRef(g),S=!iI(g,b.current),x=C!==-1&&p===-1||S,T=sI(i);Rn(()=>{S&&I&&h(g)},[S,g,I,h]),y.useEffect(()=>{b.current=g},[g]);const _=y.useMemo(()=>({activeIndex:p,containerId:f,disabled:T,disableTransforms:x,items:g,overIndex:C,useDragOverlay:m,sortedRects:aI(g,u),strategy:a}),[p,f,T.draggable,T.droppable,x,g,C,u,m,a]);return y.createElement(ad.Provider,{value:_},n)}const lI=t=>{let{id:n,items:o,activeIndex:r,overIndex:a}=t;return td(o,r,a).indexOf(n)},uI=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},dI={duration:200,easing:"ease"},sd="transform",hI=Ho.Transition.toString({property:sd,duration:0,easing:"linear"}),fI={roleDescription:"sortable"};function pI(t){let{disabled:n,index:o,node:r,rect:a}=t;const[i,c]=y.useState(null),l=y.useRef(o);return Rn(()=>{if(!n&&o!==l.current&&r.current){const u=a.current;if(u){const d=Go(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 cd(t){let{animateLayoutChanges:n=uI,attributes:o,disabled:r,data:a,getNewIndex:i=lI,id:c,strategy:l,resizeObserverConfig:u,transition:d=dI}=t;const{items:h,containerId:f,activeIndex:m,disabled:g,disableTransforms:I,sortedRects:p,overIndex:C,useDragOverlay:b,strategy:S}=y.useContext(ad),x=mI(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:L,isOver:N,setNodeRef:M}=rI({id:c,data:_,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...u}}),{active:q,activatorEvent:j,activeNodeRect:Z,attributes:H,setNodeRef:ce,listeners:he,isDragging:me,over:Ce,setActivatorNodeRef:ye,transform:$}=eI({id:c,data:_,attributes:{...fI,...o},disabled:x.draggable}),Y=j5(M,ce),ne=!!q,oe=ne&&!I&&Kr(m)&&Kr(C),O=!b&&me,X=O&&oe?$:null,ie=oe?X??(l??S)({rects:p,activeNodeRect:Z,activeIndex:m,overIndex:C,index:T}):null,ue=Kr(m)&&Kr(C)?i({id:c,items:h,activeIndex:m,overIndex:C}):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=pI({disabled:!V,index:T,node:L,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:L,overIndex:C,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 hI;if(!(O&&!Ms(j)||!d)&&(ne||V))return Ho.Transition.toString({...d,property:sd})}}function mI(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 gI({product:t,children:n}){const{attributes:o,listeners:r,setNodeRef:a,transform:i,transition:c,isDragging:l}=cd({id:t.id}),u={transform:Ho.Transform.toString(i),transition:c};return s.jsx("div",{ref:a,style:u,className:`${tt.product} ${l?tt.dragging:""}`,...o,...r,children:n})}const ld=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:I="",itemsOptions:p,hasRangeSelector:C=!1,rangeSelectorOptions:b,modalOptions:S,addableOptions:x={},limit:T,autoInterval:_,tip:D,aspectRatio:v,setAspectRatio:L}=t,[N,M]=y.useState(null),[q,j]=y.useState({top:0,left:0}),[Z,H]=y.useState(null),ce=y.useRef(null),[he,me]=y.useState(!1),Ce=Hu(Ou(za,{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&&Z){const O=ce.current.getBoundingClientRect().height,X=window.innerHeight;let K=Z.top;K+O>X+window.scrollY-200&&(K=X+window.scrollY-O-200),K<0&&(K=10),j({top:K-30,left:Z.left})}},[ce.current,Z]);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(G,{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(G,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&p&&s.jsx(ro,{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(ws,{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(ln,{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:I}),g==="image"&&s.jsx(Nr,{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:tt.buttons,children:[T&&T>r.length&&m&&s.jsx("div",{className:tt.deleteButton,children:s.jsx(G,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{$(O,X)}})}),u&&s.jsx("div",{className:tt.deleteButton,children:s.jsx(G,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:z=>{ye(z,O)}})}),f&&s.jsx("div",{className:tt.deleteButton,children:s.jsx(G,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>a(r.filter(z=>z.id!==O.id))})})]})]});return d?s.jsx(gI,{product:O,index:X,children:K},O.id):s.jsx("div",{className:tt.product,children:K},O.id)};return s.jsxs("div",{className:tt.productsBlock,children:[(c||n!==void 0)&&s.jsxs("div",{className:tt.top,children:[c&&s.jsx("h3",{className:tt.title,children:c}),n!==void 0&&s.jsx(Nn,{current:n,onChange:O=>o==null?void 0:o(O)})]}),N&&u&&S&&he&&s.jsx(M5,{ref:ce,activeItem:N,setActiveItem:M,popupPosition:q,modalOptions:S,setIsOpenModal:me}),(n===void 0||n)&&C&&b&&s.jsx(ud,{...b}),(n===void 0||n)&&s.jsxs("div",{className:tt.products,children:[l&&s.jsx("h5",{className:tt.subtitle,children:l}),d?s.jsx(ed,{sensors:Ce,onDragEnd:ne,children:s.jsx(id,{items:r.map(O=>O.id),strategy:od,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(Oo,{withoutHover:!0,className:te(tt.button,{[tt.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:ze(),...x}):O.push({name:{"en-US":`Image ${r.length+1}`},id:ze(),...x}),a(O)},style:{width:"fit-content"},children:s.jsxs("div",{className:tt.addButton,children:[s.jsx("span",{children:"Add Option"}),s.jsx(G,{name:"Plus",width:16,height:16})]})})})]}),v&&L&&s.jsx(ro,{value:v,label:"Aspect Ratio",options:Object.keys(Zl),onChange:O=>L(O),leftAddonOptions:Gl}),(n===void 0||n)&&i!==void 0&&s.jsx(Nu,{otherTitle:"Other",items:i}),(n===void 0||n)&&_!==void 0&&s.jsx(ln,{label:_.title||"Auto scroll interval",type:"number",value:String(_.autoInterval),onChange:O=>_.setAutoInterval(Number(O)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},II="_title_cx65i_1",CI="_subtitle_cx65i_5",SI="_productsBlock_cx65i_14",yI="_top_cx65i_26",vI="_products_cx65i_14",bI="_product_cx65i_14",wI="_button_cx65i_80",xI="_disabled_cx65i_91",_I="_buttons_cx65i_118",TI="_modal_cx65i_125",kI="_link_cx65i_146",LI="_modalOptions_cx65i_152",AI="_addButton_cx65i_165",PI="_deleteButton_cx65i_180",EI="_closeIcon_cx65i_192",po={title:II,subtitle:CI,productsBlock:SI,top:yI,products:vI,product:bI,button:wI,disabled:xI,buttons:_I,modal:TI,link:kI,modalOptions:LI,addButton:AI,deleteButton:PI,closeIcon:EI},RI=y.forwardRef((t,n)=>{const{activeItem:o,setActiveItem:r,popupPosition:a,modalOptions:i,setIsOpenModal:c}=t;return Uo(n,()=>{r(null),c(!1)}),s.jsxs("div",{ref:n,className:po.modal,onClick:l=>{l.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[s.jsxs("div",{className:po.top,children:[s.jsx("h3",{className:po.title,children:o.name["en-US"]}),s.jsx("div",{className:po.closeIcon,children:s.jsx(G,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{r(null),c(!1)}})})]}),s.jsx("div",{className:po.modalOptions,children:i.map(l=>{if(l.type==="image")return s.jsx(Nr,{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(Ps,{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(ln,{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(ln,{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:po.link,children:[s.jsx(ln,{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(Nn,{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(ro,{options:l.itemsOptions,onChange:u=>{const d={...o,[l.field]:u};r(d)},label:l.label,value:o[l.field]||"String",leftAddonOptions:l.leftAddonOptions})})})]})}),DI="_title_hvj8m_1",MI="_buttonsBlock_hvj8m_15",NI="_top_hvj8m_26",BI="_modal_hvj8m_120",FI="_options_hvj8m_146",jI="_closeIcon_hvj8m_154",Bo={title:DI,buttonsBlock:MI,top:NI,modal:BI,options:FI,closeIcon:jI},OI=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||""),[I,p]=y.useState(o.text||{"en-US":""}),[C,b]=y.useState(o.openInNewTab),{pages:S}=Gn();return Uo(n,()=>{r(null)}),y.useEffect(()=>{r({...o,...{text:I,link:m,destination:u,typesText:c,page:h,openInNewTab:C}})},[c,u,m,I,h,C]),s.jsxs("div",{className:Bo.modal,onClick:T=>{T.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},ref:n,children:[s.jsxs("div",{className:Bo.top,children:[s.jsx("h3",{className:Bo.title,children:o.type}),s.jsx("div",{className:Bo.closeIcon,children:s.jsx(G,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>r(null)})})]}),s.jsxs("div",{className:Bo.options,children:[i&&s.jsx(ro,{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(ro,{label:"Go to",onChange:T=>{if(T==="Sign In")f("/customer-dash");else if(S){for(const _ in S)if(S[_].name===T){f(S[_].path);break}}else f(ql[0])},options:S?[...Object.values(S).filter(T=>T.path!==h).map(T=>T.name),"Sign In"]:["Sign In"],value:S?h==="/customer-dash"?"Sign In":((x=Object.values(S).find(T=>T.path===h))==null?void 0:x.name)||"Home":"Home"}):s.jsx(ln,{onChange:T=>g(T),value:m,placeholder:"https://",label:"Link"})),i&&s.jsx(Nn,{current:o.openInNewTab,label:"Open in new tab",onChange:T=>b(T)}),s.jsx(Ls,{onChange:T=>p({"en-US":T}),value:I["en-US"],label:"Text"}),s.jsx(ks,{typesText:c,setTypesText:l})]})]})}),HI="_wrapper_m18qi_1",VI="_subtitle_m18qi_7",UI="_content_m18qi_14",$I="_range_m18qi_22",WI="_track_m18qi_27",qI="_progress_m18qi_36",ZI="_dots_m18qi_46",GI="_dot_m18qi_46",zI="_active_m18qi_65",YI="_input_m18qi_77",XI="_countBlock_m18qi_91",KI="_controls_m18qi_107",JI="_button_m18qi_113",Et={wrapper:HI,subtitle:VI,content:UI,range:$I,track:WI,progress:qI,dots:ZI,dot:GI,active:zI,input:YI,countBlock:XI,controls:KI,button:JI},ud=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=I=>{const p=o+I*a;c(p)};return s.jsxs("div",{className:Et.wrapper,children:[n&&s.jsx("h5",{className:Et.subtitle,children:n}),s.jsxs("div",{className:Et.content,children:[s.jsxs("div",{className:Et.range,children:[s.jsx("div",{className:Et.track}),s.jsx("div",{className:Et.progress,style:{width:`${h}%`}}),s.jsx("div",{className:Et.dots,children:d.map((I,p)=>{const C=p<=(i-o)/a;return s.jsx("button",{onClick:()=>g(p),className:te(Et.dot,{[Et.active]:C,[Et.inactive]:!C,[Et.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:I=>c(Number(I.target.value)),onMouseDown:()=>u(!0),onMouseUp:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1),className:Et.input})]}),s.jsxs("div",{className:Et.countBlock,children:[s.jsx(ln,{type:"number",min:o,max:r,paddingless:!0,onChange:I=>{const p=Number(I);p>r?c(r):p<o?c(o):c(p)},value:String(i)}),s.jsxs("div",{className:Et.controls,children:[s.jsx("button",{onClick:f,disabled:i>=r,className:Et.button,"aria-label":"Increment count",children:s.jsx(G,{name:"CaretUp",width:15,height:15})}),s.jsx("button",{onClick:m,disabled:i<=o,className:Et.button,"aria-label":"Decrement count",children:s.jsx(G,{name:"CaretDown",width:15,height:15})})]})]})]})]})},QI="_title_11jyy_1",e4="_subtitle_11jyy_5",t4="_productsBlock_11jyy_14",n4="_top_11jyy_26",o4="_products_11jyy_14",r4="_product_11jyy_14",a4="_button_11jyy_80",i4="_buttons_11jyy_114",s4="_modal_11jyy_121",c4="_modalOptions_11jyy_148",l4="_addButton_11jyy_161",u4="_deleteButton_11jyy_176",d4="_closeIcon_11jyy_188",fr={title:QI,subtitle:e4,productsBlock:t4,top:n4,products:o4,product:r4,button:a4,buttons:i4,modal:s4,modalOptions:c4,addButton:l4,deleteButton:u4,closeIcon:d4},dd=({render:t,block:n})=>t(n),hd=({settings:t,pageContext:n})=>{const{footer:o}=Wn(),{settings:r}=Er(),{pageContext:a}=Gn(),{footer:i}=wo();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)},fd=({settings:t,pageContext:n})=>{const{header:o}=Wn(),{settings:r}=Er(),{pageContext:a}=Gn(),{header:i}=wo();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)},pd=({settings:t,pageContext:n})=>{const{announcement:o}=Wn(),{settings:r}=Er(),{pageContext:a}=Gn(),{announcement:i}=wo();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)},h4=async t=>{var c,l;const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,r=Mn.getState(),a=localStorage.getItem("shopPassword");if((c=r.general)!=null&&c.info.passwordProtected&&!a)return null;const i=`${n.storeApi}/v2/shops/${o}/pages/${t}`+((l=r.general)!=null&&l.info.passwordProtected?`?password=${a}`:"");try{return await je({url:i,withToken:!0,method:"get"})}catch(u){if(He.isAxiosError(u)&&u.response&&u.response.status===404)return null}},f4="_wrapper_5w9s8_1",p4={wrapper:f4},ns=t=>{const{error:n}=t;return s.jsx("div",{className:p4.wrapper,children:n})},m4=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.slApi}/v1/balance/top-up/${o}`;return await je({url:r,method:"post",body:t,withToken:!1})},zo=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.customersApi}/v2/${o}/customers/${t}`;return await je({url:r,withToken:!0,method:"get",typeToken:"customer"})},g4=()=>zo("dash/info"),I4=()=>zo("dash/dashboard/home"),C4=()=>zo("rewards"),S4=()=>zo("balance"),y4=()=>zo("balance/top-up/settings"),v4=()=>zo("referral-system"),os=10,Ka=async({url:t,PageNumber:n})=>{var l;const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.customersApi}/v2/${r}/${t}?PageNumber=${n}&PageSize=${os}`,i=await je({url:a,withToken:!0,method:"get",typeToken:"customer"}),c=Number((l=i.headers)==null?void 0:l["x-pagination-total"]);return{list:i.data,totalCount:c}},js=async(t,n="get",o)=>{const r=Xe.getState().apiUrls,a=ut?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${r.slApi}/v1/orders/${a}/${t}`;return await je({url:i,method:n,withToken:!0,body:o,typeToken:"customer"})},b4=t=>js("","post",t),w4=({PageNumber:t})=>Ka({url:"customers/orders",PageNumber:t}),x4=t=>js(t),_4=t=>js(t),T4=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.slApi}/v1/${o}/subscriptions`;return await je({url:r,method:"post",withToken:!1,body:t})},k4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v2/${r}/subscriptions/${t}/${n}`;return await je({url:a,method:"get",withToken:!1})},L4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v1/${r}/subscriptions/${t}/${n}/upgrades`;return await je({url:a,method:"get",withToken:!1})},A4=async(t,n,o)=>{const r=Xe.getState().apiUrls,a=ut?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${r.slApi}/v1/${a}/subscriptions/${t}/${n}/cancel`;return await je({url:i,method:"post",withToken:!1,body:o})},P4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v2/${r}/subscriptions/${t}/change-gateway`;return await je({url:a,method:"post",withToken:!1,body:{gateway:n}})},E4=({PageNumber:t})=>Ka({url:"customers/subscriptions",PageNumber:t}),R4=async({id:t,accessToken:n})=>await L4(t,n),D4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v2/${r}/subscriptions/${t}/order`;return await je({url:a,method:"post",withToken:!1,body:n})},M4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v1/public/${r}/tickets/${t}/${n}`;return await je({url:a,method:"get",withToken:!1})},N4=async(t,n,o,r,a)=>{const i=Xe.getState().apiUrls,c=ut?localStorage.getItem("fakeDomain"):window.location.hostname,l=`${i.slApi}/v1/public/${c}/tickets/${t}/${n}/answer`;return(await je({url:l,method:"post",body:{message:o,recaptcha:r,tsId:a},withToken:!1})).data},B4=({PageNumber:t})=>Ka({url:"customers/tickets",PageNumber:t}),F4=({PageNumber:t})=>Ka({url:"customers/balance/transactions",PageNumber:t}),md=async t=>{const n=Xe.getState().apiUrls,o=t.map(c=>["names",c]),r=new URLSearchParams(o),a=ut?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v2/gateways?shopDomain=${a}&${r.toString()}`;return await je({url:i,method:"get",withToken:!1})},j4=async({email:t,recaptcha:n,tsId:o})=>{const r=Xe.getState().apiUrls,a=ut?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${r.customersApi}/v2/${a}/auth/otp/request`;return(await je({url:i,body:{email:t,recaptcha:n,tsId:o},method:"post",withToken:!1})).data?{requested:!0,email:t}:{requested:!1,email:void 0}},O4=async({email:t,otp:n,recaptcha:o,tsId:r})=>{const a=Xe.getState().apiUrls,i=ut?localStorage.getItem("fakeDomain"):window.location.hostname,c=`${a.customersApi}/v2/${i}/auth/otp/login`,{data:l}=await je({url:c,method:"post",body:{email:t,otp:n,recaptcha:o,tsId:r},withToken:!1});return ko.getState().setToken(l.data),localStorage.setItem("token",l.data),{token:l.data,requested:!1}},H4=async()=>{ko.getState().setToken(""),localStorage.removeItem("token")},V4=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.slApi}/v2/coupons/${o}/validate`;return await je({url:r,method:"post",body:t,withToken:!1})},U4=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.customersApi}/v2/${o}/customers/referral-system/signup`;return(await je({url:r,withToken:!0,method:"post",body:t,typeToken:"customer"})).data},$4=async()=>{const{data:t}=await v4();return t},W4=async t=>{const{data:n}=await U4(t);return n};async function q4(t){const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.customersApi}/v2/${o}/customers/rewards/${t.id}/claim`;return je({url:r,method:"post",withToken:!0,typeToken:"customer"})}const vi="Balance",Z4={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},G4={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},al=(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=$n.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},z4=(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}=$n.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),Y4=(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})}),il=t=>new Set(t.gateways.map(n=>n.name)),sl={availableGateways:[],requiresSignInGateways:[]},cl=(t,n)=>{var i;if(n.length===0)return sl;const o=(i=n[0])==null?void 0:i.variants[0];if(!o)return sl;const r=il(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=il(u);for(const h of r)d.has(h)||r.delete(h)}return!localStorage.getItem("token")&&r.has(vi)?(r.delete(vi),{availableGateways:[...r],requiresSignInGateways:[vi]}):{availableGateways:[...r],requiresSignInGateways:[]}},X4=(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:""}))},K4=(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},J4=()=>{const{cart:t,products:n,coupon:o,pending:r,applyCouponPending:a,customerEmail:i,setCart:c,setProducts:l,setCoupon:u,setPending:d,setApplyCouponPending:h}=$n(),f=async p=>{var v;h(!0);const{cart:C}=$n.getState(),{gateway:b,parts:S}=C,{notifications:x,setNotifications:T}=Dt.getState();b||(h(!1),T([...x,{message:"There should be a gateway for the coupon",status:"error",id:ze()}]));const _=S.map(L=>L.productId);let D=null;try{const{data:L}=await V4({gateway:b,couponName:p,productIds:_});D=L.data,T([...x,{message:"Coupon is applied",status:"success",id:ze()}]),c(N=>({...N,coupon:p}))}catch(L){const N=L;T([...x,{message:`Coupon is not applied: ${N.message}`,status:"error",id:ze()}]),c(M=>({...M,coupon:null})),u(null),h(!1)}if(h(!1),(v=D==null?void 0:D.restrictToProductIds)!=null&&v.length&&!_.every(L=>{var N;return(N=D==null?void 0:D.restrictToProductIds)==null?void 0:N.includes(L)}))throw new Error("Coupon can't be applied to such products");return u(D),D},I={reset(){c({...G4})},addProducts:p=>{const C=$n.getState().products,b=p.filter(S=>!C.some(x=>x.id===S.id));l([...C,...b])},addProductToCart:p=>{const C=$n.getState().cart;try{al(n,p)}catch(S){throw new Error(S)}const b=C.parts.find(S=>S.productId===p.productId&&S.productVariantId===p.productVariantId&&S.chargeType===p.chargeType);if(b)return I.updateQuantityOfProduct({...b,quantity:(b.quantity||1)+(p.quantity||1),chargeType:p.chargeType});if(C.parts.length&&!cl([...C.parts,p],n).availableGateways.length)throw new Error("No common payment gateways available");c({...C,parts:[...C.parts,p]})},removeProduct({productId:p,productVariantId:C}){c(b=>({...b,parts:b.parts.filter(S=>S.productId!==p||S.productVariantId!==C)}))},getPossibleGateways(){return cl(t.parts,n)},removeCoupon(){u(null)},getDiscordSettings(){return Y4(n,t.parts)},updateQuantityOfProduct(p){al(n,p),c(C=>({...C,parts:C.parts.map(b=>b.productId===p.productId&&b.productVariantId===p.productVariantId?{...b,quantity:p.quantity,chargeType:p.chargeType}:b)}))},getTotalAndDiscount(){const{coupon:p}=$n.getState(),C=z4(t.parts,n);let b;return p&&p.discount&&(!p.isFixed&&p.discount===100?b=0:b=p.isFixed?Math.max(0,C-p.discount):C*(1-p.discount/100)),{total:C,totalWithDiscount:b}},setGateway(p){c(C=>({...C,gateway:p})),t.coupon&&f(t.coupon)},setPaymentMethod(p){c(C=>({...C,paymentMethod:p}))},async submitCart(p){d(!0);const{cart:C}=$n.getState(),{discordInfo:b}=Eu.getState();let S;if(C.parts&&i&&K4(C.parts[0],n))try{const{data:x}=await T4({...C,partOrder:C.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:b!=null&&b.authorized?b.id:null,customerEmail:i,recaptcha:p,customFields:{...C.customFields},tsId:ao()});S=x.data}catch(x){console.error(x)}else try{const{data:x}=await b4({...C,referralCode:localStorage.getItem("referralCode"),recaptcha:p,customFields:{...C.customFields},tsId:ao(),discordSocialConnectId:b!=null&&b.authorized?b.id:null});S=x.data}catch(x){const{notifications:T,setNotifications:_}=Dt.getState();_([...T,{message:`Failed to create order: ${x}`,status:"error",id:ze()}])}if(d(!1),S)return S;throw new Error("Failed to create order")},setDiscordSocialConnectId(p){c(C=>({...C,discordSocialConnectId:p}))},setCustomFields(p){c(C=>({...C,customFields:{...p}}))}};return y.useEffect(()=>{c(p=>({...p,customerEmail:i??""}))},[i,c]),{cart:t,products:n,coupon:o,pending:r,applyCouponPending:a,applyCoupon:f,...I}},Ja=()=>{const{notifications:t,setNotifications:n}=Dt();return o=>{navigator.clipboard.writeText(o),n([...t,{status:"success",message:"Successfully copied",id:ze()}])}};function gd(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 Q4=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 Uo(n,()=>{r(null),i(!1)}),l?s.jsxs("div",{className:fr.modal,onClick:u=>{u.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[s.jsxs("div",{className:fr.top,children:[s.jsx("h3",{dangerouslySetInnerHTML:{__html:gd(l.productData.name)}}),s.jsx("div",{className:fr.closeIcon,children:s.jsx(G,{name:"X",height:20,width:20,onClick:()=>{i(!1),r(null)}})})]}),s.jsx("div",{className:fr.modalOptions,children:s.jsx(Nr,{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}),e3="_wrapper_e12vj_1",t3="_label_e12vj_9",n3="_input_e12vj_18",o3="_disabled_e12vj_31",r3="_paddingless_e12vj_36",a3="_isAntistock_e12vj_40",i3="_content_e12vj_48",s3="_contentBorder_e12vj_61",c3="_contentField_e12vj_66",l3="_borderless_e12vj_70",u3="_rightIcon_e12vj_75",d3="_leftIcon_e12vj_83",h3="_requiredStar_e12vj_90",Ot={wrapper:e3,label:t3,input:n3,disabled:o3,paddingless:r3,isAntistock:a3,content:i3,contentBorder:s3,contentField:c3,borderless:l3,rightIcon:u3,leftIcon:d3,requiredStar:h3},To=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:I=!1,isSearch:p=!1,centered:C=!1,maxSymbols:b,rightIcon:S,onFocus:x,leftIcon:T}=t,{themeSettings:_}=xo(),{isAntistock:D}=Mn(),{inputs:v}=_,[L,N]=y.useState(!1);function M(j){if(Number(j)<0)return String(c);const Z=j.replace(/[^\d-]/g,"");return Number(Z)<0?String(c):Z}function q(j){return!h||!f?!0:new RegExp(f).test(j)}return s.jsxs("div",{className:Ot.wrapper,children:[r&&s.jsxs("label",{className:Ot.label,htmlFor:r,style:{color:D?"var(--text-secondary)":void 0},children:[r,h&&s.jsx("span",{className:Ot.requiredStar,children:"*"})]}),s.jsxs("div",{className:te(Ot.content,{[Ot.contentBorder]:v.border.active,[Ot.contentField]:v.field.active,[Ot.disabled]:d}),style:{...o},children:[T&&s.jsx("div",{className:Ot.leftIcon,children:T}),s.jsx("input",{maxLength:b,id:r,type:i||"text",onChange:j=>{if(i==="text")n(j.target.value);else{const Z=M(j.target.value);n(Z)}},value:a,autoComplete:"off",placeholder:u||"Type something...",className:te(Ot.input,{[Ot.required]:L&&h&&!q(a),[Ot.paddingless]:m,[Ot.borderless]:g,[Ot.isAntistock]:D}),min:i==="number"?c:void 0,max:i==="number"?l:void 0,onFocus:()=>{x&&x(),N(!0)},disabled:d,style:{textAlign:C?"center":"left",padding:p?`7px ${Number(v.general.size)+20}px 7px ${T?35:11}px`:`7px ${S?35:11}px 7px ${T?35:11}px`}}),S&&s.jsx("div",{className:Ot.rightIcon,children:S}),p&&s.jsx("div",{className:Ot.rightIcon,children:s.jsx(G,{name:"MagnifyingGlass",fill:"var(--text-secondary)",width:v.general.size,height:v.general.size})}),I&&s.jsx("div",{children:s.jsx(G,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},f3="_button_o1xdh_1",p3="_primary_o1xdh_20",m3="_primaryHovered_o1xdh_30",g3="_secondary_o1xdh_35",I3="_secondaryHovered_o1xdh_45",C3="_tertiary_o1xdh_50",S3="_special_o1xdh_60",y3="_tertiaryHovered_o1xdh_64",v3="_content_o1xdh_69",b3="_isAntistock_o1xdh_77",Tn={button:f3,primary:p3,primaryHovered:m3,secondary:g3,secondaryHovered:I3,tertiary:C3,special:S3,tertiaryHovered:y3,content:v3,isAntistock:b3},w3=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,Id=({children:t,className:n,as:o="span",...r})=>{const[a,i]=y.useState(!1);return y.useEffect(()=>{typeof window<"u"&&i(w3())},[]),a?s.jsx(o,{className:n,...r,"data-stable-text":t,dangerouslySetInnerHTML:{__html:""}}):s.jsx(o,{className:n,...r,children:t})},lt=t=>{const{children:n,onClick:o,style:r,className:a,disabled:i=!1,type:c="Primary",dangerouslySetInnerHTML:l}=t,{themeSettings:u}=xo(),{isAntistock:d}=Mn(),h=p=>typeof p=="string"?s.jsx(Id,{children:p}):p,f={onClick:o,disabled:i,style:r,className:te(Tn.button,a,{[Tn.primary]:c==="Primary",[Tn.secondary]:c==="Secondary",[Tn.tertiary]:c==="Tertiary",[Tn.primaryHovered]:c==="Primary"&&!i&&u.buttons.primary.hover,[Tn.secondaryHovered]:c==="Secondary"&&!i&&u.buttons.secondary.hover,[Tn.tertiaryHovered]:c==="Tertiary"&&!i&&u.buttons.tertiary.hover,[Tn.isAntistock]:d})};if(c==="Special")return s.jsx("button",{...f,className:Tn.special,...l?{dangerouslySetInnerHTML:l}:{children:h(n)}});const m=c.toLowerCase(),g=u.buttons[m],I=c==="Tertiary"?s.jsxs("div",{className:Tn.content,children:[h(n),s.jsx(G,{name:"ArrowRight",fill:"var(--text-tertiary)",width:20,height:20})]}):h(n);return s.jsx("button",{...f,style:{...r,textAlign:g.alignment},...l?{dangerouslySetInnerHTML:l}:{children:I}})},x3="_modal_1iz94_1",_3="_padding_1iz94_17",T3="_content_1iz94_21",k3="_close_1iz94_42",Qr={modal:x3,padding:_3,content:T3,close:k3},Qa=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)}},[]),Co.createPortal(s.jsx("div",{className:te(Qr.modal,{[Qr.padding]:a}),onClick:l,children:r?s.jsx("div",{className:te(Qr.content,{[Qr.close]:!i}),children:o}):s.jsx(s.Fragment,{children:o})}),document.body)},Cd=({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=Dn(),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})},L3="_loader_3je9m_1",A3={loader:L3},dn=t=>s.jsx("div",{className:A3.loader,...t}),P3="_container_6vcrl_1",E3="_wrapper_6vcrl_5",ll={container:P3,wrapper:E3};class R3{constructor(){Jo(this,"observer",null);Jo(this,"callbacks",new Map);Jo(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 ul=new R3;function Sd(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)};ul.observe(r,i);const c=r.getBoundingClientRect().width;return i(c),()=>{ul.unobserve(r,i)}},[t]),n}const ea=16,yd=({children:t,padding:n,style:o,notPadding:r=!1})=>{const a=y.useRef(null),i=Sd(a);return s.jsx("div",{className:ll.container,ref:a,style:o,children:s.jsx("div",{className:ll.wrapper,style:{maxWidth:"var(--max-width-store)",paddingTop:i==="desktop"?n==null?void 0:n.top:r?0:ea,paddingBottom:i==="desktop"?n==null?void 0:n.bottom:r?0:ea,paddingLeft:i==="desktop"?n==null?void 0:n.left:r?0:ea,paddingRight:i==="desktop"?n==null?void 0:n.right:r?0:ea,...o},children:t(i)})})},D3="_wrapper_oxpf7_1",M3="_label_oxpf7_10",N3="_contentBorder_oxpf7_19",B3="_textarea_oxpf7_23",F3="_contentField_oxpf7_35",j3="_length_oxpf7_49",ho={wrapper:D3,label:M3,contentBorder:N3,textarea:B3,contentField:F3,length:j3},O3=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}=xo();function f(m){return c==="number"?m.replace(/[^\d\n]+/g,""):m}return s.jsxs("div",{className:ho.wrapper,children:[o&&s.jsxs("label",{className:ho.label,htmlFor:o,children:[o,l&&s.jsx("span",{className:ho.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(ho.textarea,{[ho.contentBorder]:h.inputs.border.active,[ho.contentField]:h.inputs.field.active}),maxLength:a}),a&&s.jsxs("div",{className:ho.length,children:[u,"/",a]})]})},H3="_wrapper_ty9h3_2",V3="_label_ty9h3_9",U3="_top_ty9h3_17",$3="_select_ty9h3_23",W3="_borderFocused_ty9h3_42",q3="_input_ty9h3_49",Z3="_icon_ty9h3_59",G3="_rotate_ty9h3_64",z3="_content_ty9h3_68",Y3="_options_ty9h3_72",X3="_filteredOptions_ty9h3_93",K3="_open_ty9h3_97",J3="_option_ty9h3_72",Q3="_focused_ty9h3_115",eC="_addon_ty9h3_119",tC="_value_ty9h3_130",nC="_postfix_ty9h3_135",oC="_leftAddon_ty9h3_139",vt={wrapper:H3,label:V3,top:U3,select:$3,borderFocused:W3,input:q3,icon:Z3,rotate:G3,content:z3,options:Y3,filteredOptions:X3,open:K3,option:J3,focused:Q3,addon:eC,value:tC,postfix:nC,leftAddon:oC};function rC(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 vd=t=>{var L,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,I]=y.useState(null),[p,C]=y.useState(!1),b=y.useRef(null);rC(b,()=>h(!1));function S(M){m(""),n(M),h(!1),I(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(),I(j=>j===null||j===q.length-1?0:j+1)),M.key==="ArrowUp"&&(M.preventDefault(),I(j=>j===null||j===0?q.length-1:j-1)),M.key==="Enter"&&g!==null&&(M.preventDefault(),S(q[g])),M.key==="Escape"&&h(!1)}const _=y.useRef(null),D=y.useMemo(()=>new Yn(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:vt.wrapper,style:{...i},children:[o&&s.jsxs("div",{className:vt.top,children:[s.jsx("label",{className:vt.label,htmlFor:o,children:o}),c&&s.jsx(Nn,{current:c.value,onChange:c.onChange})]}),s.jsxs("label",{className:vt.content,ref:b,children:[s.jsxs("div",{className:te(vt.select,{[vt.borderFocused]:d}),onKeyDown:T,onClick:M=>{M.stopPropagation(),h(q=>!q),C(!1)},ref:_,tabIndex:0,children:[u&&u.length>0&&s.jsx("div",{className:vt.addon,children:(L=u.find(M=>M.value===r))==null?void 0:L.addon}),s.jsx("div",{className:vt.input,id:"md",children:x(r,15)}),s.jsx("div",{className:te(vt.icon,{[vt.rotate]:d}),onClick:M=>{M.stopPropagation(),h(q=>!q)},children:s.jsx(G,{name:"CaretDown",width:16,height:16,fill:"var(--text-primary)"})})]}),s.jsxs("div",{className:te(vt.options,{[vt.open]:d}),style:{top:((N=_.current)==null?void 0:N.clientHeight)+10},children:[a.length>6&&s.jsx(To,{type:"text",value:f,placeholder:"Search...",onChange:M=>{m(M),C(!0)},isSearch:!0}),s.jsxs("div",{className:vt.filteredOptions,children:[v.map((M,q)=>{var j;return s.jsxs("div",{className:te(vt.option,{[vt.focused]:q===g}),onClick:()=>{S(M),h(!1)},id:"md",children:[u&&u.length>0&&s.jsx("div",{className:vt.leftAddon,children:(j=u.find(Z=>Z.value===M))==null?void 0:j.addon}),s.jsx("span",{className:vt.value,id:"md",children:x(M,20)}),l&&s.jsx("span",{className:vt.postfix,id:"md",children:l[q]})]},M)}),v.length===0&&s.jsx("div",{children:"No results found."})]})]})]})]})},aC="_wrapper_2vleg_1",iC="_label_2vleg_9",sC="_options_2vleg_17",cC="_radioLabel_2vleg_23",lC="_radio_2vleg_23",uC="_custom_2vleg_38",dC="_option_2vleg_17",fo={wrapper:aC,label:iC,options:sC,radioLabel:cC,radio:lC,custom:uC,option:dC},hC=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:fo.wrapper,children:[s.jsx("span",{className:fo.label,children:a}),s.jsx("div",{className:fo.options,style:{flexDirection:i},children:o.map(d=>s.jsxs("label",{className:fo.radioLabel,children:[s.jsx("input",{type:"radio",value:d.value,checked:c===d.value,onChange:u,className:fo.radio}),s.jsx("span",{className:fo.custom}),s.jsx("span",{className:fo.option,children:d.label})]},d.value))})]})},fC="_content_eonwv_1",pC="_main_eonwv_12",mC="_block_eonwv_16",gC="_active_eonwv_22",IC="_name_eonwv_32",CC="_addSection_eonwv_109",SC="_addSectionTop_eonwv_117",Kn={content:fC,main:pC,block:mC,active:gC,name:IC,addSection:CC,addSectionTop:SC},yC="_sidebar_xhqpt_1",vC="_content_xhqpt_14",bC="_button_xhqpt_24",wC="_moveButton_xhqpt_40",xC="_deleteButton_xhqpt_49",kn={sidebar:yC,content:vC,button:bC,moveButton:wC,deleteButton:xC},_C=()=>{var _;const{activeBlock:t,setActiveBlock:n}=Ha(),{blocks:o,removeBlock:r,moveBlock:a,duplicateBlock:i,setCurrentBlock:c}=Wn(),{currentPage:l,pages:u}=Gn(),{setTitle:d,setDescription:h,setOnConfirm:f}=Yl(),{setActiveBlock:m}=wo(),g=(_=u==null?void 0:u[l])==null?void 0:_.path,I=g?o[g]:null,p=(I==null?void 0:I.order)||[],C=p.indexOf(t.id),b=D=>{D.stopPropagation(),C>0&&g&&(a(g,C,C-1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},S=D=>{D.stopPropagation(),C<p.length-1&&g&&(a(g,C,C+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:kn.sidebar,children:s.jsxs("div",{className:kn.content,children:[s.jsx("button",{onClick:b,className:te(kn.button,kn.moveButton),disabled:C===0,children:s.jsx(G,{name:"ArrowUp"})}),s.jsx("button",{onClick:S,className:te(kn.button,kn.moveButton),disabled:C===p.length-1,children:s.jsx(G,{name:"ArrowDown"})}),s.jsx("button",{onClick:x,className:te(kn.button,kn.moveButton),children:s.jsx(G,{name:"Copy"})}),s.jsx("button",{className:te(kn.button,kn.deleteButton),onClick:D=>{D.stopPropagation(),d("Remove Block"),h(`Are you sure you want to delete ${(I==null?void 0:I.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(G,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})};function pr(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 TC=y.memo(({scrollableRef:t})=>{const{setActiveBlock:n,activeBlock:o,zoomLevel:r}=Ha(),{blocks:a,sourceBlocks:i}=wo(),{blocks:c,setCurrentBlock:l,currentBlock:u,setPositionBlock:d,announcement:h}=Wn(),{settings:f}=Er(),{currentPage:m,pages:g,pageContext:I}=Gn(),{activeBlock:p,setActiveBlock:C}=xo(),{setError:b}=zl(),{setActiveBlock:S}=wo(),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 L=v.offsetTop;t.current.scrollTo({top:L-30,behavior:"smooth"})}}},[o,t]);const _=Dn();y.useEffect(()=>{x.current=o.id},[o.id]);const D=v=>{if(!v||!v.name)return b({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:g&&g[m].id?[g[m].id]:[]}),s.jsx(ns,{error:"Block or block.name is undefined."});if(!a||!a[v.name])return b({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:g&&g[m].id?[g[m].id]:[]}),s.jsx(ns,{error:`Block "${v.name}" does not exist in blocks.`});const L=new a[v.name];return v.value&&Object.assign(L,v.value),L.renderBlock(f,I)};return s.jsxs("div",{onClick:v=>{v.stopPropagation()},className:Kn.content,style:{width:"100%",height:"100%",zoom:`${r}`},ref:t,children:[h&&s.jsx(pd,{}),s.jsx(fd,{}),s.jsx("div",{className:Kn.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:L=>T.current[v]=L,onClick:L=>{L.stopPropagation(),S(null),p&&C(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:L=>{L.stopPropagation(),o.neededScroll||n({id:v,neededScroll:!1})},onMouseLeave:L=>{L.stopPropagation(),o.neededScroll||n({id:null,neededScroll:!1})},className:te(Kn.block),children:[(o.id===v||u===v)&&s.jsx("div",{className:Kn.active}),(o.id===v||u===v)&&s.jsx("div",{className:Kn.name,children:pr(c[g[m].path].data[v].name,i)}),(o.id===v||u===v)&&pr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx(_C,{}),(o.id===v||u===v)&&pr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx("div",{className:Kn.addSection,children:s.jsx(Oo,{onClick:L=>{L.stopPropagation(),d(v,!0),l(null),n({id:null,neededScroll:!1}),S(null),_("/admin/builder/add")},children:"Add Section"})}),(o.id===v||u===v)&&pr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx("div",{className:te(Kn.addSection,Kn.addSectionTop),children:s.jsx(Oo,{onClick:L=>{L.stopPropagation(),d(v,!1),l(null),n({id:null,neededScroll:!1}),S(null),_("/admin/builder/add")},children:"Add Section"})}),a&&s.jsx(dd,{render:D,block:c[g[m].path].data[v]})]},v))}),s.jsx(hd,{})]})}),kC="_statItem_fzeec_1",LC="_content_fzeec_44",AC="_withChildren_fzeec_50",PC="_info_fzeec_56",EC="_iconWrapper_fzeec_68",RC="_text_fzeec_78",DC="_title_fzeec_84",MC="_value_fzeec_88",NC="_emptyImage_fzeec_94",BC="_image_fzeec_11",FC="_imageTitle_fzeec_112",jC="_emptyImageText_fzeec_122",OC="_hoverable_fzeec_147",ft={statItem:kC,content:LC,withChildren:AC,info:PC,iconWrapper:EC,text:RC,title:DC,value:MC,emptyImage:NC,image:BC,imageTitle:FC,emptyImageText:jC,hoverable:OC},rn=({iconName:t,title:n,value:o,image:r,imageName:a,children:i,className:c,logo:l,productSlug:u})=>{const d=Dn();return s.jsxs("div",{className:`${ft.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(ft.image,ft.emptyImage,{[ft.hoverable]:u})})}),s.jsx("div",{className:ft.emptyImageText,children:s.jsx("div",{className:te(ft.title,ft.imageTitle),id:"h5",children:a})})]}),r==="empty"&&s.jsx("div",{style:{background:"#000000"},children:s.jsxs("div",{className:te(ft.emptyImage,{[ft.hoverable]:u}),onClick:()=>{u&&d(`/${u}`)},children:[s.jsx(G,{name:"Image",width:64,height:64,fill:"var(--text-secondary)"}),s.jsx("div",{className:ft.emptyImageText,children:s.jsx("div",{className:ft.title,id:"h5",children:a||"No Product"})})]})}),s.jsxs("div",{className:`${ft.content} ${i?ft.withChildren:""}`,children:[s.jsxs("div",{className:ft.info,children:[l?s.jsx("div",{className:ft.iconWrapper,children:s.jsx("img",{src:l,width:28,height:28,style:{objectFit:"contain"}})}):s.jsx(G,{name:t||"File",className:ft.iconWrapper,width:28,height:28,fill:"var(--text-action)"}),s.jsxs("div",{className:ft.text,children:[s.jsx("div",{className:ft.title,id:"h5",children:n}),s.jsx("div",{className:ft.value,id:"h5-bold",children:o})]})]}),i]})]})},HC="_card_10fve_2",VC="_mobile_10fve_15",UC="_email_10fve_19",$C="_balance_10fve_25",WC="_sidebar_10fve_32",qC="_navList_10fve_56",ZC="_navItem_10fve_71",GC="_activeNavItem_10fve_84",zC="_inactiveNavItem_10fve_89",YC="_logoutNavItem_10fve_98",XC="_iconWrapper_10fve_107",KC="_skeleton_10fve_112",Nt={card:HC,mobile:VC,email:UC,balance:$C,sidebar:WC,navList:qC,navItem:ZC,activeNavItem:GC,inactiveNavItem:zC,logoutNavItem:YC,iconWrapper:XC,skeleton:KC},JC=({email:t,balance:n,adaptiveStyles:o})=>s.jsxs("div",{className:te(Nt.card,{[Nt.mobile]:o!=="desktop"}),children:[s.jsx("div",{className:Nt.email,id:"h5",children:t}),s.jsxs("div",{className:Nt.balance,id:"md",children:["Balance: ",n]})]}),QC=[[ct.Home,"House"],[ct.Orders,"CurrencyCircleDollar"],[ct.Rewards,"Medal"],[ct.Balance,"Wallet"],[ct.Subscriptions,"CalendarCheck"],[ct.Tickets,"Question"]],e6=[[ur.Home,"House"],[ur.Orders,"CurrencyCircleDollar"],[ur.Balance,"Wallet"],[ur.Tickets,"Question"]],dl=({children:t,className:n="",onClick:o})=>s.jsx("button",{type:"button",className:te(Nt.navItem,n),onClick:o,children:t}),t6=({adaptiveStyles:t})=>{const{route:n,setRoute:o}=un(),{isAntistock:r}=Mn(),a=r?e6:QC;return s.jsxs("div",{className:te(Nt.navList,{[Nt.mobile]:t!=="desktop"}),children:[a.map(([i,c])=>{const l=i===n;return s.jsxs(dl,{onClick:()=>o(i),className:te(l?Nt.activeNavItem:Nt.inactiveNavItem),children:[r?null:s.jsx("div",{className:Nt.iconWrapper,children:s.jsx(G,{name:c})}),s.jsx("div",{children:i})]},i)}),s.jsxs(dl,{className:Nt.logoutNavItem,onClick:()=>{H4()},children:[s.jsx("div",{className:Nt.iconWrapper,children:s.jsx(G,{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||{}),Vn=(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))(Vn||{});const Or=async t=>(await md(t)).data,bd=async()=>{var o;const n=(await y4()).data;if(n.isEnabled){const r=(o=n==null?void 0:n.topUpSettings)==null?void 0:o.gateways;r&&Or(r)}return n},Os=async()=>{const n=(await S4()).data;return{amount:n.realBalance+n.manualBalance,currency:n.currency}};var mr=(t=>(t.ADDED="ADDED",t.REMOVED="REMOVED",t))(mr||{}),Fe=(t=>(t.NotPaid="NOT_PAID",t.Pending="PENDING",t.Paid="PAID",t.Expired="EXPIRED",t.Cancelled="CANCELLED",t))(Fe||{}),Lr=(t=>(t.Balance="BALANCE",t.Product="PRODUCT",t))(Lr||{}),tn=(t=>(t.Spend="SPEND_AMOUNT",t.Order="ORDER_COUNT",t.Referral="REFER_FRIEND",t.Review="LEAVE_REVIEW",t))(tn||{});const n6=async()=>(await C4()).data;/*! *****************************************************************************
|
|
73
|
+
`},X5={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 K5(t){let{announcements:n=X5,container:o,hiddenTextDescribedById:r,screenReaderInstructions:a=Y5}=t;const{announce:i,announcement:c}=Z5(),l=jr("DndLiveRegion"),[u,d]=y.useState(!1);if(y.useEffect(()=>{d(!0)},[]),G5(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(W5,{id:r,value:a.draggable}),y.createElement(q5,{id:l,announcement:c}));return o?Co.createPortal(h,o):h}var pt;(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"})(pt||(pt={}));function Pa(){}function Ou(t,n){return y.useMemo(()=>({sensor:t,options:n??{}}),[t,n])}function Hu(){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 J5(t,n){let{data:{value:o}}=t,{data:{value:r}}=n;return r-o}function Q5(t,n){if(!t||t.length===0)return null;const[o]=t;return o[n]}function e0(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 t0=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=e0(l,n);u>0&&a.push({id:c,data:{droppableContainer:i,value:u}})}}return a.sort(J5)};function n0(t,n,o){return{...t,scaleX:n&&o?n.width/o.width:1,scaleY:n&&o?n.height/o.height:1}}function Vu(t,n){return t&&n?{x:t.left-n.left,y:t.top-n.top}:gn}function o0(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 r0=o0(1);function a0(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 i0(t,n,o){const r=a0(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 s0={ignoreTransform:!1};function Go(t,n){n===void 0&&(n=s0);let o=t.getBoundingClientRect();if(n.ignoreTransform){const{transform:d,transformOrigin:h}=Yt(t).getComputedStyle(t);d&&(o=i0(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 Yc(t){return Go(t,{ignoreTransform:!0})}function c0(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}function l0(t,n){return n===void 0&&(n=Yt(t).getComputedStyle(t)),n.position==="fixed"}function u0(t,n){n===void 0&&(n=Yt(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 Ns(t,n){const o=[];function r(a){if(n!=null&&o.length>=n||!a)return o;if(Rs(a)&&a.scrollingElement!=null&&!o.includes(a.scrollingElement))return o.push(a.scrollingElement),o;if(!Br(a)||Bu(a)||o.includes(a))return o;const i=Yt(t).getComputedStyle(a);return a!==t&&u0(a,i)&&o.push(a),l0(a,i)?o:r(a.parentNode)}return t?r(t):o}function Uu(t){const[n]=Ns(t,1);return n??null}function Ci(t){return!Ga||!t?null:qo(t)?t:Es(t)?Rs(t)||t===Zo(t).scrollingElement?window:Br(t)?t:null:null}function $u(t){return qo(t)?t.scrollX:t.scrollLeft}function Wu(t){return qo(t)?t.scrollY:t.scrollTop}function Qi(t){return{x:$u(t),y:Wu(t)}}var bt;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(bt||(bt={}));function qu(t){return!Ga||!t?!1:t===document.scrollingElement}function Zu(t){const n={x:0,y:0},o=qu(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 d0={x:.2,y:.2};function h0(t,n,o,r,a){let{top:i,left:c,right:l,bottom:u}=o;r===void 0&&(r=10),a===void 0&&(a=d0);const{isTop:d,isBottom:h,isLeft:f,isRight:m}=Zu(t),g={x:0,y:0},I={x:0,y:0},p={height:n.height*a.y,width:n.width*a.x};return!d&&i<=n.top+p.height?(g.y=bt.Backward,I.y=r*Math.abs((n.top+p.height-i)/p.height)):!h&&u>=n.bottom-p.height&&(g.y=bt.Forward,I.y=r*Math.abs((n.bottom-p.height-u)/p.height)),!m&&l>=n.right-p.width?(g.x=bt.Forward,I.x=r*Math.abs((n.right-p.width-l)/p.width)):!f&&c<=n.left+p.width&&(g.x=bt.Backward,I.x=r*Math.abs((n.left+p.width-c)/p.width)),{direction:g,speed:I}}function f0(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 Gu(t){return t.reduce((n,o)=>jo(n,Qi(o)),gn)}function p0(t){return t.reduce((n,o)=>n+$u(o),0)}function m0(t){return t.reduce((n,o)=>n+Wu(o),0)}function g0(t,n){if(n===void 0&&(n=Go),!t)return;const{top:o,left:r,bottom:a,right:i}=n(t);Uu(t)&&(a<=0||i<=0||o>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const I0=[["x",["left","right"],p0],["y",["top","bottom"],m0]];class Bs{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=Ns(o),a=Gu(r);this.rect={...n},this.width=n.width,this.height=n.height;for(const[i,c,l]of I0)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 Ir{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 C0(t){const{EventTarget:n}=Yt(t);return t instanceof n?t:Zo(t)}function Si(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 sn;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(sn||(sn={}));function Xc(t){t.preventDefault()}function S0(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 zu={start:[Ee.Space,Ee.Enter],cancel:[Ee.Esc],end:[Ee.Space,Ee.Enter,Ee.Tab]},y0=(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 Yu{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 Ir(Zo(o)),this.windowListeners=new Ir(Yt(o)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(sn.Resize,this.handleCancel),this.windowListeners.add(sn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(sn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:o}=this.props,r=n.node.current;r&&g0(r),o(gn)}handleKeyDown(n){if(Ms(n)){const{active:o,context:r,options:a}=this.props,{keyboardCodes:i=zu,coordinateGetter:c=y0,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=Aa(f,h),g={x:0,y:0},{scrollableAncestors:I}=r.current;for(const p of I){const C=n.code,{isTop:b,isRight:S,isLeft:x,isBottom:T,maxScroll:_,minScroll:D}=Zu(p),v=f0(p),L={x:Math.min(C===Ee.Right?v.right-v.width/2:v.right,Math.max(C===Ee.Right?v.left:v.left+v.width/2,f.x)),y:Math.min(C===Ee.Down?v.bottom-v.height/2:v.bottom,Math.max(C===Ee.Down?v.top:v.top+v.height/2,f.y))},N=C===Ee.Right&&!S||C===Ee.Left&&!x,M=C===Ee.Down&&!T||C===Ee.Up&&!b;if(N&&L.x!==f.x){const q=p.scrollLeft+m.x,j=C===Ee.Right&&q<=_.x||C===Ee.Left&&q>=D.x;if(j&&!m.y){p.scrollTo({left:q,behavior:l});return}j?g.x=p.scrollLeft-q:g.x=C===Ee.Right?p.scrollLeft-_.x:p.scrollLeft-D.x,g.x&&p.scrollBy({left:-g.x,behavior:l});break}else if(M&&L.y!==f.y){const q=p.scrollTop+m.y,j=C===Ee.Down&&q<=_.y||C===Ee.Up&&q>=D.y;if(j&&!m.x){p.scrollTo({top:q,behavior:l});return}j?g.y=p.scrollTop-q:g.y=C===Ee.Down?p.scrollTop-_.y:p.scrollTop-D.y,g.y&&p.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(n,jo(Aa(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()}}Yu.activators=[{eventName:"onKeyDown",handler:(t,n,o)=>{let{keyboardCodes:r=zu,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 Kc(t){return!!(t&&"distance"in t)}function Jc(t){return!!(t&&"delay"in t)}class Fs{constructor(n,o,r){var a;r===void 0&&(r=C0(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=Zo(c),this.documentListeners=new Ir(this.document),this.listeners=new Ir(r),this.windowListeners=new Ir(Yt(c)),this.initialCoordinates=(a=Ji(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(sn.Resize,this.handleCancel),this.windowListeners.add(sn.DragStart,Xc),this.windowListeners.add(sn.VisibilityChange,this.handleCancel),this.windowListeners.add(sn.ContextMenu,Xc),this.documentListeners.add(sn.Keydown,this.handleKeydown),o){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Jc(o)){this.timeoutId=setTimeout(this.handleStart,o.delay),this.handlePending(o);return}if(Kc(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(sn.Click,S0,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(sn.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=Ji(n))!=null?o:gn,d=Aa(a,u);if(!r&&l){if(Kc(l)){if(l.tolerance!=null&&Si(d,l.tolerance))return this.handleCancel();if(Si(d,l.distance))return this.handleStart()}if(Jc(l)&&Si(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 v0={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class za extends Fs{constructor(n){const{event:o}=n,r=Zo(o.target);super(n,v0,r)}}za.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 b0={move:{name:"mousemove"},end:{name:"mouseup"}};var es;(function(t){t[t.RightClick=2]="RightClick"})(es||(es={}));class w0 extends Fs{constructor(n){super(n,b0,Zo(n.event.target))}}w0.activators=[{eventName:"onMouseDown",handler:(t,n)=>{let{nativeEvent:o}=t,{onActivation:r}=n;return o.button===es.RightClick?!1:(r==null||r({event:o}),!0)}}];const yi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class x0 extends Fs{constructor(n){super(n,yi)}static setup(){return window.addEventListener(yi.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(yi.move.name,n)};function n(){}}}x0.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 Cr;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Cr||(Cr={}));var Ea;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ea||(Ea={}));function _0(t){let{acceleration:n,activator:o=Cr.Pointer,canScroll:r,draggingRect:a,enabled:i,interval:c=5,order:l=Ea.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:f,threshold:m}=t;const g=k0({delta:f,disabled:!i}),[I,p]=O5(),C=y.useRef({x:0,y:0}),b=y.useRef({x:0,y:0}),S=y.useMemo(()=>{switch(o){case Cr.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Cr.DraggableRect:return a}},[o,a,u]),x=y.useRef(null),T=y.useCallback(()=>{const D=x.current;if(!D)return;const v=C.current.x*b.current.x,L=C.current.y*b.current.y;D.scrollBy(v,L)},[]),_=y.useMemo(()=>l===Ea.TreeOrder?[...d].reverse():d,[l,d]);y.useEffect(()=>{if(!i||!d.length||!S){p();return}for(const D of _){if((r==null?void 0:r(D))===!1)continue;const v=d.indexOf(D),L=h[v];if(!L)continue;const{direction:N,speed:M}=h0(D,L,S,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,I(T,c),C.current=M,b.current=N;return}}C.current={x:0,y:0},b.current={x:0,y:0},p()},[n,T,r,p,i,c,JSON.stringify(S),JSON.stringify(g),I,d,_,h,JSON.stringify(m)])}const T0={x:{[bt.Backward]:!1,[bt.Forward]:!1},y:{[bt.Backward]:!1,[bt.Forward]:!1}};function k0(t){let{delta:n,disabled:o}=t;const r=Ki(n);return Fr(a=>{if(o||!r||!a)return T0;const i={x:Math.sign(n.x-r.x),y:Math.sign(n.y-r.y)};return{x:{[bt.Backward]:a.x[bt.Backward]||i.x===-1,[bt.Forward]:a.x[bt.Forward]||i.x===1},y:{[bt.Backward]:a.y[bt.Backward]||i.y===-1,[bt.Forward]:a.y[bt.Forward]||i.y===1}}},[o,n,r])}function L0(t,n){const o=n!=null?t.get(n):void 0,r=o?o.node.current:null;return Fr(a=>{var i;return n==null?null:(i=r??a)!=null?i:null},[r,n])}function A0(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 kr;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(kr||(kr={}));var ts;(function(t){t.Optimized="optimized"})(ts||(ts={}));const Qc=new Map;function P0(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=C(),m=Tr(f),g=y.useCallback(function(b){b===void 0&&(b=[]),!m.current&&c(S=>S===null?b:S.concat(b.filter(x=>!S.includes(x))))},[m]),I=y.useRef(null),p=Fr(b=>{if(f&&!o)return Qc;if(!b||b===Qc||h.current!==t||i!=null){const S=new Map;for(let x of t){if(!x)continue;if(i&&i.length>0&&!i.includes(x.id)&&x.rect.current){S.set(x.id,x.rect.current);continue}const T=x.node.current,_=T?new Bs(u(T),T):null;x.rect.current=_,_&&S.set(x.id,_)}return S}return b},[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"||I.current!==null||(I.current=setTimeout(()=>{g(),I.current=null},l))},[l,f,g,...r]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:i!=null};function C(){switch(d){case kr.Always:return!1;case kr.BeforeDragging:return o;default:return!o}}}function Xu(t,n){return Fr(o=>t?o||(typeof n=="function"?n(t):t):null,[n,t])}function E0(t,n){return Xu(t,n)}function R0(t){let{callback:n,disabled:o}=t;const r=Ds(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 Ya(t){let{callback:n,disabled:o}=t;const r=Ds(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 D0(t){return new Bs(Go(t),t)}function el(t,n,o){n===void 0&&(n=D0);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=R0({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=Ya({callback:i});return Rn(()=>{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 M0(t){const n=Xu(t);return Vu(t,n)}const tl=[];function N0(t){const n=y.useRef(t),o=Fr(r=>t?r&&r!==tl&&t&&n.current&&t.parentNode===n.current.parentNode?r:Ns(t):tl,[t]);return y.useEffect(()=>{n.current=t},[t]),o}function B0(t){const[n,o]=y.useState(null),r=y.useRef(t),a=y.useCallback(i=>{const c=Ci(i.target);c&&o(l=>l?(l.set(c,Qi(c)),new Map(l)):null)},[]);return y.useEffect(()=>{const i=r.current;if(t!==i){c(i);const l=t.map(u=>{const d=Ci(u);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,Qi(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=Ci(u);d==null||d.removeEventListener("scroll",a)})}},[a,t]),y.useMemo(()=>t.length?n?Array.from(n.values()).reduce((i,c)=>jo(i,c),gn):Gu(t):gn,[t,n])}function nl(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?Aa(t,o.current):gn}function F0(t){y.useEffect(()=>{if(!Ga)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 j0(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 Ku(t){return y.useMemo(()=>t?c0(t):null,[t])}const ol=[];function O0(t,n){n===void 0&&(n=Go);const[o]=t,r=Ku(o?Yt(o):null),[a,i]=y.useState(ol);function c(){i(()=>t.length?t.map(u=>qu(u)?r:new Bs(n(u),u)):ol)}const l=Ya({callback:c});return Rn(()=>{l==null||l.disconnect(),c(),t.forEach(u=>l==null?void 0:l.observe(u))},[t]),a}function H0(t){if(!t)return null;if(t.children.length>1)return t;const n=t.children[0];return Br(n)?n:t}function V0(t){let{measure:n}=t;const[o,r]=y.useState(null),a=y.useCallback(d=>{for(const{target:h}of d)if(Br(h)){r(f=>{const m=n(h);return f?{...f,width:m.width,height:m.height}:m});break}},[n]),i=Ya({callback:a}),c=y.useCallback(d=>{const h=H0(d);i==null||i.disconnect(),h&&(i==null||i.observe(h)),r(h?n(h):null)},[n,i]),[l,u]=La(c);return y.useMemo(()=>({nodeRef:l,rect:o,setRef:u}),[o,l,u])}const U0=[{sensor:za,options:{}},{sensor:Yu,options:{}}],$0={current:{}},ga={draggable:{measure:Yc},droppable:{measure:Yc,strategy:kr.WhileDragging,frequency:ts.Optimized},dragOverlay:{measure:Go}};class Sr 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 W0={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Sr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Pa},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ga,measureDroppableContainers:Pa,windowRect:null,measuringScheduled:!1},q0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Pa,draggableNodes:new Map,over:null,measureDroppableContainers:Pa},Xa=y.createContext(q0),Ju=y.createContext(W0);function Z0(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Sr}}}function G0(t,n){switch(n.type){case pt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case pt.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 pt.DragEnd:case pt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case pt.RegisterDroppable:{const{element:o}=n,{id:r}=o,a=new Sr(t.droppable.containers);return a.set(r,o),{...t,droppable:{...t.droppable,containers:a}}}case pt.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 Sr(t.droppable.containers);return c.set(o,{...i,disabled:a}),{...t,droppable:{...t.droppable,containers:c}}}case pt.UnregisterDroppable:{const{id:o,key:r}=n,a=t.droppable.containers.get(o);if(!a||r!==a.key)return t;const i=new Sr(t.droppable.containers);return i.delete(o),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function z0(t){let{disabled:n}=t;const{active:o,activatorEvent:r,draggableNodes:a}=y.useContext(Xa),i=Ki(r),c=Ki(o==null?void 0:o.id);return y.useEffect(()=>{if(!n&&!r&&i&&c!=null){if(!Ms(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=U5(h);if(f){f.focus();break}}})}},[r,n,a,c,i]),null}function Y0(t,n){let{transform:o,...r}=n;return t!=null&&t.length?t.reduce((a,i)=>i({transform:a,...r}),o):o}function X0(t){return y.useMemo(()=>({draggable:{...ga.draggable,...t==null?void 0:t.draggable},droppable:{...ga.droppable,...t==null?void 0:t.droppable},dragOverlay:{...ga.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 K0(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;Rn(()=>{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=Vu(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=Uu(d);m&&m.scrollBy({top:f.y,left:f.x})}},[n,c,l,r,o])}const Qu=y.createContext({...gn,scaleX:1,scaleY:1});var Qn;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Qn||(Qn={}));const ed=y.memo(function(n){var o,r,a,i;let{id:c,accessibility:l,autoScroll:u=!0,children:d,sensors:h=U0,collisionDetection:f=t0,measuring:m,modifiers:g,...I}=n;const p=y.useReducer(G0,void 0,Z0),[C,b]=p,[S,x]=z5(),[T,_]=y.useState(Qn.Uninitialized),D=T===Qn.Initialized,{draggable:{active:v,nodes:L,translate:N},droppable:{containers:M}}=C,q=v!=null?L.get(v):null,j=y.useRef({initial:null,translated:null}),Z=y.useMemo(()=>{var Ue;return v!=null?{id:v,data:(Ue=q==null?void 0:q.data)!=null?Ue:$0,rect:j}:null},[v,q]),H=y.useRef(null),[ce,he]=y.useState(null),[me,Ce]=y.useState(null),ye=Tr(I,Object.values(I)),$=jr("DndDescribedBy",c),Y=y.useMemo(()=>M.getEnabled(),[M]),ne=X0(m),{droppableRects:oe,measureDroppableContainers:O,measuringScheduled:X}=P0(Y,{dragging:D,dependencies:[N.x,N.y],config:ne.droppable}),K=L0(L,v),ie=y.useMemo(()=>me?Ji(me):null,[me]),ue=jn(),z=E0(K,ne.draggable.measure);K0({activeNode:v!=null?L.get(v):null,config:ue.layoutShiftCompensation,initialRect:z,measure:ne.draggable.measure});const J=el(K,ne.draggable.measure,z),ke=el(K?K.parentElement:null),V=y.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:oe,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=M.getNodeFor((o=V.current.over)==null?void 0:o.id),le=V0({measure:ne.dragOverlay.measure}),de=(r=le.nodeRef.current)!=null?r:K,Le=D?(a=le.rect)!=null?a:J:null,nt=!!(le.nodeRef.current&&le.rect),ot=M0(nt?null:J),Ae=Ku(de?Yt(de):null),Oe=N0(D?xe??K:null),Xt=O0(Oe),qe=Y0(g,{transform:{x:N.x-ot.x,y:N.y-ot.y,scaleX:1,scaleY:1},activatorEvent:me,active:Z,activeNodeRect:J,containerNodeRect:ke,draggingNodeRect:Le,over:V.current.over,overlayNodeRect:le.rect,scrollableAncestors:Oe,scrollableAncestorRects:Xt,windowRect:Ae}),Vt=ie?jo(ie,N):null,Ze=B0(Oe),dt=nl(Ze),Pt=nl(Ze,[J]),Ke=jo(qe,dt),rt=Le?r0(Le,qe):null,Je=Z&&rt?f({active:Z,collisionRect:rt,droppableRects:oe,droppableContainers:Y,pointerCoordinates:Vt}):null,yn=Q5(Je,"id"),[wt,Xn]=y.useState(null),at=nt?qe:jo(qe,Pt),vn=n0(at,(i=wt==null?void 0:wt.rect)!=null?i:null,J),bn=y.useRef(null),co=y.useCallback((Ue,gt)=>{let{sensor:It,options:Kt}=gt;if(H.current==null)return;const xt=L.get(H.current);if(!xt)return;const Qe=Ue.nativeEvent,Ct=new It({active:H.current,activeNode:xt,event:Qe,options:Kt,context:V,onAbort(et){if(!L.get(et))return;const{onDragAbort:A}=ye.current,R={id:et};A==null||A(R),S({type:"onDragAbort",event:R})},onPending(et,k,A,R){if(!L.get(et))return;const{onDragPending:ee}=ye.current,se={id:et,constraint:k,initialCoordinates:A,offset:R};ee==null||ee(se),S({type:"onDragPending",event:se})},onStart(et){const k=H.current;if(k==null)return;const A=L.get(k);if(!A)return;const{onDragStart:R}=ye.current,W={activatorEvent:Qe,active:{id:k,data:A.data,rect:j}};Co.unstable_batchedUpdates(()=>{R==null||R(W),_(Qn.Initializing),b({type:pt.DragStart,initialCoordinates:et,active:k}),S({type:"onDragStart",event:W}),he(bn.current),Ce(Qe)})},onMove(et){b({type:pt.DragMove,coordinates:et})},onEnd:wn(pt.DragEnd),onCancel:wn(pt.DragCancel)});bn.current=Ct;function wn(et){return async function(){const{active:A,collisions:R,over:W,scrollAdjustedTranslate:ee}=V.current;let se=null;if(A&&ee){const{cancelDrop:w}=ye.current;se={activatorEvent:Qe,active:A,collisions:R,delta:ee,over:W},et===pt.DragEnd&&typeof w=="function"&&await Promise.resolve(w(se))&&(et=pt.DragCancel)}H.current=null,Co.unstable_batchedUpdates(()=>{b({type:et}),_(Qn.Uninitialized),Xn(null),he(null),Ce(null),bn.current=null;const w=et===pt.DragEnd?"onDragEnd":"onDragCancel";if(se){const P=ye.current[w];P==null||P(se),S({type:w,event:se})}})}}},[L]),Xo=y.useCallback((Ue,gt)=>(It,Kt)=>{const xt=It.nativeEvent,Qe=L.get(Kt);if(H.current!==null||!Qe||xt.dndKit||xt.defaultPrevented)return;const Ct={active:Qe};Ue(It,gt.options,Ct)===!0&&(xt.dndKit={capturedBy:gt.sensor},H.current=Kt,co(It,gt))},[L,co]),Bn=A0(h,Xo);F0(h),Rn(()=>{J&&T===Qn.Initializing&&_(Qn.Initialized)},[J,T]),y.useEffect(()=>{const{onDragMove:Ue}=ye.current,{active:gt,activatorEvent:It,collisions:Kt,over:xt}=V.current;if(!gt||!It)return;const Qe={active:gt,activatorEvent:It,collisions:Kt,delta:{x:Ke.x,y:Ke.y},over:xt};Co.unstable_batchedUpdates(()=>{Ue==null||Ue(Qe),S({type:"onDragMove",event:Qe})})},[Ke.x,Ke.y]),y.useEffect(()=>{const{active:Ue,activatorEvent:gt,collisions:It,droppableContainers:Kt,scrollAdjustedTranslate:xt}=V.current;if(!Ue||H.current==null||!gt||!xt)return;const{onDragOver:Qe}=ye.current,Ct=Kt.get(yn),wn=Ct&&Ct.rect.current?{id:Ct.id,rect:Ct.rect.current,data:Ct.data,disabled:Ct.disabled}:null,et={active:Ue,activatorEvent:gt,collisions:It,delta:{x:xt.x,y:xt.y},over:wn};Co.unstable_batchedUpdates(()=>{Xn(wn),Qe==null||Qe(et),S({type:"onDragOver",event:et})})},[yn]),Rn(()=>{V.current={activatorEvent:me,active:Z,activeNode:K,collisionRect:rt,collisions:Je,droppableRects:oe,draggableNodes:L,draggingNode:de,draggingNodeRect:Le,droppableContainers:M,over:wt,scrollableAncestors:Oe,scrollAdjustedTranslate:Ke},j.current={initial:Le,translated:rt}},[Z,K,Je,rt,L,de,Le,oe,M,wt,Oe,Ke]),_0({...ue,delta:N,draggingRect:rt,pointerCoordinates:Vt,scrollableAncestors:Oe,scrollableAncestorRects:Xt});const Fn=y.useMemo(()=>({active:Z,activeNode:K,activeNodeRect:J,activatorEvent:me,collisions:Je,containerNodeRect:ke,dragOverlay:le,draggableNodes:L,droppableContainers:M,droppableRects:oe,over:wt,measureDroppableContainers:O,scrollableAncestors:Oe,scrollableAncestorRects:Xt,measuringConfiguration:ne,measuringScheduled:X,windowRect:Ae}),[Z,K,J,me,Je,ke,le,L,M,oe,wt,O,Oe,Xt,ne,X,Ae]),hn=y.useMemo(()=>({activatorEvent:me,activators:Bn,active:Z,activeNodeRect:J,ariaDescribedById:{draggable:$},dispatch:b,draggableNodes:L,over:wt,measureDroppableContainers:O}),[me,Bn,Z,J,b,$,L,wt,O]);return y.createElement(ju.Provider,{value:x},y.createElement(Xa.Provider,{value:hn},y.createElement(Ju.Provider,{value:Fn},y.createElement(Qu.Provider,{value:vn},d)),y.createElement(z0,{disabled:(l==null?void 0:l.restoreFocus)===!1})),y.createElement(K5,{...l,hiddenTextDescribedById:$}));function jn(){const Ue=(ce==null?void 0:ce.autoScrollEnabled)===!1,gt=typeof u=="object"?u.enabled===!1:u===!1,It=D&&!Ue&&!gt;return typeof u=="object"?{...u,enabled:It}:{enabled:It}}}),J0=y.createContext(null),rl="button",Q0="Draggable";function eI(t){let{id:n,data:o,disabled:r=!1,attributes:a}=t;const i=jr(Q0),{activators:c,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:f,over:m}=y.useContext(Xa),{role:g=rl,roleDescription:I="draggable",tabIndex:p=0}=a??{},C=(u==null?void 0:u.id)===n,b=y.useContext(C?Qu:J0),[S,x]=La(),[T,_]=La(),D=j0(c,n),v=Tr(o);Rn(()=>(f.set(n,{id:n,key:i,node:S,activatorNode:T,data:v}),()=>{const N=f.get(n);N&&N.key===i&&f.delete(n)}),[f,n]);const L=y.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":r,"aria-pressed":C&&g===rl?!0:void 0,"aria-roledescription":I,"aria-describedby":h.draggable}),[r,g,p,C,I,h.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:L,isDragging:C,listeners:r?void 0:D,node:S,over:m,setNodeRef:x,setActivatorNodeRef:_,transform:b}}function tI(){return y.useContext(Ju)}const nI="Droppable",oI={timeout:25};function rI(t){let{data:n,disabled:o=!1,id:r,resizeObserverConfig:a}=t;const i=jr(nI),{active:c,dispatch:l,over:u,measureDroppableContainers:d}=y.useContext(Xa),h=y.useRef({disabled:o}),f=y.useRef(!1),m=y.useRef(null),g=y.useRef(null),{disabled:I,updateMeasurementsFor:p,timeout:C}={...oI,...a},b=Tr(p??r),S=y.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(b.current)?b.current:[b.current]),g.current=null},C)},[C]),x=Ya({callback:S,disabled:I||!c}),T=y.useCallback((L,N)=>{x&&(N&&(x.unobserve(N),f.current=!1),L&&x.observe(L))},[x]),[_,D]=La(T),v=Tr(n);return y.useEffect(()=>{!x||!_.current||(x.disconnect(),f.current=!1,x.observe(_.current))},[_,x]),y.useEffect(()=>(l({type:pt.RegisterDroppable,element:{id:r,key:i,disabled:o,node:_,rect:m,data:v}}),()=>l({type:pt.UnregisterDroppable,key:i,id:r})),[r]),y.useEffect(()=>{o!==h.current.disabled&&(l({type:pt.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 td(t,n,o){const r=t.slice();return r.splice(o<0?r.length+o:o,0,r.splice(n,1)[0]),r}function aI(t,n){return t.reduce((o,r,a)=>{const i=n.get(r);return i&&(o[a]=i),o},Array(t.length))}function Kr(t){return t!==null&&t>=0}function iI(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 sI(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const nd=t=>{let{rects:n,activeIndex:o,overIndex:r,index:a}=t;const i=td(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}},Jr={scaleX:1,scaleY:1},od=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,...Jr}:null}const u=cI(i,a,o);return a>o&&a<=c?{x:0,y:-l.height-u,...Jr}:a<o&&a>=c?{x:0,y:l.height+u,...Jr}:{x:0,y:0,...Jr}};function cI(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 rd="Sortable",ad=y.createContext({activeIndex:-1,containerId:rd,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:nd,disabled:{draggable:!1,droppable:!1}});function id(t){let{children:n,id:o,items:r,strategy:a=nd,disabled:i=!1}=t;const{active:c,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:h}=tI(),f=jr(rd,o),m=l.rect!==null,g=y.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),I=c!=null,p=c?g.indexOf(c.id):-1,C=d?g.indexOf(d.id):-1,b=y.useRef(g),S=!iI(g,b.current),x=C!==-1&&p===-1||S,T=sI(i);Rn(()=>{S&&I&&h(g)},[S,g,I,h]),y.useEffect(()=>{b.current=g},[g]);const _=y.useMemo(()=>({activeIndex:p,containerId:f,disabled:T,disableTransforms:x,items:g,overIndex:C,useDragOverlay:m,sortedRects:aI(g,u),strategy:a}),[p,f,T.draggable,T.droppable,x,g,C,u,m,a]);return y.createElement(ad.Provider,{value:_},n)}const lI=t=>{let{id:n,items:o,activeIndex:r,overIndex:a}=t;return td(o,r,a).indexOf(n)},uI=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},dI={duration:200,easing:"ease"},sd="transform",hI=Ho.Transition.toString({property:sd,duration:0,easing:"linear"}),fI={roleDescription:"sortable"};function pI(t){let{disabled:n,index:o,node:r,rect:a}=t;const[i,c]=y.useState(null),l=y.useRef(o);return Rn(()=>{if(!n&&o!==l.current&&r.current){const u=a.current;if(u){const d=Go(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 cd(t){let{animateLayoutChanges:n=uI,attributes:o,disabled:r,data:a,getNewIndex:i=lI,id:c,strategy:l,resizeObserverConfig:u,transition:d=dI}=t;const{items:h,containerId:f,activeIndex:m,disabled:g,disableTransforms:I,sortedRects:p,overIndex:C,useDragOverlay:b,strategy:S}=y.useContext(ad),x=mI(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:L,isOver:N,setNodeRef:M}=rI({id:c,data:_,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...u}}),{active:q,activatorEvent:j,activeNodeRect:Z,attributes:H,setNodeRef:ce,listeners:he,isDragging:me,over:Ce,setActivatorNodeRef:ye,transform:$}=eI({id:c,data:_,attributes:{...fI,...o},disabled:x.draggable}),Y=j5(M,ce),ne=!!q,oe=ne&&!I&&Kr(m)&&Kr(C),O=!b&&me,X=O&&oe?$:null,ie=oe?X??(l??S)({rects:p,activeNodeRect:Z,activeIndex:m,overIndex:C,index:T}):null,ue=Kr(m)&&Kr(C)?i({id:c,items:h,activeIndex:m,overIndex:C}):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=pI({disabled:!V,index:T,node:L,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:L,overIndex:C,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 hI;if(!(O&&!Ms(j)||!d)&&(ne||V))return Ho.Transition.toString({...d,property:sd})}}function mI(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 gI({product:t,children:n}){const{attributes:o,listeners:r,setNodeRef:a,transform:i,transition:c,isDragging:l}=cd({id:t.id}),u={transform:Ho.Transform.toString(i),transition:c};return s.jsx("div",{ref:a,style:u,className:`${tt.product} ${l?tt.dragging:""}`,...o,...r,children:n})}const ld=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:I="",itemsOptions:p,hasRangeSelector:C=!1,rangeSelectorOptions:b,modalOptions:S,addableOptions:x={},limit:T,autoInterval:_,tip:D,aspectRatio:v,setAspectRatio:L}=t,[N,M]=y.useState(null),[q,j]=y.useState({top:0,left:0}),[Z,H]=y.useState(null),ce=y.useRef(null),[he,me]=y.useState(!1),Ce=Hu(Ou(za,{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&&Z){const O=ce.current.getBoundingClientRect().height,X=window.innerHeight;let K=Z.top;K+O>X+window.scrollY-200&&(K=X+window.scrollY-O-200),K<0&&(K=10),j({top:K-30,left:Z.left})}},[ce.current,Z]);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(G,{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(G,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),g==="select"&&p&&s.jsx(ro,{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(ws,{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(ln,{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:I}),g==="image"&&s.jsx(Nr,{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:tt.buttons,children:[T&&T>r.length&&m&&s.jsx("div",{className:tt.deleteButton,children:s.jsx(G,{name:"Copy",hoverable:!0,width:20,height:20,onClick:()=>{$(O,X)}})}),u&&s.jsx("div",{className:tt.deleteButton,children:s.jsx(G,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:z=>{ye(z,O)}})}),f&&s.jsx("div",{className:tt.deleteButton,children:s.jsx(G,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>a(r.filter(z=>z.id!==O.id))})})]})]});return d?s.jsx(gI,{product:O,index:X,children:K},O.id):s.jsx("div",{className:tt.product,children:K},O.id)};return s.jsxs("div",{className:tt.productsBlock,children:[(c||n!==void 0)&&s.jsxs("div",{className:tt.top,children:[c&&s.jsx("h3",{className:tt.title,children:c}),n!==void 0&&s.jsx(Nn,{current:n,onChange:O=>o==null?void 0:o(O)})]}),N&&u&&S&&he&&s.jsx(M5,{ref:ce,activeItem:N,setActiveItem:M,popupPosition:q,modalOptions:S,setIsOpenModal:me}),(n===void 0||n)&&C&&b&&s.jsx(ud,{...b}),(n===void 0||n)&&s.jsxs("div",{className:tt.products,children:[l&&s.jsx("h5",{className:tt.subtitle,children:l}),d?s.jsx(ed,{sensors:Ce,onDragEnd:ne,children:s.jsx(id,{items:r.map(O=>O.id),strategy:od,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(Oo,{withoutHover:!0,className:te(tt.button,{[tt.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:ze(),...x}):O.push({name:{"en-US":`Image ${r.length+1}`},id:ze(),...x}),a(O)},style:{width:"fit-content"},children:s.jsxs("div",{className:tt.addButton,children:[s.jsx("span",{children:"Add Option"}),s.jsx(G,{name:"Plus",width:16,height:16})]})})})]}),v&&L&&s.jsx(ro,{value:v,label:"Aspect Ratio",options:Object.keys(Zl),onChange:O=>L(O),leftAddonOptions:Gl}),(n===void 0||n)&&i!==void 0&&s.jsx(Nu,{otherTitle:"Other",items:i}),(n===void 0||n)&&_!==void 0&&s.jsx(ln,{label:_.title||"Auto scroll interval",type:"number",value:String(_.autoInterval),onChange:O=>_.setAutoInterval(Number(O)),min:.1,max:100,style:{width:"100%"},postfix:"sec."})]})},II="_title_cx65i_1",CI="_subtitle_cx65i_5",SI="_productsBlock_cx65i_14",yI="_top_cx65i_26",vI="_products_cx65i_14",bI="_product_cx65i_14",wI="_button_cx65i_80",xI="_disabled_cx65i_91",_I="_buttons_cx65i_118",TI="_modal_cx65i_125",kI="_link_cx65i_146",LI="_modalOptions_cx65i_152",AI="_addButton_cx65i_165",PI="_deleteButton_cx65i_180",EI="_closeIcon_cx65i_192",po={title:II,subtitle:CI,productsBlock:SI,top:yI,products:vI,product:bI,button:wI,disabled:xI,buttons:_I,modal:TI,link:kI,modalOptions:LI,addButton:AI,deleteButton:PI,closeIcon:EI},RI=y.forwardRef((t,n)=>{const{activeItem:o,setActiveItem:r,popupPosition:a,modalOptions:i,setIsOpenModal:c}=t;return Uo(n,()=>{r(null),c(!1)}),s.jsxs("div",{ref:n,className:po.modal,onClick:l=>{l.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[s.jsxs("div",{className:po.top,children:[s.jsx("h3",{className:po.title,children:o.name["en-US"]}),s.jsx("div",{className:po.closeIcon,children:s.jsx(G,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{r(null),c(!1)}})})]}),s.jsx("div",{className:po.modalOptions,children:i.map(l=>{if(l.type==="image")return s.jsx(Nr,{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(Ps,{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(ln,{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(ln,{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:po.link,children:[s.jsx(ln,{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(Nn,{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(ro,{options:l.itemsOptions,onChange:u=>{const d={...o,[l.field]:u};r(d)},label:l.label,value:o[l.field]||"String",leftAddonOptions:l.leftAddonOptions})})})]})}),DI="_title_hvj8m_1",MI="_buttonsBlock_hvj8m_15",NI="_top_hvj8m_26",BI="_modal_hvj8m_120",FI="_options_hvj8m_146",jI="_closeIcon_hvj8m_154",Bo={title:DI,buttonsBlock:MI,top:NI,modal:BI,options:FI,closeIcon:jI},OI=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||""),[I,p]=y.useState(o.text||{"en-US":""}),[C,b]=y.useState(o.openInNewTab),{pages:S}=Gn();return Uo(n,()=>{r(null)}),y.useEffect(()=>{r({...o,...{text:I,link:m,destination:u,typesText:c,page:h,openInNewTab:C}})},[c,u,m,I,h,C]),s.jsxs("div",{className:Bo.modal,onClick:T=>{T.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},ref:n,children:[s.jsxs("div",{className:Bo.top,children:[s.jsx("h3",{className:Bo.title,children:o.type}),s.jsx("div",{className:Bo.closeIcon,children:s.jsx(G,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>r(null)})})]}),s.jsxs("div",{className:Bo.options,children:[i&&s.jsx(ro,{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(ro,{label:"Go to",onChange:T=>{if(T==="Sign In")f("/customer-dash");else if(S){for(const _ in S)if(S[_].name===T){f(S[_].path);break}}else f(ql[0])},options:S?[...Object.values(S).filter(T=>T.path!==h).map(T=>T.name),"Sign In"]:["Sign In"],value:S?h==="/customer-dash"?"Sign In":((x=Object.values(S).find(T=>T.path===h))==null?void 0:x.name)||"Home":"Home"}):s.jsx(ln,{onChange:T=>g(T),value:m,placeholder:"https://",label:"Link"})),i&&s.jsx(Nn,{current:o.openInNewTab,label:"Open in new tab",onChange:T=>b(T)}),s.jsx(Ls,{onChange:T=>p({"en-US":T}),value:I["en-US"],label:"Text"}),s.jsx(ks,{typesText:c,setTypesText:l})]})]})}),HI="_wrapper_m18qi_1",VI="_subtitle_m18qi_7",UI="_content_m18qi_14",$I="_range_m18qi_22",WI="_track_m18qi_27",qI="_progress_m18qi_36",ZI="_dots_m18qi_46",GI="_dot_m18qi_46",zI="_active_m18qi_65",YI="_input_m18qi_77",XI="_countBlock_m18qi_91",KI="_controls_m18qi_107",JI="_button_m18qi_113",Et={wrapper:HI,subtitle:VI,content:UI,range:$I,track:WI,progress:qI,dots:ZI,dot:GI,active:zI,input:YI,countBlock:XI,controls:KI,button:JI},ud=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=I=>{const p=o+I*a;c(p)};return s.jsxs("div",{className:Et.wrapper,children:[n&&s.jsx("h5",{className:Et.subtitle,children:n}),s.jsxs("div",{className:Et.content,children:[s.jsxs("div",{className:Et.range,children:[s.jsx("div",{className:Et.track}),s.jsx("div",{className:Et.progress,style:{width:`${h}%`}}),s.jsx("div",{className:Et.dots,children:d.map((I,p)=>{const C=p<=(i-o)/a;return s.jsx("button",{onClick:()=>g(p),className:te(Et.dot,{[Et.active]:C,[Et.inactive]:!C,[Et.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:I=>c(Number(I.target.value)),onMouseDown:()=>u(!0),onMouseUp:()=>u(!1),onTouchStart:()=>u(!0),onTouchEnd:()=>u(!1),className:Et.input})]}),s.jsxs("div",{className:Et.countBlock,children:[s.jsx(ln,{type:"number",min:o,max:r,paddingless:!0,onChange:I=>{const p=Number(I);p>r?c(r):p<o?c(o):c(p)},value:String(i)}),s.jsxs("div",{className:Et.controls,children:[s.jsx("button",{onClick:f,disabled:i>=r,className:Et.button,"aria-label":"Increment count",children:s.jsx(G,{name:"CaretUp",width:15,height:15})}),s.jsx("button",{onClick:m,disabled:i<=o,className:Et.button,"aria-label":"Decrement count",children:s.jsx(G,{name:"CaretDown",width:15,height:15})})]})]})]})]})},QI="_title_11jyy_1",e4="_subtitle_11jyy_5",t4="_productsBlock_11jyy_14",n4="_top_11jyy_26",o4="_products_11jyy_14",r4="_product_11jyy_14",a4="_button_11jyy_80",i4="_buttons_11jyy_114",s4="_modal_11jyy_121",c4="_modalOptions_11jyy_148",l4="_addButton_11jyy_161",u4="_deleteButton_11jyy_176",d4="_closeIcon_11jyy_188",fr={title:QI,subtitle:e4,productsBlock:t4,top:n4,products:o4,product:r4,button:a4,buttons:i4,modal:s4,modalOptions:c4,addButton:l4,deleteButton:u4,closeIcon:d4},dd=({render:t,block:n})=>t(n),hd=({settings:t,pageContext:n})=>{const{footer:o}=Wn(),{settings:r}=Er(),{pageContext:a}=Gn(),{footer:i}=wo();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)},fd=({settings:t,pageContext:n})=>{const{header:o}=Wn(),{settings:r}=Er(),{pageContext:a}=Gn(),{header:i}=wo();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)},pd=({settings:t,pageContext:n})=>{const{announcement:o}=Wn(),{settings:r}=Er(),{pageContext:a}=Gn(),{announcement:i}=wo();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)},h4=async t=>{var c,l;const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,r=Mn.getState(),a=localStorage.getItem("shopPassword");if((c=r.general)!=null&&c.info.passwordProtected&&!a)return null;const i=`${n.storeApi}/v2/shops/${o}/pages/${t}`+((l=r.general)!=null&&l.info.passwordProtected?`?password=${a}`:"");try{return await je({url:i,withToken:!0,method:"get"})}catch(u){if(He.isAxiosError(u)&&u.response&&u.response.status===404)return null}},f4="_wrapper_5w9s8_1",p4={wrapper:f4},ns=t=>{const{error:n}=t;return s.jsx("div",{className:p4.wrapper,children:n})},m4=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.slApi}/v1/balance/top-up/${o}`;return await je({url:r,method:"post",body:t,withToken:!1})},zo=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.customersApi}/v2/${o}/customers/${t}`;return await je({url:r,withToken:!0,method:"get",typeToken:"customer"})},g4=()=>zo("dash/info"),I4=()=>zo("dash/dashboard/home"),C4=()=>zo("rewards"),S4=()=>zo("balance"),y4=()=>zo("balance/top-up/settings"),v4=()=>zo("referral-system"),os=10,Ka=async({url:t,PageNumber:n})=>{var l;const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.customersApi}/v2/${r}/${t}?PageNumber=${n}&PageSize=${os}`,i=await je({url:a,withToken:!0,method:"get",typeToken:"customer"}),c=Number((l=i.headers)==null?void 0:l["x-pagination-total"]);return{list:i.data,totalCount:c}},js=async(t,n="get",o)=>{const r=Xe.getState().apiUrls,a=ut?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${r.slApi}/v1/orders/${a}/${t}`;return await je({url:i,method:n,withToken:!0,body:o,typeToken:"customer"})},b4=t=>js("","post",t),w4=({PageNumber:t})=>Ka({url:"customers/orders",PageNumber:t}),x4=t=>js(t),_4=t=>js(t),T4=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.slApi}/v1/${o}/subscriptions`;return await je({url:r,method:"post",withToken:!1,body:t})},k4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v2/${r}/subscriptions/${t}/${n}`;return await je({url:a,method:"get",withToken:!1})},L4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v1/${r}/subscriptions/${t}/${n}/upgrades`;return await je({url:a,method:"get",withToken:!1})},A4=async(t,n,o)=>{const r=Xe.getState().apiUrls,a=ut?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${r.slApi}/v1/${a}/subscriptions/${t}/${n}/cancel`;return await je({url:i,method:"post",withToken:!1,body:o})},P4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v2/${r}/subscriptions/${t}/change-gateway`;return await je({url:a,method:"post",withToken:!1,body:{gateway:n}})},E4=({PageNumber:t})=>Ka({url:"customers/subscriptions",PageNumber:t}),R4=async({id:t,accessToken:n})=>await L4(t,n),D4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v2/${r}/subscriptions/${t}/order`;return await je({url:a,method:"post",withToken:!1,body:n})},M4=async(t,n)=>{const o=Xe.getState().apiUrls,r=ut?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${o.slApi}/v1/public/${r}/tickets/${t}/${n}`;return await je({url:a,method:"get",withToken:!1})},N4=async(t,n,o,r,a)=>{const i=Xe.getState().apiUrls,c=ut?localStorage.getItem("fakeDomain"):window.location.hostname,l=`${i.slApi}/v1/public/${c}/tickets/${t}/${n}/answer`;return(await je({url:l,method:"post",body:{message:o,recaptcha:r,tsId:a},withToken:!1})).data},B4=({PageNumber:t})=>Ka({url:"customers/tickets",PageNumber:t}),F4=({PageNumber:t})=>Ka({url:"customers/balance/transactions",PageNumber:t}),md=async t=>{const n=Xe.getState().apiUrls,o=t.map(c=>["names",c]),r=new URLSearchParams(o),a=ut?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${n.slApi}/v2/gateways?shopDomain=${a}&${r.toString()}`;return await je({url:i,method:"get",withToken:!1})},j4=async({email:t,recaptcha:n,tsId:o})=>{const r=Xe.getState().apiUrls,a=ut?localStorage.getItem("fakeDomain"):window.location.hostname,i=`${r.customersApi}/v2/${a}/auth/otp/request`;return(await je({url:i,body:{email:t,recaptcha:n,tsId:o},method:"post",withToken:!1})).data?{requested:!0,email:t}:{requested:!1,email:void 0}},O4=async({email:t,otp:n,recaptcha:o,tsId:r})=>{const a=Xe.getState().apiUrls,i=ut?localStorage.getItem("fakeDomain"):window.location.hostname,c=`${a.customersApi}/v2/${i}/auth/otp/login`,{data:l}=await je({url:c,method:"post",body:{email:t,otp:n,recaptcha:o,tsId:r},withToken:!1});return ko.getState().setToken(l.data),localStorage.setItem("token",l.data),{token:l.data,requested:!1}},H4=async()=>{ko.getState().setToken(""),localStorage.removeItem("token")},V4=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.slApi}/v2/coupons/${o}/validate`;return await je({url:r,method:"post",body:t,withToken:!1})},U4=async t=>{const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.customersApi}/v2/${o}/customers/referral-system/signup`;return(await je({url:r,withToken:!0,method:"post",body:t,typeToken:"customer"})).data},$4=async()=>{const{data:t}=await v4();return t},W4=async t=>{const{data:n}=await U4(t);return n};async function q4(t){const n=Xe.getState().apiUrls,o=ut?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${n.customersApi}/v2/${o}/customers/rewards/${t.id}/claim`;return je({url:r,method:"post",withToken:!0,typeToken:"customer"})}const vi="Balance",Z4={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},G4={recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},al=(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=$n.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},z4=(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}=$n.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),Y4=(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})}),il=t=>new Set(t.gateways.map(n=>n.name)),sl={availableGateways:[],requiresSignInGateways:[]},cl=(t,n)=>{var i;if(n.length===0)return sl;const o=(i=n[0])==null?void 0:i.variants[0];if(!o)return sl;const r=il(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=il(u);for(const h of r)d.has(h)||r.delete(h)}return!localStorage.getItem("token")&&r.has(vi)?(r.delete(vi),{availableGateways:[...r],requiresSignInGateways:[vi]}):{availableGateways:[...r],requiresSignInGateways:[]}},X4=(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:""}))},K4=(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},J4=()=>{const{cart:t,products:n,coupon:o,pending:r,applyCouponPending:a,customerEmail:i,setCart:c,setProducts:l,setCoupon:u,setPending:d,setApplyCouponPending:h}=$n(),f=async p=>{var v;h(!0);const{cart:C}=$n.getState(),{gateway:b,parts:S}=C,{notifications:x,setNotifications:T}=Dt.getState();b||(h(!1),T([...x,{message:"There should be a gateway for the coupon",status:"error",id:ze()}]));const _=S.map(L=>L.productId);let D=null;try{const{data:L}=await V4({gateway:b,couponName:p,productIds:_});D=L.data,T([...x,{message:"Coupon is applied",status:"success",id:ze()}]),c(N=>({...N,coupon:p}))}catch(L){const N=L;T([...x,{message:`Coupon is not applied: ${N.message}`,status:"error",id:ze()}]),c(M=>({...M,coupon:null})),u(null),h(!1)}if(h(!1),(v=D==null?void 0:D.restrictToProductIds)!=null&&v.length&&!_.every(L=>{var N;return(N=D==null?void 0:D.restrictToProductIds)==null?void 0:N.includes(L)}))throw new Error("Coupon can't be applied to such products");return u(D),D},I={reset(){c({...G4})},addProducts:p=>{const C=$n.getState().products,b=p.filter(S=>!C.some(x=>x.id===S.id));l([...C,...b])},addProductToCart:p=>{const C=$n.getState().cart;try{al(n,p)}catch(S){throw new Error(S)}const b=C.parts.find(S=>S.productId===p.productId&&S.productVariantId===p.productVariantId&&S.chargeType===p.chargeType);if(b)return I.updateQuantityOfProduct({...b,quantity:(b.quantity||1)+(p.quantity||1),chargeType:p.chargeType});if(C.parts.length&&!cl([...C.parts,p],n).availableGateways.length)throw new Error("No common payment gateways available");c({...C,parts:[...C.parts,p]})},removeProduct({productId:p,productVariantId:C}){c(b=>({...b,parts:b.parts.filter(S=>S.productId!==p||S.productVariantId!==C)}))},getPossibleGateways(){return cl(t.parts,n)},removeCoupon(){u(null)},getDiscordSettings(){return Y4(n,t.parts)},updateQuantityOfProduct(p){al(n,p),c(C=>({...C,parts:C.parts.map(b=>b.productId===p.productId&&b.productVariantId===p.productVariantId?{...b,quantity:p.quantity,chargeType:p.chargeType}:b)}))},getTotalAndDiscount(){const{coupon:p}=$n.getState(),C=z4(t.parts,n);let b;return p&&p.discount&&(!p.isFixed&&p.discount===100?b=0:b=p.isFixed?Math.max(0,C-p.discount):C*(1-p.discount/100)),{total:C,totalWithDiscount:b}},setGateway(p){c(C=>({...C,gateway:p})),t.coupon&&f(t.coupon)},setPaymentMethod(p){c(C=>({...C,paymentMethod:p}))},async submitCart(p){d(!0);const{cart:C}=$n.getState(),{discordInfo:b}=Eu.getState();let S;if(C.parts&&i&&K4(C.parts[0],n))try{const{data:x}=await T4({...C,partOrder:C.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:b!=null&&b.authorized?b.id:null,customerEmail:i,recaptcha:p,customFields:{...C.customFields},tsId:ao()});S=x.data}catch(x){console.error(x)}else try{const{data:x}=await b4({...C,referralCode:localStorage.getItem("referralCode"),recaptcha:p,customFields:{...C.customFields},tsId:ao(),discordSocialConnectId:b!=null&&b.authorized?b.id:null});S=x.data}catch(x){const{notifications:T,setNotifications:_}=Dt.getState();_([...T,{message:`Failed to create order: ${x}`,status:"error",id:ze()}])}if(d(!1),S)return S;throw new Error("Failed to create order")},setDiscordSocialConnectId(p){c(C=>({...C,discordSocialConnectId:p}))},setCustomFields(p){c(C=>({...C,customFields:{...p}}))}};return y.useEffect(()=>{c(p=>({...p,customerEmail:i??""}))},[i,c]),{cart:t,products:n,coupon:o,pending:r,applyCouponPending:a,applyCoupon:f,...I}},Ja=()=>{const{notifications:t,setNotifications:n}=Dt();return o=>{navigator.clipboard.writeText(o),n([...t,{status:"success",message:"Successfully copied",id:ze()}])}};function gd(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 Q4=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 Uo(n,()=>{r(null),i(!1)}),l?s.jsxs("div",{className:fr.modal,onClick:u=>{u.stopPropagation()},style:{top:`${a.top}px`,left:`${a.left}px`},children:[s.jsxs("div",{className:fr.top,children:[s.jsx("h3",{dangerouslySetInnerHTML:{__html:gd(l.productData.name)}}),s.jsx("div",{className:fr.closeIcon,children:s.jsx(G,{name:"X",height:20,width:20,onClick:()=>{i(!1),r(null)}})})]}),s.jsx("div",{className:fr.modalOptions,children:s.jsx(Nr,{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}),e3="_wrapper_ipyfg_1",t3="_label_ipyfg_9",n3="_input_ipyfg_18",o3="_disabled_ipyfg_31",r3="_paddingless_ipyfg_36",a3="_content_ipyfg_47",i3="_contentBorder_ipyfg_60",s3="_contentField_ipyfg_65",c3="_contentIsAntistock_ipyfg_69",l3="_borderless_ipyfg_74",u3="_rightIcon_ipyfg_79",d3="_leftIcon_ipyfg_87",h3="_requiredStar_ipyfg_94",Ot={wrapper:e3,label:t3,input:n3,disabled:o3,paddingless:r3,content:a3,contentBorder:i3,contentField:s3,contentIsAntistock:c3,borderless:l3,rightIcon:u3,leftIcon:d3,requiredStar:h3},To=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:I=!1,isSearch:p=!1,centered:C=!1,maxSymbols:b,rightIcon:S,onFocus:x,leftIcon:T}=t,{themeSettings:_}=xo(),{isAntistock:D}=Mn(),{inputs:v}=_,[L,N]=y.useState(!1);function M(j){if(Number(j)<0)return String(c);const Z=j.replace(/[^\d-]/g,"");return Number(Z)<0?String(c):Z}function q(j){return!h||!f?!0:new RegExp(f).test(j)}return s.jsxs("div",{className:Ot.wrapper,children:[r&&s.jsxs("label",{className:Ot.label,htmlFor:r,style:{color:D?"var(--text-secondary)":void 0},children:[r,h&&s.jsx("span",{className:Ot.requiredStar,children:"*"})]}),s.jsxs("div",{className:te(Ot.content,{[Ot.contentBorder]:!D&&v.border.active,[Ot.contentField]:v.field.active,[Ot.disabled]:d,[Ot.contentIsAntistock]:D}),style:{...o},children:[T&&s.jsx("div",{className:Ot.leftIcon,children:T}),s.jsx("input",{maxLength:b,id:r,type:i||"text",onChange:j=>{if(i==="text")n(j.target.value);else{const Z=M(j.target.value);n(Z)}},value:a,autoComplete:"off",placeholder:u||"Type something...",className:te(Ot.input,{[Ot.required]:L&&h&&!q(a),[Ot.paddingless]:m,[Ot.borderless]:g}),min:i==="number"?c:void 0,max:i==="number"?l:void 0,onFocus:()=>{x&&x(),N(!0)},disabled:d,style:{textAlign:C?"center":"left",padding:p?`7px ${Number(v.general.size)+20}px 7px ${T?35:11}px`:`7px ${S?35:11}px 7px ${T?35:11}px`}}),S&&s.jsx("div",{className:Ot.rightIcon,children:S}),p&&s.jsx("div",{className:Ot.rightIcon,children:s.jsx(G,{name:"MagnifyingGlass",fill:"var(--text-secondary)",width:v.general.size,height:v.general.size})}),I&&s.jsx("div",{children:s.jsx(G,{name:"Sliders",width:20,height:20,hoverable:!0})})]})]})},f3="_button_o1xdh_1",p3="_primary_o1xdh_20",m3="_primaryHovered_o1xdh_30",g3="_secondary_o1xdh_35",I3="_secondaryHovered_o1xdh_45",C3="_tertiary_o1xdh_50",S3="_special_o1xdh_60",y3="_tertiaryHovered_o1xdh_64",v3="_content_o1xdh_69",b3="_isAntistock_o1xdh_77",Tn={button:f3,primary:p3,primaryHovered:m3,secondary:g3,secondaryHovered:I3,tertiary:C3,special:S3,tertiaryHovered:y3,content:v3,isAntistock:b3},w3=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,Id=({children:t,className:n,as:o="span",...r})=>{const[a,i]=y.useState(!1);return y.useEffect(()=>{typeof window<"u"&&i(w3())},[]),a?s.jsx(o,{className:n,...r,"data-stable-text":t,dangerouslySetInnerHTML:{__html:""}}):s.jsx(o,{className:n,...r,children:t})},lt=t=>{const{children:n,onClick:o,style:r,className:a,disabled:i=!1,type:c="Primary",dangerouslySetInnerHTML:l}=t,{themeSettings:u}=xo(),{isAntistock:d}=Mn(),h=p=>typeof p=="string"?s.jsx(Id,{children:p}):p,f={onClick:o,disabled:i,style:r,className:te(Tn.button,a,{[Tn.primary]:c==="Primary",[Tn.secondary]:c==="Secondary",[Tn.tertiary]:c==="Tertiary",[Tn.primaryHovered]:c==="Primary"&&!i&&u.buttons.primary.hover,[Tn.secondaryHovered]:c==="Secondary"&&!i&&u.buttons.secondary.hover,[Tn.tertiaryHovered]:c==="Tertiary"&&!i&&u.buttons.tertiary.hover,[Tn.isAntistock]:d})};if(c==="Special")return s.jsx("button",{...f,className:Tn.special,...l?{dangerouslySetInnerHTML:l}:{children:h(n)}});const m=c.toLowerCase(),g=u.buttons[m],I=c==="Tertiary"?s.jsxs("div",{className:Tn.content,children:[h(n),s.jsx(G,{name:"ArrowRight",fill:"var(--text-tertiary)",width:20,height:20})]}):h(n);return s.jsx("button",{...f,style:{...r,textAlign:g.alignment},...l?{dangerouslySetInnerHTML:l}:{children:I}})},x3="_modal_1iz94_1",_3="_padding_1iz94_17",T3="_content_1iz94_21",k3="_close_1iz94_42",Qr={modal:x3,padding:_3,content:T3,close:k3},Qa=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)}},[]),Co.createPortal(s.jsx("div",{className:te(Qr.modal,{[Qr.padding]:a}),onClick:l,children:r?s.jsx("div",{className:te(Qr.content,{[Qr.close]:!i}),children:o}):s.jsx(s.Fragment,{children:o})}),document.body)},Cd=({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=Dn(),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})},L3="_loader_3je9m_1",A3={loader:L3},dn=t=>s.jsx("div",{className:A3.loader,...t}),P3="_container_6vcrl_1",E3="_wrapper_6vcrl_5",ll={container:P3,wrapper:E3};class R3{constructor(){Jo(this,"observer",null);Jo(this,"callbacks",new Map);Jo(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 ul=new R3;function Sd(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)};ul.observe(r,i);const c=r.getBoundingClientRect().width;return i(c),()=>{ul.unobserve(r,i)}},[t]),n}const ea=16,yd=({children:t,padding:n,style:o,notPadding:r=!1})=>{const a=y.useRef(null),i=Sd(a);return s.jsx("div",{className:ll.container,ref:a,style:o,children:s.jsx("div",{className:ll.wrapper,style:{maxWidth:"var(--max-width-store)",paddingTop:i==="desktop"?n==null?void 0:n.top:r?0:ea,paddingBottom:i==="desktop"?n==null?void 0:n.bottom:r?0:ea,paddingLeft:i==="desktop"?n==null?void 0:n.left:r?0:ea,paddingRight:i==="desktop"?n==null?void 0:n.right:r?0:ea,...o},children:t(i)})})},D3="_wrapper_oxpf7_1",M3="_label_oxpf7_10",N3="_contentBorder_oxpf7_19",B3="_textarea_oxpf7_23",F3="_contentField_oxpf7_35",j3="_length_oxpf7_49",ho={wrapper:D3,label:M3,contentBorder:N3,textarea:B3,contentField:F3,length:j3},O3=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}=xo();function f(m){return c==="number"?m.replace(/[^\d\n]+/g,""):m}return s.jsxs("div",{className:ho.wrapper,children:[o&&s.jsxs("label",{className:ho.label,htmlFor:o,children:[o,l&&s.jsx("span",{className:ho.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(ho.textarea,{[ho.contentBorder]:h.inputs.border.active,[ho.contentField]:h.inputs.field.active}),maxLength:a}),a&&s.jsxs("div",{className:ho.length,children:[u,"/",a]})]})},H3="_wrapper_ty9h3_2",V3="_label_ty9h3_9",U3="_top_ty9h3_17",$3="_select_ty9h3_23",W3="_borderFocused_ty9h3_42",q3="_input_ty9h3_49",Z3="_icon_ty9h3_59",G3="_rotate_ty9h3_64",z3="_content_ty9h3_68",Y3="_options_ty9h3_72",X3="_filteredOptions_ty9h3_93",K3="_open_ty9h3_97",J3="_option_ty9h3_72",Q3="_focused_ty9h3_115",eC="_addon_ty9h3_119",tC="_value_ty9h3_130",nC="_postfix_ty9h3_135",oC="_leftAddon_ty9h3_139",vt={wrapper:H3,label:V3,top:U3,select:$3,borderFocused:W3,input:q3,icon:Z3,rotate:G3,content:z3,options:Y3,filteredOptions:X3,open:K3,option:J3,focused:Q3,addon:eC,value:tC,postfix:nC,leftAddon:oC};function rC(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 vd=t=>{var L,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,I]=y.useState(null),[p,C]=y.useState(!1),b=y.useRef(null);rC(b,()=>h(!1));function S(M){m(""),n(M),h(!1),I(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(),I(j=>j===null||j===q.length-1?0:j+1)),M.key==="ArrowUp"&&(M.preventDefault(),I(j=>j===null||j===0?q.length-1:j-1)),M.key==="Enter"&&g!==null&&(M.preventDefault(),S(q[g])),M.key==="Escape"&&h(!1)}const _=y.useRef(null),D=y.useMemo(()=>new Yn(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:vt.wrapper,style:{...i},children:[o&&s.jsxs("div",{className:vt.top,children:[s.jsx("label",{className:vt.label,htmlFor:o,children:o}),c&&s.jsx(Nn,{current:c.value,onChange:c.onChange})]}),s.jsxs("label",{className:vt.content,ref:b,children:[s.jsxs("div",{className:te(vt.select,{[vt.borderFocused]:d}),onKeyDown:T,onClick:M=>{M.stopPropagation(),h(q=>!q),C(!1)},ref:_,tabIndex:0,children:[u&&u.length>0&&s.jsx("div",{className:vt.addon,children:(L=u.find(M=>M.value===r))==null?void 0:L.addon}),s.jsx("div",{className:vt.input,id:"md",children:x(r,15)}),s.jsx("div",{className:te(vt.icon,{[vt.rotate]:d}),onClick:M=>{M.stopPropagation(),h(q=>!q)},children:s.jsx(G,{name:"CaretDown",width:16,height:16,fill:"var(--text-primary)"})})]}),s.jsxs("div",{className:te(vt.options,{[vt.open]:d}),style:{top:((N=_.current)==null?void 0:N.clientHeight)+10},children:[a.length>6&&s.jsx(To,{type:"text",value:f,placeholder:"Search...",onChange:M=>{m(M),C(!0)},isSearch:!0}),s.jsxs("div",{className:vt.filteredOptions,children:[v.map((M,q)=>{var j;return s.jsxs("div",{className:te(vt.option,{[vt.focused]:q===g}),onClick:()=>{S(M),h(!1)},id:"md",children:[u&&u.length>0&&s.jsx("div",{className:vt.leftAddon,children:(j=u.find(Z=>Z.value===M))==null?void 0:j.addon}),s.jsx("span",{className:vt.value,id:"md",children:x(M,20)}),l&&s.jsx("span",{className:vt.postfix,id:"md",children:l[q]})]},M)}),v.length===0&&s.jsx("div",{children:"No results found."})]})]})]})]})},aC="_wrapper_2vleg_1",iC="_label_2vleg_9",sC="_options_2vleg_17",cC="_radioLabel_2vleg_23",lC="_radio_2vleg_23",uC="_custom_2vleg_38",dC="_option_2vleg_17",fo={wrapper:aC,label:iC,options:sC,radioLabel:cC,radio:lC,custom:uC,option:dC},hC=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:fo.wrapper,children:[s.jsx("span",{className:fo.label,children:a}),s.jsx("div",{className:fo.options,style:{flexDirection:i},children:o.map(d=>s.jsxs("label",{className:fo.radioLabel,children:[s.jsx("input",{type:"radio",value:d.value,checked:c===d.value,onChange:u,className:fo.radio}),s.jsx("span",{className:fo.custom}),s.jsx("span",{className:fo.option,children:d.label})]},d.value))})]})},fC="_content_eonwv_1",pC="_main_eonwv_12",mC="_block_eonwv_16",gC="_active_eonwv_22",IC="_name_eonwv_32",CC="_addSection_eonwv_109",SC="_addSectionTop_eonwv_117",Kn={content:fC,main:pC,block:mC,active:gC,name:IC,addSection:CC,addSectionTop:SC},yC="_sidebar_xhqpt_1",vC="_content_xhqpt_14",bC="_button_xhqpt_24",wC="_moveButton_xhqpt_40",xC="_deleteButton_xhqpt_49",kn={sidebar:yC,content:vC,button:bC,moveButton:wC,deleteButton:xC},_C=()=>{var _;const{activeBlock:t,setActiveBlock:n}=Ha(),{blocks:o,removeBlock:r,moveBlock:a,duplicateBlock:i,setCurrentBlock:c}=Wn(),{currentPage:l,pages:u}=Gn(),{setTitle:d,setDescription:h,setOnConfirm:f}=Yl(),{setActiveBlock:m}=wo(),g=(_=u==null?void 0:u[l])==null?void 0:_.path,I=g?o[g]:null,p=(I==null?void 0:I.order)||[],C=p.indexOf(t.id),b=D=>{D.stopPropagation(),C>0&&g&&(a(g,C,C-1),n({id:t.id,neededScroll:!0}),setTimeout(()=>{n({id:t.id,neededScroll:!1})},100))},S=D=>{D.stopPropagation(),C<p.length-1&&g&&(a(g,C,C+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:kn.sidebar,children:s.jsxs("div",{className:kn.content,children:[s.jsx("button",{onClick:b,className:te(kn.button,kn.moveButton),disabled:C===0,children:s.jsx(G,{name:"ArrowUp"})}),s.jsx("button",{onClick:S,className:te(kn.button,kn.moveButton),disabled:C===p.length-1,children:s.jsx(G,{name:"ArrowDown"})}),s.jsx("button",{onClick:x,className:te(kn.button,kn.moveButton),children:s.jsx(G,{name:"Copy"})}),s.jsx("button",{className:te(kn.button,kn.deleteButton),onClick:D=>{D.stopPropagation(),d("Remove Block"),h(`Are you sure you want to delete ${(I==null?void 0:I.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(G,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})};function pr(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 TC=y.memo(({scrollableRef:t})=>{const{setActiveBlock:n,activeBlock:o,zoomLevel:r}=Ha(),{blocks:a,sourceBlocks:i}=wo(),{blocks:c,setCurrentBlock:l,currentBlock:u,setPositionBlock:d,announcement:h}=Wn(),{settings:f}=Er(),{currentPage:m,pages:g,pageContext:I}=Gn(),{activeBlock:p,setActiveBlock:C}=xo(),{setError:b}=zl(),{setActiveBlock:S}=wo(),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 L=v.offsetTop;t.current.scrollTo({top:L-30,behavior:"smooth"})}}},[o,t]);const _=Dn();y.useEffect(()=>{x.current=o.id},[o.id]);const D=v=>{if(!v||!v.name)return b({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:g&&g[m].id?[g[m].id]:[]}),s.jsx(ns,{error:"Block or block.name is undefined."});if(!a||!a[v.name])return b({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:g&&g[m].id?[g[m].id]:[]}),s.jsx(ns,{error:`Block "${v.name}" does not exist in blocks.`});const L=new a[v.name];return v.value&&Object.assign(L,v.value),L.renderBlock(f,I)};return s.jsxs("div",{onClick:v=>{v.stopPropagation()},className:Kn.content,style:{width:"100%",height:"100%",zoom:`${r}`},ref:t,children:[h&&s.jsx(pd,{}),s.jsx(fd,{}),s.jsx("div",{className:Kn.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:L=>T.current[v]=L,onClick:L=>{L.stopPropagation(),S(null),p&&C(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:L=>{L.stopPropagation(),o.neededScroll||n({id:v,neededScroll:!1})},onMouseLeave:L=>{L.stopPropagation(),o.neededScroll||n({id:null,neededScroll:!1})},className:te(Kn.block),children:[(o.id===v||u===v)&&s.jsx("div",{className:Kn.active}),(o.id===v||u===v)&&s.jsx("div",{className:Kn.name,children:pr(c[g[m].path].data[v].name,i)}),(o.id===v||u===v)&&pr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx(_C,{}),(o.id===v||u===v)&&pr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx("div",{className:Kn.addSection,children:s.jsx(Oo,{onClick:L=>{L.stopPropagation(),d(v,!0),l(null),n({id:null,neededScroll:!1}),S(null),_("/admin/builder/add")},children:"Add Section"})}),(o.id===v||u===v)&&pr(c[g[m].path].data[v].name,i)!=="unknown name"&&s.jsx("div",{className:te(Kn.addSection,Kn.addSectionTop),children:s.jsx(Oo,{onClick:L=>{L.stopPropagation(),d(v,!1),l(null),n({id:null,neededScroll:!1}),S(null),_("/admin/builder/add")},children:"Add Section"})}),a&&s.jsx(dd,{render:D,block:c[g[m].path].data[v]})]},v))}),s.jsx(hd,{})]})}),kC="_statItem_fzeec_1",LC="_content_fzeec_44",AC="_withChildren_fzeec_50",PC="_info_fzeec_56",EC="_iconWrapper_fzeec_68",RC="_text_fzeec_78",DC="_title_fzeec_84",MC="_value_fzeec_88",NC="_emptyImage_fzeec_94",BC="_image_fzeec_11",FC="_imageTitle_fzeec_112",jC="_emptyImageText_fzeec_122",OC="_hoverable_fzeec_147",ft={statItem:kC,content:LC,withChildren:AC,info:PC,iconWrapper:EC,text:RC,title:DC,value:MC,emptyImage:NC,image:BC,imageTitle:FC,emptyImageText:jC,hoverable:OC},rn=({iconName:t,title:n,value:o,image:r,imageName:a,children:i,className:c,logo:l,productSlug:u})=>{const d=Dn();return s.jsxs("div",{className:`${ft.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(ft.image,ft.emptyImage,{[ft.hoverable]:u})})}),s.jsx("div",{className:ft.emptyImageText,children:s.jsx("div",{className:te(ft.title,ft.imageTitle),id:"h5",children:a})})]}),r==="empty"&&s.jsx("div",{style:{background:"#000000"},children:s.jsxs("div",{className:te(ft.emptyImage,{[ft.hoverable]:u}),onClick:()=>{u&&d(`/${u}`)},children:[s.jsx(G,{name:"Image",width:64,height:64,fill:"var(--text-secondary)"}),s.jsx("div",{className:ft.emptyImageText,children:s.jsx("div",{className:ft.title,id:"h5",children:a||"No Product"})})]})}),s.jsxs("div",{className:`${ft.content} ${i?ft.withChildren:""}`,children:[s.jsxs("div",{className:ft.info,children:[l?s.jsx("div",{className:ft.iconWrapper,children:s.jsx("img",{src:l,width:28,height:28,style:{objectFit:"contain"}})}):s.jsx(G,{name:t||"File",className:ft.iconWrapper,width:28,height:28,fill:"var(--text-action)"}),s.jsxs("div",{className:ft.text,children:[s.jsx("div",{className:ft.title,id:"h5",children:n}),s.jsx("div",{className:ft.value,id:"h5-bold",children:o})]})]}),i]})]})},HC="_card_10fve_2",VC="_mobile_10fve_15",UC="_email_10fve_19",$C="_balance_10fve_25",WC="_sidebar_10fve_32",qC="_navList_10fve_56",ZC="_navItem_10fve_71",GC="_activeNavItem_10fve_84",zC="_inactiveNavItem_10fve_89",YC="_logoutNavItem_10fve_98",XC="_iconWrapper_10fve_107",KC="_skeleton_10fve_112",Nt={card:HC,mobile:VC,email:UC,balance:$C,sidebar:WC,navList:qC,navItem:ZC,activeNavItem:GC,inactiveNavItem:zC,logoutNavItem:YC,iconWrapper:XC,skeleton:KC},JC=({email:t,balance:n,adaptiveStyles:o})=>s.jsxs("div",{className:te(Nt.card,{[Nt.mobile]:o!=="desktop"}),children:[s.jsx("div",{className:Nt.email,id:"h5",children:t}),s.jsxs("div",{className:Nt.balance,id:"md",children:["Balance: ",n]})]}),QC=[[ct.Home,"House"],[ct.Orders,"CurrencyCircleDollar"],[ct.Rewards,"Medal"],[ct.Balance,"Wallet"],[ct.Subscriptions,"CalendarCheck"],[ct.Tickets,"Question"]],e6=[[ur.Home,"House"],[ur.Orders,"CurrencyCircleDollar"],[ur.Balance,"Wallet"],[ur.Tickets,"Question"]],dl=({children:t,className:n="",onClick:o})=>s.jsx("button",{type:"button",className:te(Nt.navItem,n),onClick:o,children:t}),t6=({adaptiveStyles:t})=>{const{route:n,setRoute:o}=un(),{isAntistock:r}=Mn(),a=r?e6:QC;return s.jsxs("div",{className:te(Nt.navList,{[Nt.mobile]:t!=="desktop"}),children:[a.map(([i,c])=>{const l=i===n;return s.jsxs(dl,{onClick:()=>o(i),className:te(l?Nt.activeNavItem:Nt.inactiveNavItem),children:[r?null:s.jsx("div",{className:Nt.iconWrapper,children:s.jsx(G,{name:c})}),s.jsx("div",{children:i})]},i)}),s.jsxs(dl,{className:Nt.logoutNavItem,onClick:()=>{H4()},children:[s.jsx("div",{className:Nt.iconWrapper,children:s.jsx(G,{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||{}),Vn=(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))(Vn||{});const Or=async t=>(await md(t)).data,bd=async()=>{var o;const n=(await y4()).data;if(n.isEnabled){const r=(o=n==null?void 0:n.topUpSettings)==null?void 0:o.gateways;r&&Or(r)}return n},Os=async()=>{const n=(await S4()).data;return{amount:n.realBalance+n.manualBalance,currency:n.currency}};var mr=(t=>(t.ADDED="ADDED",t.REMOVED="REMOVED",t))(mr||{}),Fe=(t=>(t.NotPaid="NOT_PAID",t.Pending="PENDING",t.Paid="PAID",t.Expired="EXPIRED",t.Cancelled="CANCELLED",t))(Fe||{}),Lr=(t=>(t.Balance="BALANCE",t.Product="PRODUCT",t))(Lr||{}),tn=(t=>(t.Spend="SPEND_AMOUNT",t.Order="ORDER_COUNT",t.Referral="REFER_FRIEND",t.Review="LEAVE_REVIEW",t))(tn||{});const n6=async()=>(await C4()).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
|
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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./builder.cjs.js"),t=require("./index-DpI09Eg2.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,5 +1,5 @@
|
|
|
1
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-
|
|
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-CzVYT8u-.js";
|
|
3
3
|
export {
|
|
4
4
|
s as App,
|
|
5
5
|
t as Checkout,
|