slicer-studio 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +465 -91
- package/dist/slicer-studio.js +3 -3
- package/package.json +1 -1
package/dist/slicer-studio.js
CHANGED
|
@@ -51,6 +51,6 @@ function zt(e){let t=e+`CollectionProvider`,[n,r]=u(t),[i,a]=n(t);i.displayName=
|
|
|
51
51
|
`},cr=0,lr=[];function ur(e){var t=I.useRef([]),n=I.useRef([0,0]),r=I.useRef(),i=I.useState(cr++)[0],a=I.useState(Mn)[0],o=I.useRef(e);I.useEffect(function(){o.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=cn([e.lockRef.current],(e.shards||[]).map(ar),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=I.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=rr(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Xn(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Xn(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return nr(h,t,e,h===`h`?s:c,!0)},[]),c=I.useCallback(function(e){var n=e;if(lr.length&&lr[lr.length-1]===a){var r=`deltaY`in n?ir(n):rr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&or(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(ar).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=I.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:dr(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=I.useCallback(function(e){n.current=rr(e),r.current=void 0},[]),d=I.useCallback(function(t){l(t.type,ir(t),t.target,s(t,e.lockRef.current))},[]),f=I.useCallback(function(t){l(t.type,rr(t),t.target,s(t,e.lockRef.current))},[]);I.useEffect(function(){return lr.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Gn),document.addEventListener(`touchmove`,c,Gn),document.addEventListener(`touchstart`,u,Gn),function(){lr=lr.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Gn),document.removeEventListener(`touchmove`,c,Gn),document.removeEventListener(`touchstart`,u,Gn)}},[]);var p=e.removeScrollBar,m=e.inert;return I.createElement(I.Fragment,null,m?I.createElement(a,{styles:sr(i)}):null,p?I.createElement(Hn,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var fr=Sn(Cn,ur),pr=I.forwardRef(function(e,t){return I.createElement(Tn,on({},e,{ref:t,sideCar:fr}))});pr.classNames=Tn.classNames;var mr=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},hr=/* @__PURE__ */ new WeakMap,gr=/* @__PURE__ */ new WeakMap,_r={},vr=0,yr=function(e){return e&&(e.host||yr(e.parentNode))},br=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=yr(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},xr=function(e,t,n,r){var i=br(t,Array.isArray(e)?e:[e]);_r[n]||(_r[n]=/* @__PURE__ */ new WeakMap);var a=_r[n],o=[],s=/* @__PURE__ */ new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(hr.get(e)||0)+1,l=(a.get(e)||0)+1;hr.set(e,c),a.set(e,l),o.push(e),c===1&&i&&gr.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),vr++,function(){o.forEach(function(e){var t=hr.get(e)-1,i=a.get(e)-1;hr.set(e,t),a.set(e,i),t||(gr.has(e)||e.removeAttribute(r),gr.delete(e)),i||e.removeAttribute(n)}),vr--,vr||(hr=/* @__PURE__ */ new WeakMap,hr=/* @__PURE__ */ new WeakMap,gr=/* @__PURE__ */ new WeakMap,_r={})}},Sr=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||mr(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),xr(r,i,n,`aria-hidden`)):function(){return null}},Cr=Object.defineProperty,wr=(e,t)=>Cr(e,`name`,{value:t,configurable:!0}),Tr=`Dialog`,[Er,Dr]=u(Tr),[Or,kr]=Er(Tr),Ar=/* @__PURE__ */ wr(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=I.useRef(null),l=I.useRef(null),{nodes:u,registry:d}=g(),[f,p]=c({prop:r,defaultProp:i??!1,onChange:a,caller:Tr}),[m,h]=I.useState(0),[_,v]=I.useState(0);return/* @__PURE__ */ (0,L.jsx)(Or,{scope:t,triggerRef:s,contentRef:l,contentId:F(),titleId:F(),descriptionId:F(),titlePresent:m>0,descriptionPresent:_>0,setTitleCount:h,setDescriptionCount:v,open:f,onOpenChange:p,onOpenToggle:I.useCallback(()=>p(e=>!e),[p]),modal:o,branchNodes:u,branchRegistry:d,children:n})},`Dialog`),jr=`DialogPortal`,[Mr,Nr]=Er(jr,{forceMount:void 0}),Pr=/* @__PURE__ */ wr(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=kr(jr,t);return/* @__PURE__ */ (0,L.jsx)(Mr,{scope:t,forceMount:n,children:I.Children.map(r,e=>/* @__PURE__ */ (0,L.jsx)(m,{present:n||a.open,children:/* @__PURE__ */ (0,L.jsx)(ee,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Fr=`DialogOverlay`,Ir=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ wr(function(e,t){let n=Nr(Fr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=kr(Fr,e.__scopeDialog);return a.modal?/* @__PURE__ */ (0,L.jsx)(m,{present:r||a.open,children:/* @__PURE__ */ (0,L.jsx)(Rr,{...i,ref:t})}):null},`DialogOverlay`)),Lr=s(`DialogOverlay.RemoveScroll`),Rr=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ wr(function(e,t){let{__scopeDialog:n,...r}=e,i=kr(Fr,n),a=re(),o=d(t,a);return/* @__PURE__ */ (0,L.jsx)(pr,{as:Lr,allowPinchZoom:!0,shards:I.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:/* @__PURE__ */ (0,L.jsx)(p.div,{"data-state":Yr(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),zr=`DialogContent`,Br=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ wr(function(e,t){let n=Nr(zr,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=kr(zr,e.__scopeDialog);return/* @__PURE__ */ (0,L.jsx)(m,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,L.jsx)(Vr,{...i,ref:t}):/* @__PURE__ */ (0,L.jsx)(Hr,{...i,ref:t})})},`DialogContent`)),Vr=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ wr(function(e,t){let n=kr(zr,e.__scopeDialog),r=I.useRef(null),i=d(t,n.contentRef,r);return I.useEffect(()=>{let e=r.current;if(e)return Sr(e)},[]),/* @__PURE__ */ (0,L.jsx)(Ur,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:P(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:P(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Hr=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ wr(function(e,t){let n=kr(zr,e.__scopeDialog),r=I.useRef(!1),i=I.useRef(!1);return/* @__PURE__ */ (0,L.jsx)(Ur,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ur=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ wr(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=kr(zr,n);return rn(),/* @__PURE__ */ (0,L.jsx)(C,{registry:l.branchRegistry,children:/* @__PURE__ */ (0,L.jsx)(O,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,L.jsx)(N,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Jr(o,l.descriptionId):o,"data-state":Yr(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Wr=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ wr(function(e,t){let{__scopeDialog:n,...r}=e,i=kr(`DialogTitle`,n),{setTitleCount:a}=i;return h(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,L.jsx)(p.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Gr=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ wr(function(e,t){let{__scopeDialog:n,...r}=e,i=kr(`DialogDescription`,n),{setDescriptionCount:a}=i;return h(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,L.jsx)(p.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Kr=`DialogClose`,qr=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ wr(function(e,t){let{__scopeDialog:n,...r}=e,i=kr(Kr,n);return/* @__PURE__ */ (0,L.jsx)(p.button,{type:`button`,...r,ref:t,onClick:P(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Jr(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}wr(Jr,`concatAriaDescribedby`);function Yr(e){return e?`open`:`closed`}wr(Yr,`getState`);var Xr=Object.defineProperty,Zr=(e,t)=>Xr(e,`name`,{value:t,configurable:!0}),Qr=!1;function $r(){let[e,t]=I.useState(Qr);return I.useEffect(()=>{Qr||(Qr=!0,t(!0))},[]),e}Zr($r,`useIsHydrated`);var ei=I.useSyncExternalStore;function ti(){return()=>{}}Zr(ti,`subscribe`);function ni(){return ei(ti,()=>!0,()=>!1)}Zr(ni,`useIsHydratedModern`);var ri=typeof ei==`function`?ni:$r,ii=Object.defineProperty,ai=(e,t)=>ii(e,`name`,{value:t,configurable:!0});function oi(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var si=`rovingFocusGroup.onEntryFocus`,ci={bubbles:!1,cancelable:!0},li=`RovingFocusGroup`,[ui,di,fi]=/* @__PURE__ */ Nt(li),[pi,mi]=u(li,[fi]),hi={Vertical:`vertical`,Horizontal:`horizontal`},gi={LTR:`ltr`,RTL:`rtl`},[_i,vi]=pi(li),yi=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ ai(function(e,t){return/* @__PURE__ */ (0,L.jsx)(ui.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,L.jsx)(ui.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,L.jsx)(bi,{...e,ref:t})})})},`RovingFocusGroup`)),bi=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ ai(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...m}=e,h=I.useRef(null),g=d(t,h),_=Yt(a),[y,b]=c({prop:o,defaultProp:s??null,onChange:l,caller:li}),[x,S]=I.useState(!1),C=v(u),w=di(n),T=I.useRef(!1),[E,D]=I.useState(0);return I.useEffect(()=>{let e=h.current;if(e)return e.addEventListener(si,C),()=>e.removeEventListener(si,C)},[C]),/* @__PURE__ */ (0,L.jsx)(_i,{scope:n,orientation:r,dir:_,loop:i,currentTabStopId:y,onItemFocus:I.useCallback(e=>b(e),[b]),onItemShiftTab:I.useCallback(()=>S(!0),[]),onFocusableItemAdd:I.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:I.useCallback(()=>D(e=>e-1),[]),children:/* @__PURE__ */ (0,L.jsx)(p.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...m,ref:g,style:{outline:`none`,...e.style},onMouseDown:P(e.onMouseDown,()=>{T.current=!0}),onFocus:P(e.onFocus,e=>{let t=!T.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(si,ci);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);Ei([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),f)}}T.current=!1}),onBlur:P(e.onBlur,()=>S(!1))})})},`RovingFocusGroupImpl`)),xi=`RovingFocusGroupItem`,Si=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ ai(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=F(),l=a||c,u=vi(xi,n),d=u.currentTabStopId===l,f=di(n),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:_}=u,v=ri();return h(()=>{if(v&&r)return m(),()=>g()},[v,r,m,g]),I.useEffect(()=>{if(!v&&r)return m(),()=>g()},[v,r,m,g]),/* @__PURE__ */ (0,L.jsx)(ui.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:/* @__PURE__ */ (0,L.jsx)(p.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:P(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:P(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:P(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ti(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Di(n,r+1):n.slice(r+1)}setTimeout(()=>Ei(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:_!=null}):o})})},`RovingFocusGroupItem`)),Ci={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function wi(e,t){return t===gi.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}ai(wi,`getDirectionAwareKey`);function Ti(e,t,n){let r=wi(e.key,n);if(!(t===hi.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===hi.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ci[r]}ai(Ti,`getFocusIntent`);function Ei(e,t=!1){let n=oi();for(let r of e)if(r===n||(r.focus({preventScroll:t}),oi()!==n))return}ai(Ei,`focusFirst`);function Di(e,t){return e.map((n,r)=>e[(t+r)%e.length])}ai(Di,`wrapArray`);var Oi=Object.defineProperty,U=(e,t)=>Oi(e,`name`,{value:t,configurable:!0});function ki(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var Ai=[`Enter`,` `],ji=[`ArrowDown`,`PageUp`,`Home`],Mi=[`ArrowUp`,`PageDown`,`End`],Ni=[...ji,...Mi];[...Ai],[...Ai];var Pi=`Menu`,[Fi,Ii,Li]=/* @__PURE__ */ Nt(Pi),[Ri,zi]=u(Pi,[Li,b,mi]),Bi=b(),Vi=mi(),[Hi,Ui]=Ri(Pi),[Wi,Gi]=Ri(Pi),Ki=/* @__PURE__ */ U(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Bi(t),[c,l]=I.useState(null),u=I.useRef(!1),d=v(a),f=Yt(i);return I.useEffect(()=>{let e=/* @__PURE__ */ U(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=/* @__PURE__ */ U(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),I.useEffect(()=>{if(!n)return;let e=/* @__PURE__ */ U(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),/* @__PURE__ */ (0,L.jsx)(y,{...s,children:/* @__PURE__ */ (0,L.jsx)(Hi,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:/* @__PURE__ */ (0,L.jsx)(Wi,{scope:t,onClose:I.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),qi=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,...r}=e,i=Bi(n);return/* @__PURE__ */ (0,L.jsx)(D,{...i,...r,ref:t})},`MenuAnchor`)),Ji=`MenuPortal`,[Yi,Xi]=Ri(Ji,{forceMount:void 0}),Zi=/* @__PURE__ */ U(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ui(Ji,t);return/* @__PURE__ */ (0,L.jsx)(Yi,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,L.jsx)(m,{present:n||a.open,children:/* @__PURE__ */ (0,L.jsx)(ee,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Qi=`MenuContent`,[$i,ea]=Ri(Qi),W=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ U(function(e,t){let n=Xi(Qi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ui(Qi,e.__scopeMenu),o=Gi(Qi,e.__scopeMenu);return/* @__PURE__ */ (0,L.jsx)(Fi.Provider,{scope:e.__scopeMenu,children:/* @__PURE__ */ (0,L.jsx)(m,{present:r||a.open,children:/* @__PURE__ */ (0,L.jsx)(Fi.Slot,{scope:e.__scopeMenu,children:o.modal?/* @__PURE__ */ (0,L.jsx)(ta,{...i,ref:t}):/* @__PURE__ */ (0,L.jsx)(na,{...i,ref:t})})})})},`MenuContent`)),ta=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ U(function(e,t){let n=Ui(Qi,e.__scopeMenu),r=I.useRef(null),i=d(t,r);return I.useEffect(()=>{let e=r.current;if(e)return Sr(e)},[]),/* @__PURE__ */ (0,L.jsx)(ia,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:P(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),na=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ U(function(e,t){let n=Ui(Qi,e.__scopeMenu);return/* @__PURE__ */ (0,L.jsx)(ia,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),ra=s(`MenuContent.ScrollLock`),ia=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,..._}=e,v=Ui(Qi,n),y=Gi(Qi,n),b=Bi(n),x=Vi(n),w=Ii(n),[T,E]=I.useState(null),D=I.useRef(null),[k,A]=I.useState(null);S(k);let{nodes:ee,registry:te}=g(),j=!!(i||h),M=d(t,D,v.onContentChange,A),F=I.useRef(0),re=I.useRef(``),ie=I.useRef(0),ae=I.useRef(null),oe=I.useRef(`right`),se=I.useRef(0),ce=I.useMemo(()=>h?[D,...ee.map(e=>({current:e}))]:[],[D,ee,h]),le=h?pr:I.Fragment,ue=h?{as:ra,allowPinchZoom:!0,shards:ce}:void 0,de=/* @__PURE__ */ U(e=>{let t=re.current+e,n=w().filter(e=>!e.disabled),r=ki(),i=n.find(e=>e.ref.current===r)?.textValue,a=ba(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){re.current=e,window.clearTimeout(F.current),e!==``&&(F.current=window.setTimeout(()=>s(``),1e3))}U(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);I.useEffect(()=>()=>window.clearTimeout(F.current),[]),rn();let fe=I.useCallback(e=>oe.current===ae.current?.side&&Sa(e,ae.current?.area),[]);return/* @__PURE__ */ (0,L.jsx)($i,{scope:n,searchRef:re,onItemEnter:I.useCallback(e=>{fe(e)&&e.preventDefault()},[fe]),onItemLeave:I.useCallback(e=>{fe(e)||(D.current?.focus(),E(null))},[fe]),onTriggerLeave:I.useCallback(e=>{fe(e)&&e.preventDefault()},[fe]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:I.useCallback(e=>{ae.current=e},[]),children:/* @__PURE__ */ (0,L.jsx)(C,{registry:j?te:null,children:/* @__PURE__ */ (0,L.jsx)(le,{...ue,children:/* @__PURE__ */ (0,L.jsx)(O,{asChild:!0,trapped:i,branches:ee,onMountAutoFocus:P(a,e=>{e.preventDefault(),D.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:/* @__PURE__ */ (0,L.jsx)(N,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:/* @__PURE__ */ (0,L.jsx)(yi,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:T,onCurrentTabStopIdChange:E,onEntryFocus:P(c,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:/* @__PURE__ */ (0,L.jsx)(ne,{role:`menu`,"aria-orientation":`vertical`,"data-state":ha(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:M,style:{outline:`none`,..._.style},onKeyDown:P(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&de(e.key));let i=D.current;if(e.target!==i||!Ni.includes(e.key))return;e.preventDefault();let a=w().filter(e=>!e.disabled).map(e=>e.ref.current);Mi.includes(e.key)&&a.reverse(),va(a)}),onBlur:P(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(F.current),re.current=``)}),onPointerMove:P(e.onPointerMove,Ca(e=>{let t=e.target,n=se.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>se.current?`right`:`left`;oe.current=t,se.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),aa=`MenuItem`,oa=`menu.itemSelect`,sa=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ U(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=I.useRef(null),o=Gi(aa,e.__scopeMenu),s=ea(aa,e.__scopeMenu),c=d(t,a),l=I.useRef(!1),u=/* @__PURE__ */ U(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(oa,{bubbles:!0,cancelable:!0});e.addEventListener(oa,e=>r?.(e),{once:!0}),E(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return/* @__PURE__ */ (0,L.jsx)(ca,{...i,ref:c,disabled:n,onClick:P(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:P(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:P(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Ai.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),ca=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ U(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=ea(aa,n),s=Vi(n),c=I.useRef(null),l=d(t,c),[u,f]=I.useState(!1),[m,h]=I.useState(``);return I.useEffect(()=>{let e=c.current;e&&h((e.textContent??``).trim())},[a.children]),/* @__PURE__ */ (0,L.jsx)(Fi.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:/* @__PURE__ */ (0,L.jsx)(Si,{asChild:!0,...s,focusable:!r,children:/* @__PURE__ */ (0,L.jsx)(p.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:P(e.onPointerMove,Ca(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:P(e.onPointerLeave,Ca(e=>o.onItemLeave(e))),onFocus:P(e.onFocus,()=>f(!0)),onBlur:P(e.onBlur,()=>f(!1))})})})},`MenuItemImpl`)),[la,ua]=Ri(`MenuRadioGroup`,{value:void 0,onValueChange:/* @__PURE__ */ U(()=>{},`onValueChange`)}),[da,fa]=Ri(`MenuItemIndicator`,{checked:!1}),[pa,ma]=Ri(`MenuSub`);function ha(e){return e?`open`:`closed`}U(ha,`getOpenState`);function ga(e){return e===`indeterminate`}U(ga,`isIndeterminate`);function _a(e){return ga(e)?`indeterminate`:e?`checked`:`unchecked`}U(_a,`getCheckedState`);function va(e){let t=ki();for(let n of e)if(n===t||(n.focus(),ki()!==t))return}U(va,`focusFirst`);function ya(e,t){return e.map((n,r)=>e[(t+r)%e.length])}U(ya,`wrapArray`);function ba(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ya(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}U(ba,`getNextMatch`);function xa(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}U(xa,`isPointInPolygon`);function Sa(e,t){return t?xa({x:e.clientX,y:e.clientY},t):!1}U(Sa,`isPointerInGraceArea`);function Ca(e){return t=>t.pointerType===`mouse`?e(t):void 0}U(Ca,`whenMouse`);var wa=Object.defineProperty,Ta=(e,t)=>wa(e,`name`,{value:t,configurable:!0}),Ea=`DropdownMenu`,[Da,Oa]=u(Ea,[zi]),ka=zi(),[Aa,ja]=Da(Ea),Ma=/* @__PURE__ */ Ta(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,l=ka(t),u=I.useRef(null),[d,f]=c({prop:i,defaultProp:a??!1,onChange:o,caller:Ea});return/* @__PURE__ */ (0,L.jsx)(Aa,{scope:t,triggerId:F(),triggerRef:u,contentId:F(),open:d,onOpenChange:f,onOpenToggle:I.useCallback(()=>f(e=>!e),[f]),modal:s,children:/* @__PURE__ */ (0,L.jsx)(Ki,{...l,open:d,onOpenChange:f,dir:r,modal:s,children:n})})},`DropdownMenu`),Na=`DropdownMenuTrigger`,Pa=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ Ta(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=ja(Na,n),o=ka(n),s=d(t,a.triggerRef);return/* @__PURE__ */ (0,L.jsx)(qi,{asChild:!0,...o,children:/* @__PURE__ */ (0,L.jsx)(p.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:P(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:P(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Fa=/* @__PURE__ */ Ta(e=>{let{__scopeDropdownMenu:t,...n}=e,r=ka(t);return/* @__PURE__ */ (0,L.jsx)(Zi,{...r,...n})},`DropdownMenuPortal`),Ia=`DropdownMenuContent`,La=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ Ta(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ja(Ia,n),a=ka(n),o=I.useRef(!1);return/* @__PURE__ */ (0,L.jsx)(W,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:P(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:P(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Ra=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ Ta(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ka(n);return/* @__PURE__ */ (0,L.jsx)(sa,{...i,...r,ref:t})},`DropdownMenuItem`)),za=Object.defineProperty,Ba=(e,t)=>za(e,`name`,{value:t,configurable:!0});function Va(e,[t,n]){return Math.min(n,Math.max(t,e))}Ba(Va,`clamp`);var Ha=Object.defineProperty,Ua=(e,t)=>Ha(e,`name`,{value:t,configurable:!0}),Wa=`Popover`,[Ga,Ka]=u(Wa,[b]),qa=b(),[Ja,Ya]=Ga(Wa),Xa=/* @__PURE__ */ Ua(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=qa(t),l=I.useRef(null),[u,d]=I.useState(!1),[f,p]=I.useState(0),[m,h]=I.useState(0),[g,_]=c({prop:r,defaultProp:i??!1,onChange:a,caller:Wa});return/* @__PURE__ */ (0,L.jsx)(y,{...s,children:/* @__PURE__ */ (0,L.jsx)(Ja,{scope:t,contentId:F(),titleId:F(),descriptionId:F(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,triggerRef:l,open:g,onOpenChange:_,onOpenToggle:I.useCallback(()=>_(e=>!e),[_]),hasCustomAnchor:u,onCustomAnchorAdd:I.useCallback(()=>d(!0),[]),onCustomAnchorRemove:I.useCallback(()=>d(!1),[]),modal:o,children:n})})},`Popover`),Za=`PopoverTrigger`,Qa=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ Ua(function(e,t){let{__scopePopover:n,...r}=e,i=Ya(Za,n),a=qa(n),o=d(t,i.triggerRef),s=/* @__PURE__ */ (0,L.jsx)(p.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":lo(i.open),...r,ref:o,onClick:P(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:/* @__PURE__ */ (0,L.jsx)(D,{asChild:!0,...a,children:s})},`PopoverTrigger`)),$a=`PopoverPortal`,[eo,to]=Ga($a,{forceMount:void 0}),no=/* @__PURE__ */ Ua(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Ya($a,t);return/* @__PURE__ */ (0,L.jsx)(eo,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,L.jsx)(m,{present:n||a.open,children:/* @__PURE__ */ (0,L.jsx)(ee,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),ro=`PopoverContent`,io=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ Ua(function(e,t){let n=to(ro,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Ya(ro,e.__scopePopover);return/* @__PURE__ */ (0,L.jsx)(m,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,L.jsx)(oo,{...i,ref:t}):/* @__PURE__ */ (0,L.jsx)(so,{...i,ref:t})})},`PopoverContent`)),ao=s(`PopoverContent.RemoveScroll`),oo=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ Ua(function(e,t){let n=Ya(ro,e.__scopePopover),r=I.useRef(null),i=d(t,r),a=I.useRef(!1),{nodes:o,registry:s}=g();return I.useEffect(()=>{let e=r.current;if(e)return Sr(e)},[]),/* @__PURE__ */ (0,L.jsx)(pr,{as:ao,allowPinchZoom:!0,shards:I.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:/* @__PURE__ */ (0,L.jsx)(co,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),so=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ Ua(function(e,t){let n=Ya(ro,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return/* @__PURE__ */ (0,L.jsx)(co,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),co=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ Ua(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":f,branchNodes:p,branchRegistry:m,...h}=e,g=Ya(ro,n),_=qa(n),[v,y]=I.useState(null),b=d(t,y);return S(v),rn(),/* @__PURE__ */ (0,L.jsx)(C,{registry:m,children:/* @__PURE__ */ (0,L.jsx)(O,{asChild:!0,loop:!0,trapped:r,branches:p,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,L.jsx)(N,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ (0,L.jsx)(ne,{"data-state":lo(g.open),role:`dialog`,id:g.contentId,"aria-labelledby":g.titlePresent?g.titleId:void 0,"aria-describedby":g.descriptionPresent?uo(f,g.descriptionId):f,..._,...h,ref:b,style:{...h.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function lo(e){return e?`open`:`closed`}Ua(lo,`getState`);function uo(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ua(uo,`concatAriaDescribedby`);var fo=Object.defineProperty,G=(e,t)=>fo(e,`name`,{value:t,configurable:!0});function po(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}var mo={ItemAligned:`item-aligned`,Popper:`popper`},ho={LTR:`ltr`,RTL:`rtl`},go=[` `,`Enter`,`ArrowUp`,`ArrowDown`],_o=[` `,`Enter`],vo=`Select`,[yo,bo,xo]=/* @__PURE__ */ Nt(vo),[So,Co]=u(vo,[xo,b]),wo=b(),[To,Eo]=So(vo),[Do,Oo]=So(vo);function ko(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:h,internal_do_not_use_render:g}=e,_=wo(t),[v,b]=I.useState(null),[x,S]=I.useState(null),[C,w]=I.useState(!1),T=Yt(u),[E,D]=c({prop:r,defaultProp:i??!1,onChange:a,caller:vo}),[O,k]=c({prop:o,defaultProp:s,onChange:l,caller:vo}),A=I.useRef(null),ee=I.useRef(!1),[te,j]=I.useState(null),M=/* @__PURE__ */ G(e=>{j({value:e,hasConsumerStoppedPropagation:ee.current}),k(e)},`handleUserSelect`),ne=I.useRef(O);I.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ G(()=>k(ne.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,v,k]);let N=!v||!!h||!!v.closest(`form`),[P,re]=I.useState(/* @__PURE__ */ new Set),ie=F(),ae=Array.from(P).map(e=>e.props.value).join(`;`),oe=I.useCallback(e=>{re(t=>new Set(t).add(e))},[]),se=I.useCallback(e=>{re(t=>{let n=new Set(t);return n.delete(e),n})},[]),ce={required:m,trigger:v,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:ie,value:O,onValueChange:k,hasConsumerStoppedPropagationRef:ee,userSelection:te,onUserSelect:M,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:p,name:d,autoComplete:f,form:h,nativeOptions:P,nativeSelectKey:ae,isFormControl:N};return/* @__PURE__ */ (0,L.jsx)(y,{..._,children:/* @__PURE__ */ (0,L.jsx)(To,{scope:t,...ce,children:/* @__PURE__ */ (0,L.jsx)(yo.Provider,{scope:t,children:/* @__PURE__ */ (0,L.jsx)(Do,{scope:t,onNativeOptionAdd:oe,onNativeOptionRemove:se,children:ls(g)?g(ce):n})})})})}G(ko,`SelectProvider`);var Ao=/* @__PURE__ */ G(e=>{let{__scopeSelect:t,children:n,...r}=e;return/* @__PURE__ */ (0,L.jsx)(ko,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[n,e?/* @__PURE__ */ (0,L.jsx)(cs,{__scopeSelect:t}):null]})})},`Select`),jo=`SelectTrigger`,Mo=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=wo(n),o=Eo(jo,n),s=o.disabled||r,c=d(t,o.onTriggerChange),l=bo(n),u=I.useRef(`touch`),[f,m,h]=ds(e=>{let t=l().filter(e=>!e.disabled),n=fs(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onUserSelect(n.value)}),g=/* @__PURE__ */ G(e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return/* @__PURE__ */ (0,L.jsx)(D,{asChild:!0,...a,children:/* @__PURE__ */ (0,L.jsx)(p.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":us(o.value)?``:void 0,...i,ref:c,onClick:P(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&g(e)}),onPointerDown:P(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:P(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&(o.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),m(e.key)),!(t&&e.key===` `)&&go.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),No=`SelectValue`,Po=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Eo(No,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,f=d(t,c.onValueNodeChange);h(()=>{l(u)},[l,u]);let m=us(c.value);return/* @__PURE__ */ (0,L.jsx)(p.span,{...s,asChild:!m&&s.asChild,ref:f,style:{pointerEvents:`none`},children:/* @__PURE__ */ (0,L.jsx)(I.Fragment,{children:m?o:a},m?`placeholder`:`value`)})},`SelectValue`)),Fo=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return/* @__PURE__ */ (0,L.jsx)(p.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Io,Lo]=So(`SelectPortal`,{forceMount:void 0}),K=/* @__PURE__ */ G(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return/* @__PURE__ */ (0,L.jsx)(Io,{scope:e.__scopeSelect,forceMount:n,children:/* @__PURE__ */ (0,L.jsx)(ee,{asChild:!0,...r})})},`SelectPortal`),q=`SelectContent`,Ro=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let n=Lo(q,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Eo(q,e.__scopeSelect),[o,s]=I.useState();return h(()=>{s(new DocumentFragment)},[]),/* @__PURE__ */ (0,L.jsx)(m,{present:r||a.open,children:({present:e})=>e?/* @__PURE__ */ (0,L.jsx)(Wo,{...i,ref:t}):/* @__PURE__ */ (0,L.jsx)(zo,{...i,fragment:o})})},`SelectContent`)),zo=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Xt.createPortal(/* @__PURE__ */ (0,L.jsx)(Vo,{scope:n,children:/* @__PURE__ */ (0,L.jsx)(yo.Slot,{scope:n,children:/* @__PURE__ */ (0,L.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Bo=10,[Vo,Ho]=So(q),Uo=s(`SelectContent.RemoveScroll`),Wo=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n}=e,{position:r=mo.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_,...v}=e,y=Eo(q,n),[b,x]=I.useState(null),[S,C]=I.useState(null),w=d(t,x),[T,E]=I.useState(null),[D,k]=I.useState(null),A=bo(n),[ee,te]=I.useState(!1),j=I.useRef(!1),M=I.useRef(!1),ne=I.useRef(!1);I.useEffect(()=>{if(b)return Sr(b)},[b]),rn();let F=I.useCallback(e=>{let[t,...n]=A().map(e=>e.ref.current),[r]=n.slice(-1),i=po();for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),po()!==i))return},[A,S]),re=I.useCallback(()=>F([T,b]),[F,T,b]);I.useEffect(()=>{ee&&re()},[ee,re]);let{onOpenChange:ie,triggerPointerDownPosRef:ae}=y;I.useEffect(()=>{if(b){let e={x:0,y:0},t=/* @__PURE__ */ G(t=>{e={x:Math.abs(Math.round(t.pageX)-(ae.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ae.current?.y??0))}},`handlePointerMove`),n=/* @__PURE__ */ G(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||ie(!1),document.removeEventListener(`pointermove`,t),ae.current=null},`handlePointerUp`);return ae.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,ie,ae]),I.useEffect(()=>{let e=/* @__PURE__ */ G(()=>ie(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ie]);let[oe,se]=ds(e=>{let t=A().filter(e=>!e.disabled),n=fs(t,e,t.find(e=>e.ref.current===po()));n&&setTimeout(()=>n.ref.current?.focus())}),ce=I.useCallback((e,t,n)=>{let r=!M.current;r&&(M.current=!0);let i=!j.current&&!n;y.value!==void 0&&y.value===t||i?(E(e),i&&(j.current=!0)):r&&E(e)},[y.value]),le=I.useCallback(()=>b?.focus(),[b]),ue=I.useCallback((e,t,n)=>{if(!e)return;let r=!ne.current;r&&(ne.current=!0);let i=!j.current&&!n;(y.value!==void 0&&y.value===t||i||r)&&k(e)},[y.value]),de=r===mo.Popper?Ko:Go,fe=de===Ko?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_}:{};return/* @__PURE__ */ (0,L.jsx)(Vo,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ce,selectedItem:T,onItemLeave:le,itemTextRefCallback:ue,focusSelectedItem:re,selectedItemText:D,position:r,isPositioned:ee,searchRef:oe,children:/* @__PURE__ */ (0,L.jsx)(pr,{as:Uo,allowPinchZoom:!0,children:/* @__PURE__ */ (0,L.jsx)(O,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:P(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:/* @__PURE__ */ (0,L.jsx)(N,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:/* @__PURE__ */ (0,L.jsx)(de,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...fe,onPlaced:()=>te(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:P(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&se(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=A().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Go=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Eo(q,n),o=Ho(q,n),[s,c]=I.useState(null),[l,u]=I.useState(null),f=d(t,u),m=bo(n),g=I.useRef(!1),_=I.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=o,S=I.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&v&&y&&b){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==ho.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Bo,d=Va(a,[Bo,Math.max(Bo,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Bo,d=Va(a,[Bo,Math.max(Bo,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-Bo*2,u=v.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),p=parseInt(d.paddingTop,10),h=parseInt(d.borderBottomWidth,10),_=parseInt(d.paddingBottom,10),x=f+p+u+_+h,S=Math.min(y.offsetHeight*5,x),C=window.getComputedStyle(v),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Bo,D=c-E,O=y.offsetHeight/2,k=y.offsetTop+O,A=f+p+k,ee=x-A;if(A<=E){let e=o.length>0&&y===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-v.offsetTop-v.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+h);s.style.height=n+`px`}else{let e=o.length>0&&y===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+v.offsetTop+(e?w:0)+O)+ee;s.style.height=t+`px`,v.scrollTop=A-E+v.offsetTop}s.style.margin=`${Bo}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>g.current=!0)}},[m,a.trigger,a.valueNode,s,l,v,y,b,a.dir,r]);h(()=>S(),[S]);let[C,w]=I.useState();h(()=>{l&&w(window.getComputedStyle(l).zIndex)},[l]);let T=I.useCallback(e=>{e&&_.current===!0&&(S(),x?.(),_.current=!1)},[S,x]);return/* @__PURE__ */ (0,L.jsx)(qo,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:/* @__PURE__ */ (0,L.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:/* @__PURE__ */ (0,L.jsx)(p.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Ko=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Bo,...a}=e,o=wo(n);return/* @__PURE__ */ (0,L.jsx)(ne,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[qo,Jo]=So(q,{}),Yo=`SelectViewport`,Xo=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Ho(Yo,n),o=Jo(Yo,n),s=d(t,a.onViewportChange),c=I.useRef(0);return/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),/* @__PURE__ */ (0,L.jsx)(yo.Slot,{scope:n,children:/* @__PURE__ */ (0,L.jsx)(p.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:P(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Bo*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Zo,Qo]=So(`SelectGroup`),$o=`SelectItem`,[es,ts]=So($o),ns=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Eo($o,n),c=Ho($o,n),l=s.value===r,[u,f]=I.useState(a??``),[m,h]=I.useState(!1),g=v(e=>c.itemRefCallback?.(e,r,i)),_=d(t,g),y=F(),b=I.useRef(`touch`);function x(e){s.hasConsumerStoppedPropagationRef.current=e.isPropagationStopped(),s.onUserSelect(r),s.onOpenChange(!1)}return G(x,`handleSelect`),/* @__PURE__ */ (0,L.jsx)(es,{scope:n,value:r,disabled:i,textId:y,isSelected:l,onItemTextChange:I.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:/* @__PURE__ */ (0,L.jsx)(yo.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:/* @__PURE__ */ (0,L.jsx)(p.div,{role:`option`,"aria-labelledby":y,"data-highlighted":m?``:void 0,"aria-selected":l&&m,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:P(o.onFocus,()=>h(!0)),onBlur:P(o.onBlur,()=>h(!1)),onClick:P(o.onClick,e=>{i||b.current!==`mouse`&&x(e)}),onPointerUp:P(o.onPointerUp,e=>{i||b.current===`mouse`&&x(e)}),onPointerDown:P(o.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:P(o.onPointerMove,e=>{b.current=e.pointerType,i?c.onItemLeave?.():b.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(o.onPointerLeave,e=>{e.currentTarget===po()&&c.onItemLeave?.()}),onKeyDown:P(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(_o.includes(e.key)&&x(e),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),rs=`SelectItemText`,is=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=Eo(rs,n),s=Ho(rs,n),c=ts(rs,n),l=Oo(rs,n),[u,f]=I.useState(null),m=v(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),g=d(t,f,c.onItemTextChange,m),_=u?.textContent,y=I.useMemo(()=>/* @__PURE__ */ (0,L.jsx)(`option`,{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=l;return h(()=>(b(y),()=>x(y)),[b,x,y]),/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(p.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!us(o.value)?Xt.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),as=`SelectItemIndicator`,os=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function(e,t){let{__scopeSelect:n,...r}=e;return ts(as,n).isSelected?/* @__PURE__ */ (0,L.jsx)(p.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),ss=`SelectBubbleInput`,cs=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ G(function({__scopeSelect:e,...t},n){let r=Eo(ss,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:u,form:f,userSelection:m}=r,{nativeOptions:h,nativeSelectKey:g}=r,_=I.useRef(null),v=d(n,_),y=i??``,b=I.useRef(y),x=I.useRef(m),S=I.useRef(!1),C=Array.from(h).some(e=>(e.props.value??``)===``);return I.useEffect(()=>{let e=_.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=m!==null&&m!==x.current;x.current=m;let i=b.current!==y;b.current=y;let a=r&&i;if(r&&!i&&m.value!==y&&!m.hasConsumerStoppedPropagation&&n){S.current=!0;try{n.call(e,m.value),e.dispatchEvent(new Event(`change`,{bubbles:!0}))}finally{S.current=!1,n.call(e,y)}return}let o=a&&!m.hasConsumerStoppedPropagation;if(i&&n){let t=new Event(`change`,{bubbles:o});n.call(e,y),e.dispatchEvent(t)}},[y,m]),/* @__PURE__ */ (0,L.jsxs)(p.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:u,disabled:s,form:f,onChange:e=>{S.current||a(e.target.value)},...t,style:{...l,...t.style},ref:v,defaultValue:y,children:[us(i)&&!C?/* @__PURE__ */ (0,L.jsx)(`option`,{value:``}):null,Array.from(h)]},g)},`SelectBubbleInput`));function ls(e){return typeof e==`function`}G(ls,`isFunction`);function us(e){return e===``||e===void 0}G(us,`shouldShowPlaceholder`);function ds(e){let t=v(e),n=I.useRef(``),r=I.useRef(0),i=I.useCallback(e=>{let i=n.current+e;t(i);function a(e){n.current=e,window.clearTimeout(r.current),e!==``&&(r.current=window.setTimeout(()=>a(``),1e3))}G(a,`updateSearch`),a(i)},[t]),a=I.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}G(ds,`useTypeaheadSearch`);function fs(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ps(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}G(fs,`findNextItem`);function ps(e,t){return e.map((n,r)=>e[(t+r)%e.length])}G(ps,`wrapArray`);var ms=Object.defineProperty,J=(e,t)=>ms(e,`name`,{value:t,configurable:!0}),hs={Vertical:`vertical`,Horizontal:`horizontal`},gs={LTR:`ltr`,RTL:`rtl`},_s=[`PageUp`,`PageDown`],vs=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],ys={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},bs=`Slider`,[xs,Ss,Cs]=/* @__PURE__ */ Nt(bs),[ws,Ts]=u(bs,[Cs]),[Es,Ds]=ws(bs),Os=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ J(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=hs.Horizontal,disabled:s=!1,minStepsBetweenThumbs:l=0,preserveThumbOrder:u=!1,defaultValue:f=[r],value:p,onValueChange:m=/* @__PURE__ */ J(()=>{},`onValueChange`),onValueCommit:h=/* @__PURE__ */ J(()=>{},`onValueCommit`),inverted:g=!1,form:_,...v}=e,y=I.useRef(/* @__PURE__ */ new Set),b=I.useRef(0),x=I.useRef(!1),[S,C]=I.useState(null),w=o===hs.Horizontal?js:Ms,[T,E]=I.useState(null),D=d(t,E),[O=[],k]=c({prop:p,defaultProp:f,onChange:/* @__PURE__ */ J(e=>{[...y.current][b.current]?.focus({preventScroll:!0,focusVisible:x.current}),x.current=!1,m(e)},`onChange`)}),A=I.useRef(O),ee=I.useRef(O);I.useEffect(()=>{let e=_?T?.ownerDocument.getElementById(_):T?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ J(()=>k(ee.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[T,_,k]);function te(e){ne(e,Xs(O,e))}J(te,`handleSlideStart`);function j(e){ne(e,b.current)}J(j,`handleSlideMove`);function M(){String(O)!==String(A.current)&&h(O)}J(M,`handleSlideEnd`);function ne(e,t,{commit:n}={commit:!1}){let o=tc(a),s=Va(nc(Math.round((e-r)/a)*a+r,o),[r,i]),c=l*a;function d(e){let n=u?Va(s,[e[t-1]===void 0?r:e[t-1]+c,e[t+1]===void 0?i:e[t+1]-c]):s,a=qs(e,n,t);return $s(a,c)?{nextValues:a,changedIndex:u?t:a.indexOf(n),hasChanged:String(a)!==String(e)}:null}J(d,`getNextValues`);let f=d(O);f?.hasChanged&&C(f.nextValues),k((e=[])=>{let t=d(e);return t?(b.current=t.changedIndex,t.hasChanged&&n&&h(t.nextValues),t.hasChanged?t.nextValues:e):e})}return J(ne,`updateValues`),/* @__PURE__ */ (0,L.jsx)(Es,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:O,orientation:o,form:_,userRequestedValues:S,children:/* @__PURE__ */ (0,L.jsx)(xs.Provider,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,L.jsx)(xs.Slot,{scope:e.__scopeSlider,children:/* @__PURE__ */ (0,L.jsx)(w,{"aria-disabled":s,"data-disabled":s?``:void 0,...v,ref:D,onPointerDown:P(v.onPointerDown,()=>{s||(A.current=O,x.current=!1)}),min:r,max:i,inverted:g,onSlideStart:s?void 0:te,onSlideMove:s?void 0:j,onSlideEnd:s?void 0:M,onHomeKeyDown:()=>{s||(x.current=!0,ne(r,0,{commit:!0}))},onEndKeyDown:()=>{s||(x.current=!0,ne(i,O.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!s){x.current=!0;let n=_s.includes(e.key)||e.shiftKey&&vs.includes(e.key)?10:1,i=b.current,o=O[i];ne(rc(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[ks,As]=ws(bs,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),js=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ J(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[f,p]=I.useState(null),m=d(t,p),h=I.useRef(void 0),g=Yt(i),_=g===gs.LTR,v=_&&!a||!_&&a;function y(e){let t=h.current||f.getBoundingClientRect(),i=ec([0,t.width],v?[n,r]:[r,n]);return h.current=t,i(e-t.left)}return J(y,`getValueFromPointer`),/* @__PURE__ */ (0,L.jsx)(ks,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:/* @__PURE__ */ (0,L.jsx)(Ns,{dir:g,"data-orientation":`horizontal`,...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=y(e.clientX);o?.(t)},onSlideMove:e=>{let t=y(e.clientX);s?.(t)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:e=>{let t=ys[v?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),Ms=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ J(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=I.useRef(null),f=d(t,u),p=I.useRef(void 0),m=!i;function h(e){let t=p.current||u.current.getBoundingClientRect(),i=ec([0,t.height],m?[r,n]:[n,r]);return p.current=t,i(e-t.top)}return J(h,`getValueFromPointer`),/* @__PURE__ */ (0,L.jsx)(ks,{scope:e.__scopeSlider,startEdge:m?`bottom`:`top`,endEdge:m?`top`:`bottom`,size:`height`,direction:m?1:-1,children:/* @__PURE__ */ (0,L.jsx)(Ns,{"data-orientation":`vertical`,...l,ref:f,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=h(e.clientY);a?.(t)},onSlideMove:e=>{let t=h(e.clientY);o?.(t)},onSlideEnd:()=>{p.current=void 0,s?.()},onStepKeyDown:e=>{let t=ys[m?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),Ns=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ J(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Ds(bs,n);return/* @__PURE__ */ (0,L.jsx)(p.span,{...l,ref:t,onKeyDown:P(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):_s.concat(vs).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:P(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:P(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:P(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),Ps=`SliderTrack`,Fs=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ J(function(e,t){let{__scopeSlider:n,...r}=e,i=Ds(Ps,n);return/* @__PURE__ */ (0,L.jsx)(p.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),Is=`SliderRange`,Ls=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ J(function(e,t){let{__scopeSlider:n,...r}=e,i=Ds(Is,n),a=As(Is,n),o=I.useRef(null),s=d(t,o),c=i.values.length,l=i.values.map(e=>Js(e,i.min,i.max)),u=c>1?Math.min(...l):0,f=100-Math.max(...l);return/* @__PURE__ */ (0,L.jsx)(p.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:s,style:{...e.style,[a.startEdge]:u+`%`,[a.endEdge]:f+`%`}})},`SliderRange`)),[Rs,zs]=ws(`SliderThumb`),Bs=`SliderThumbProvider`;function Vs(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=Ds(Bs,t),o=Ss(t),[s,c]=I.useState(null),l=I.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=x(s),d=!s||!!a.form||!!s.closest(`form`),f=a.values[l],p=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),m=f===void 0?0:Js(f,a.min,a.max);I.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let h={value:f,name:p,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:m,size:u};return/* @__PURE__ */ (0,L.jsx)(Rs,{scope:t,...h,children:ic(i)?i(h):r})}J(Vs,`SliderThumbProvider`);var Hs=`SliderThumbTrigger`,Us=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ J(function(e,t){let{__scopeSlider:n,...r}=e,i=Ds(Hs,n),a=As(Hs,n),{index:o,value:s,percent:c,size:l,onThumbChange:u}=zs(Hs,n),f=d(t,u),m=Ys(o,i.values.length),h=l?.[a.size],g=h?Zs(h,c,a.direction):0;return/* @__PURE__ */ (0,L.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${c}% + ${g}px)`},children:/* @__PURE__ */ (0,L.jsx)(xs.ItemSlot,{scope:n,children:/* @__PURE__ */ (0,L.jsx)(p.span,{role:`slider`,"aria-label":e[`aria-label`]||m,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:f,style:s===void 0?{display:`none`}:e.style,onFocus:P(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),Ws=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ J(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return/* @__PURE__ */ (0,L.jsx)(Vs,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(Us,{...i,ref:t,__scopeSlider:n}),r?/* @__PURE__ */ (0,L.jsx)(Ks,{__scopeSlider:n},e):null]})})},`SliderThumb`)),Gs=`SliderBubbleInput`,Ks=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ J(function({__scopeSlider:e,onInput:t,...n},r){let{index:i,value:a,name:o,form:s}=zs(Gs,e),{userRequestedValues:c}=Ds(Gs,e),l=I.useRef(null),u=d(l,r),f=I.useRef(!1),m=I.useRef(a),h=I.useRef(c),g=I.useRef(c);return I.useEffect(()=>{let e=l.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set,r=m.current,o=r!==a;m.current=a;let s=c!==g.current;if(g.current=c,o&&n){let t=c!==h.current;h.current=c;let o=c?.[i];f.current=!(t&&(s&&o!==r||o===a));let l=new Event(`input`,{bubbles:!0});n.call(e,a),e.dispatchEvent(l),f.current=!1}},[i,a,c]),/* @__PURE__ */ (0,L.jsx)(p.input,{style:{display:`none`},name:o,form:s,...n,ref:u,defaultValue:a,onInput:P(t,e=>{f.current&&e.stopPropagation()})})},`SliderBubbleInput`));function qs(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}J(qs,`getNextSortedValues`);function Js(e,t,n){return Va(100/(n-t)*(e-t),[0,100])}J(Js,`convertValueToPercentage`);function Ys(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}J(Ys,`getLabel`);function Xs(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}J(Xs,`getClosestValueIndex`);function Zs(e,t,n){let r=e/2;return(r-ec([0,50],[0,r])(t)*n)*n}J(Zs,`getThumbInBoundsOffset`);function Qs(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}J(Qs,`getStepsBetweenValues`);function $s(e,t){if(t>0){let n=Qs(e);return Math.min(...n)>=t}return!0}J($s,`hasMinStepsBetweenValues`);function ec(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}J(ec,`linearScale`);function tc(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}J(tc,`getDecimalCount`);function nc(e,t){let n=10**t;return Math.round(e*n)/n}J(nc,`roundValue`);function rc(e,{min:t,step:n,direction:r,multiplier:i}){let a=tc(n),o=(e-t)/n,s=Math.round(o),c=nc(s*n+t,a)===nc(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),nc(l*n+t,a)}J(rc,`getNextStepValue`);function ic(e){return typeof e==`function`}J(ic,`isFunction`);var ac=Object.defineProperty,oc=(e,t)=>ac(e,`name`,{value:t,configurable:!0}),sc=`Toggle`,cc=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ oc(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=c({prop:n,onChange:i,defaultProp:r??!1,caller:sc});return/* @__PURE__ */ (0,L.jsx)(p.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:P(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),lc=Object.defineProperty,uc=(e,t)=>lc(e,`name`,{value:t,configurable:!0}),dc=`ToggleGroup`,fc={Single:`single`,Multiple:`multiple`},[pc,mc]=u(dc,[mi]),hc=mi(),gc=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ uc(function(e,t){let{type:n,...r}=e;if(n===fc.Single)return/* @__PURE__ */ (0,L.jsx)(yc,{role:`radiogroup`,...r,ref:t});if(n===fc.Multiple)return/* @__PURE__ */ (0,L.jsx)(bc,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${dc}\``)},`ToggleGroup`)),[_c,vc]=pc(dc),yc=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ uc(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ uc(()=>{},`onValueChange`),...a}=e,[o,s]=c({prop:n,defaultProp:r??``,onChange:i,caller:dc});return/* @__PURE__ */ (0,L.jsx)(_c,{scope:e.__scopeToggleGroup,type:fc.Single,value:I.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:I.useCallback(()=>s(``),[s]),children:/* @__PURE__ */ (0,L.jsx)(Cc,{...a,ref:t})})},`ToggleGroupImplSingle`)),bc=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ uc(function(e,t){let{value:n,defaultValue:r,onValueChange:i=/* @__PURE__ */ uc(()=>{},`onValueChange`),...a}=e,[o,s]=c({prop:n,defaultProp:r??[],onChange:i,caller:dc}),l=I.useCallback(e=>s((t=[])=>[...t,e]),[s]),u=I.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return/* @__PURE__ */ (0,L.jsx)(_c,{scope:e.__scopeToggleGroup,type:fc.Multiple,value:o,onItemActivate:l,onItemDeactivate:u,children:/* @__PURE__ */ (0,L.jsx)(Cc,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[xc,Sc]=pc(dc),Cc=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ uc(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=hc(n),u=Yt(o),d={dir:u,...c};return/* @__PURE__ */ (0,L.jsx)(xc,{scope:n,rovingFocus:i,disabled:r,children:i?/* @__PURE__ */ (0,L.jsx)(yi,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:/* @__PURE__ */ (0,L.jsx)(p.div,{...d,ref:t})}):/* @__PURE__ */ (0,L.jsx)(p.div,{...d,ref:t})})},`ToggleGroupImpl`)),wc=`ToggleGroupItem`,Tc=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ uc(function(e,t){let n=vc(wc,e.__scopeToggleGroup),r=Sc(wc,e.__scopeToggleGroup),i=hc(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=I.useRef(null);return r.rovingFocus?/* @__PURE__ */ (0,L.jsx)(Si,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:/* @__PURE__ */ (0,L.jsx)(Ec,{...s,ref:t})}):/* @__PURE__ */ (0,L.jsx)(Ec,{...s,ref:t})},`ToggleGroupItem`)),Ec=/* @__PURE__ */ I.forwardRef(/* @__PURE__ */ uc(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=vc(wc,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===fc.Single?o:void 0;return/* @__PURE__ */ (0,L.jsx)(cc,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),Dc=/* @__PURE__ */ (0,I.createContext)({});function Oc(e){let t=(0,I.useRef)(null);return t.current===null&&(t.current=e()),t.current}var kc=typeof window<`u`?I.useLayoutEffect:I.useEffect,Ac=/* @__PURE__ */ (0,I.createContext)(null);function jc(e,t){e.indexOf(t)===-1&&e.push(t)}function Mc(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Nc=(e,t,n)=>n>t?t:n<e?e:n,Pc={},Fc=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ic=e=>typeof e==`object`&&!!e,Lc=e=>/^0[^.\s]+$/u.test(e);/*#__NO_SIDE_EFFECTS__*/
|
|
52
52
|
function Rc(e){let t;return()=>(t===void 0&&(t=e()),t)}var zc=/* @__NO_SIDE_EFFECTS__ */ e=>e,Bc=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Vc=/* @__NO_SIDE_EFFECTS__ */ (e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Hc=class{constructor(){this.subscriptions=[]}add(e){return jc(this.subscriptions,e),()=>this.remove(e)}remove(e){Mc(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Uc=/* @__NO_SIDE_EFFECTS__ */ e=>e*1e3,Wc=/* @__NO_SIDE_EFFECTS__ */ e=>e/1e3,Gc=/* @__NO_SIDE_EFFECTS__ */ (e,t)=>t?1e3/t*e:0,Kc=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},qc=(e,t,n)=>e*(3*(1-e)*((1-e)*t+e*n)+e*e);/*#__NO_SIDE_EFFECTS__*/
|
|
53
53
|
function Jc(e,t,n,r){return e===t&&n===r?zc:i=>{let a=0,o=1,s=i;for(let t=0;;t++){s>=a&&s<=o||(s=(a+o)/2);let r=qc(s,e,n)-i;if(r*r<1e-28||t===40)break;r>0?o=s:a=s,s-=r*1e-7/(qc(s+1e-7,e,n)-i-r)}return qc(s,t,r)}}var Yc=/* @__NO_SIDE_EFFECTS__ */ e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Xc=/* @__NO_SIDE_EFFECTS__ */ e=>t=>1-e(1-t),Zc=/*@__PURE__*/ Jc(.33,1.53,.69,.99),Qc=/*@__PURE__*/ Xc(Zc),$c=/*@__PURE__*/ Yc(Qc),el=e=>e>=1?1:(e*=2)<1?.5*Qc(e):.5*(2-2**(-10*(e-1))),tl=e=>1-Math.sin(Math.acos(e)),nl=/* @__PURE__ */ Xc(tl),rl=/* @__PURE__ */ Yc(tl),il=/*@__PURE__*/ Jc(.42,0,1,1),al=/*@__PURE__*/ Jc(0,0,.58,1),ol=/*@__PURE__*/ Jc(.42,0,.58,1),sl=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]!=`number`;/*#__NO_SIDE_EFFECTS__*/
|
|
54
|
-
function cl(e,t){return/* @__PURE__ */ sl(e)?e[Kc(0,e.length,t)]:e}var ll=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,ul={linear:zc,easeIn:il,easeInOut:ol,easeOut:al,circIn:tl,circInOut:rl,circOut:nl,backIn:Qc,backInOut:$c,backOut:Zc,anticipate:el},dl=e=>typeof e==`string`,fl=e=>{if(/* @__PURE__ */ ll(e)){let[t,n,r,i]=e;return/* @__PURE__ */ Jc(t,n,r,i)}return dl(e)?ul[e]:e},Y={delta:0,timestamp:0,isProcessing:!1},pl;function ml(){pl=void 0}var hl={now:()=>(pl===void 0&&hl.set(Y.isProcessing||Pc.useManualTiming?Y.timestamp:performance.now()),pl),set:e=>{pl=e,queueMicrotask(ml)}},gl=e=>Math.round(e*1e5)/1e5,_l=e=>t=>typeof t==`string`&&t.startsWith(e),vl=/*@__PURE__*/ _l(`--`),yl=/*@__PURE__*/ _l(`var(--`),bl=e=>yl(e)?xl.test(e.split(`/*`)[0].trim()):!1,xl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Sl(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Cl={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},wl={...Cl,transform:e=>Nc(0,1,e)},Tl={...Cl,default:1},El=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Dl(e){return e==null}var Ol=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kl=(e,t)=>n=>!!(typeof n==`string`&&Ol.test(n)&&n.startsWith(e)||t&&!Dl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Al=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(El);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},jl=e=>Nc(0,255,e),Ml={...Cl,transform:e=>Math.round(jl(e))},Nl={test:/*@__PURE__*/ kl(`rgb`,`red`),parse:/*@__PURE__*/ Al(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Ml.transform(e)+`, `+Ml.transform(t)+`, `+Ml.transform(n)+`, `+gl(wl.transform(r))+`)`},Pl=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function Fl(e){let t=e.length>5?2:1,n=Pl(e,3,t);return{red:parseInt(Pl(e,0,t),16),green:parseInt(Pl(e,1,t),16),blue:parseInt(Pl(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var Il={test:/*@__PURE__*/ kl(`#`),parse:Fl,transform:Nl.transform},Ll=/* @__NO_SIDE_EFFECTS__ */ e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Rl=/*@__PURE__*/ Ll(`deg`),zl=/*@__PURE__*/ Ll(`%`),X=/*@__PURE__*/ Ll(`px`),Bl=/*@__PURE__*/ Ll(`vh`),Vl=/*@__PURE__*/ Ll(`vw`),Hl={...zl,parse:e=>zl.parse(e)/100,transform:e=>zl.transform(e*100)},Ul={test:/*@__PURE__*/ kl(`hsl`,`hue`),parse:/*@__PURE__*/ Al(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+zl.transform(gl(t))+`, `+zl.transform(gl(n))+`, `+gl(wl.transform(r))+`)`},Wl={test:e=>Nl.test(e)||Il.test(e)||Ul.test(e),parse:e=>Nl.test(e)?Nl.parse(e):Ul.test(e)?Ul.parse(e):Il.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Nl.transform(e):Ul.transform(e),getAnimatableNone:e=>{let t=Wl.parse(e);return t.alpha=0,Wl.transform(t)}},Gl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Kl=/*@__PURE__*/ new RegExp(El.source),ql=/*@__PURE__*/ new RegExp(Gl.source,`i`);function Jl(e){return isNaN(e)&&typeof e==`string`&&(Kl.test(e)||ql.test(e))}var Yl=`number`,Xl=`color`,Zl=`var`,Ql=`var(`,$l="${}",eu=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function tu(e){let t=e.toString();return Kl.test(t)||ql.test(t)}function nu(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(eu,e=>(Wl.test(e)?(r.color.push(a),i.push(Xl),n.push(Wl.parse(e))):e.startsWith(Ql)?(r.var.push(a),i.push(Zl),n.push(e)):(r.number.push(a),i.push(Yl),n.push(parseFloat(e))),++a,$l)).split($l),indexes:r,types:i}}function ru(e){return nu(e).values}function iu({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Yl?gl(r[a]):e===Xl?Wl.transform(r[a]):r[a]}return i}}function au(e){return iu(nu(e))}var ou=e=>typeof e==`number`?0:Wl.test(e)?Wl.getAnimatableNone(e):e,su=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:ou(e);function cu(e){let t=nu(e);return iu(t)(t.values.map((e,n)=>su(e,t.split[n])))}var lu={test:Jl,parse:ru,createTransformer:au,getAnimatableNone:cu};function uu(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function du({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=uu(s,r,e+1/3),a=uu(s,r,e),o=uu(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function fu(e,t){return n=>n>0?t:e}var pu=(e,t,n)=>e+(t-e)*n,mu=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},hu=[Il,Nl,Ul],gu=e=>hu.find(t=>t.test(e));function _u(e){let t=gu(e);if(!t)return!1;let n=t.parse(e);return t===Ul&&(n=du(n)),n}var vu=(e,t)=>{let n=_u(e),r=_u(t);if(!n||!r)return fu(e,t);let i={...n};return e=>(i.red=mu(n.red,r.red,e),i.green=mu(n.green,r.green,e),i.blue=mu(n.blue,r.blue,e),i.alpha=pu(n.alpha,r.alpha,e),Nl.transform(i))},yu=/* @__PURE__ */ new Set([`none`,`hidden`]);function bu(e,t){return yu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function xu(e,t){return n=>pu(e,t,n)}function Su(e){return typeof e==`number`?xu:typeof e==`string`?bl(e)?fu:Wl.test(e)?vu:Eu:Array.isArray(e)?Cu:typeof e==`object`?Wl.test(e)?vu:wu:fu}function Cu(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Su(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function wu(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Su(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Tu(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Eu=(e,t)=>{let n=nu(e),r=nu(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?yu.has(e)&&!r.values.length||yu.has(t)&&!n.values.length?bu(e,t):Bc(Cu(Tu(n,r),r.values),iu(r)):fu(e,t)},Du=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Ou(e,t){let n=Du.exec(e);if(!n)return;let r=Du.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>gl(pu(a,o,e))+i}function ku(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return pu(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Ou(e,t);if(n)return n}return Su(e)(e,t)}var Au=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function ju(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=!1,i=!1,a,o=/* @__PURE__ */ new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var Mu=40;function Nu(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=Au.reduce((e,t)=>(e[t]=ju(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Pc.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Mu),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:Au.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Au.length;t++)o[Au[t]].cancel(e)},state:n,steps:o}}var{schedule:Pu,cancel:Fu,steps:Iu}=/* @__PURE__ */ Nu(typeof requestAnimationFrame<`u`?requestAnimationFrame:zc,!0,Y),Lu=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Pu.update(t,e),stop:()=>Fu(t),now:()=>Y.isProcessing?Y.timestamp:hl.now()}},Ru=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},zu=2e4;function Bu(e,t=50,n=zu,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function Vu(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(Bu(o),zu);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:/* @__PURE__ */ Wc(s)}}var Hu=100,Uu=10,Wu=1,Gu=800,Ku=.3,qu=.3,Ju=.01,Yu=2,Xu=.005,Z=.5,Q=.01,Zu=10,Qu=.05,$u=e=>e<0?1/Math.max(1+e,Qu):Math.max(1-e,Qu);function ed(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return rd(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function td(e,t){return e*Math.sqrt(1-t*t)}var nd=12;function rd(e,t,n){let r=n;for(let n=1;n<nd;n++)r-=e(r)/t(r);return r}var id=.001;function ad({duration:e=Gu,bounce:t=Ku}){let n,r,i=$u(t);e=Nc(Q,Zu,/* @__PURE__ */ Wc(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=td(t,i),o=Math.exp(-r);return id-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=td(t*t,i);return(-n(t)+id>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=rd(n,r,a),s=o*ed(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ Uc(e)}}var od=(e,t)=>(t?e>=0:e>0)&&e<1/0;function sd(e,t){if(od(e,t))return e}function cd(e){let t=sd(e.stiffness),n=sd(e.damping,!0),r=sd(e.mass),i={...e,stiffness:t??Hu,damping:n??Uu,mass:r??Wu,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=$u(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*ed(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,ad(i)),i.isResolvedFromDuration=!0;od(i.stiffness)&&od(i.damping,!0)||(i.stiffness=Hu,i.damping=Uu)}return i}function ld(e=qu,t=Ku){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=cd({...n}),f=e=>d?0:-/* @__PURE__ */ Wc(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ Wc(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Ju:Yu),g.restDelta=n.restDelta||(e?Xu:Z)};_();let v,y,b;if(p<1){let e=td(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>/* @__PURE__ */ Uc(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ Uc(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Bu(S),zu),t=Ru(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}var ud=/* @__PURE__ */ Object.assign(ld,{applyToOptions:e=>{let t=Vu(e,100,ld);return e.ease=t.ease,e.duration=/* @__PURE__ */ Uc(t.duration),e.type=`keyframes`,e}});function dd({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=ud({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function fd(e,t,n){let r=[],i=n||Pc.mix||ku,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Bc(Array.isArray(t)?t[n]||zc:t,a)),r.push(a)}return r}function pd(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=fd(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=/* @__PURE__ */ Vc(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Nc(e[0],e[a-1],t)):l}function md(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ Vc(0,t,r);e.push(pu(n,1,i))}}function hd(e){let t=[0];return md(t,e.length-1),t}function gd(e,t){return e.map(e=>e*t)}function _d(e,t){return e.map(()=>t||ol).splice(0,e.length-1)}function vd({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ sl(r)?r.map(fl):fl(r)||ol,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(Pc.mix||ku)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Nc(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=pd(gd(n&&n.length===t.length?n:hd(t),e),t,{ease:Array.isArray(i)?i:_d(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var yd=5;function bd(e,t,n){let r=Math.max(t-yd,0);return/* @__PURE__ */ Gc(n-e(r),t-r)}function xd(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):bd(t=>e.next(t).value,t,e.next(t).value)}var Sd=e=>e!==null;function Cd(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Sd),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var wd={decay:dd,inertia:dd,tween:vd,keyframes:vd,spring:ud};function Td(e){typeof e.type==`string`&&(e.type=wd[e.type])}var Ed=40,Dd=(e,t)=>t-e>Ed&&!Pc.useManualTiming?t:e;function Od(e,t){return{kind:e,animation:t,timestamp:hl.now(),frameTimestamp:Y.timestamp,frameIsProcessing:Y.isProcessing}}function kd(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Od(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Ad(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Od(`layout-animation-start`,e),node:t})}catch{}}var jd=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Md=e=>e/100,Nd=e=>Math.round(e*1e4)/1e4,Pd=class extends jd{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==hl.now()&&this.tick(hl.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),kd(this,this.options)}initAnimation(){let{options:e}=this;Td(e);let{type:t=vd,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||vd;s!==vd&&typeof o[0]!=`number`&&(this.mixKeyframes=Bc(Md,ku(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Bu(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Dd(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==dd&&(f.value=Cd(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??Nd((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==dd?Cd(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=Nc(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return/* @__PURE__ */ Wc(this.calculatedDuration)}get iterationDuration(){return this.duration+/* @__PURE__ */ Wc(this.options.delay??0)}get time(){return/* @__PURE__ */ Wc(this.currentTime)}set time(e){e=/* @__PURE__ */ Uc(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return xd(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(hl.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ Wc(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Lu,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(hl.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},Fd=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Id(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(El)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Fd.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Ld=/\b([a-z-]*)\(.*?\)/gu,Rd={...lu,getAnimatableNone:e=>{let t=e.match(Ld);return t?t.map(Id).join(` `):e}},zd={...lu,getAnimatableNone:e=>{let t=lu.parse(e);return lu.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Bd={...Cl,transform:Math.round},Vd={rotate:Rl,pathRotation:Rl,rotateX:Rl,rotateY:Rl,rotateZ:Rl,scale:Tl,scaleX:Tl,scaleY:Tl,scaleZ:Tl,skew:Rl,skewX:Rl,skewY:Rl,distance:X,translateX:X,translateY:X,translateZ:X,x:X,y:X,z:X,perspective:X,transformPerspective:X,opacity:wl,originX:Hl,originY:Hl,originZ:X},Hd={borderWidth:X,borderTopWidth:X,borderRightWidth:X,borderBottomWidth:X,borderLeftWidth:X,borderRadius:X,borderTopLeftRadius:X,borderTopRightRadius:X,borderBottomRightRadius:X,borderBottomLeftRadius:X,width:X,maxWidth:X,height:X,maxHeight:X,top:X,right:X,bottom:X,left:X,inset:X,insetBlock:X,insetBlockStart:X,insetBlockEnd:X,insetInline:X,insetInlineStart:X,insetInlineEnd:X,padding:X,paddingTop:X,paddingRight:X,paddingBottom:X,paddingLeft:X,paddingBlock:X,paddingBlockStart:X,paddingBlockEnd:X,paddingInline:X,paddingInlineStart:X,paddingInlineEnd:X,margin:X,marginTop:X,marginRight:X,marginBottom:X,marginLeft:X,marginBlock:X,marginBlockStart:X,marginBlockEnd:X,marginInline:X,marginInlineStart:X,marginInlineEnd:X,fontSize:X,backgroundPositionX:X,backgroundPositionY:X,...Vd,zIndex:Bd,fillOpacity:wl,strokeOpacity:wl,numOctaves:Bd},Ud={...Hd,color:Wl,backgroundColor:Wl,outlineColor:Wl,fill:Wl,stroke:Wl,borderColor:Wl,borderTopColor:Wl,borderRightColor:Wl,borderBottomColor:Wl,borderLeftColor:Wl,filter:Rd,WebkitFilter:Rd,mask:zd,WebkitMask:zd},Wd=e=>Ud[e],Gd=/*@__PURE__*/ new Set([Rd,zd]);function Kd(e,t){let n=Wd(e);return Gd.has(n)||(n=lu),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function qd(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Jd=e=>e*180/Math.PI,Yd=e=>Zd(Jd(Math.atan2(e[1],e[0]))),Xd={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Yd,rotateZ:Yd,skewX:e=>Jd(Math.atan(e[1])),skewY:e=>Jd(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Zd=e=>(e%=360,e<0&&(e+=360),e),Qd=Yd,$d=e=>Math.hypot(e[0],e[1]),ef=e=>Math.hypot(e[4],e[5]),tf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$d,scaleY:ef,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>($d(e)+ef(e))/2,rotateX:e=>Zd(Jd(Math.atan2(e[6],e[5]))),rotateY:e=>Zd(Jd(Math.atan2(-e[2],e[0]))),rotateZ:Qd,rotate:Qd,skewX:e=>Jd(Math.atan(e[4])),skewY:e=>Jd(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function nf(e){return+!!e.includes(`scale`)}function rf(e,t){if(!e||e===`none`)return nf(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return nf(t);let r=(n[1]?tf:Xd)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var af=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return rf(n,t)},of=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],sf=/* @__PURE__ */ new Set([...of,`pathRotation`]),cf=e=>e===Cl||e===X,lf=/* @__PURE__ */ new Set([`x`,`y`,`z`]),uf=/* @__PURE__ */ of.filter(e=>!lf.has(e));function df(e){let t=[];return uf.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var ff=/* @__PURE__ */ new Set([`bottom`,`right`]);function pf(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var mf=({transform:e})=>rf(e,`x`),hf=({transform:e})=>rf(e,`y`),gf={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>pf(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>pf(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:mf,y:hf,translateX:mf,translateY:hf},_f=/* @__PURE__ */ new Set,vf=!1,yf=!1,bf=!1;function xf(){if(yf){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;_f.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),ff.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=df(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}yf=!1,vf=!1,_f.forEach(e=>e.complete(bf)),_f.clear()}function Sf(){_f.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yf=!0)})}function Cf(){bf=!0,Sf(),xf(),bf=!1}function wf(e,t,n){if(typeof e==`string`){if(Fc(e)||Lc(e))return parseFloat(e);if(!lu.test(e)&&lu.test(n))return Kd(t,n)}return e??void 0}var Tf=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(_f.add(this),vf||(vf=!0,Pu.read(Sf),Pu.resolveKeyframes(xf))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=wf(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}qd(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),_f.delete(this)}cancel(){this.state===`scheduled`&&(_f.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Ef=e=>e.startsWith(`--`);function Df(e,t,n){Ef(t)?e.style.setProperty(t,n):e.style[t]=n}var Of={};function kf(e,t){let n=/* @__PURE__ */ Rc(e);return()=>Of[t]??n()}var Af=/* @__PURE__ */ kf(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),jf=/*@__PURE__*/ kf(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Mf=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Nf={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ Mf([0,.65,.55,1]),circOut:/*@__PURE__*/ Mf([.55,0,1,.45]),backIn:/*@__PURE__*/ Mf([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ Mf([.33,1.53,.69,.99])};function Pf(e,t){if(e)return typeof e==`function`?jf()?Ru(e,t):`ease-out`:/* @__PURE__ */ ll(e)?Mf(e):Array.isArray(e)?e.map(e=>Pf(e,t)||Nf.easeOut):Nf[e]}function Ff(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Pf(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function If(e){return typeof e==`function`&&`applyToOptions`in e}function Lf({type:e,...t}){return If(e)&&jf()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Rf=class extends jd{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=Lf(e);this.animation=Ff(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Cd(r,this.options,o,this.speed);this.updateMotionValue?.(e),Df(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},kd(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return/* @__PURE__ */ Wc(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Wc(e)}get time(){return/* @__PURE__ */ Wc(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ Uc(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Af()?(this.animation.timeline=e,t?.(this.animation),zc):n(this)}},zf={anticipate:el,backInOut:$c,circInOut:rl};function Bf(e){return e in zf}function $(e){typeof e.ease==`string`&&Bf(e.ease)&&(e.ease=zf[e.ease])}var Vf=class extends Rf{constructor(e){$(e),Td(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(hl.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new Pd({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?Nc(0,10,a):0,s=this.sample(a);n&&r&&Df(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},Hf=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(lu.test(e)||e===`0`)&&!e.startsWith(`url(`));function Uf(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Wf(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Hf(i,t),s=Hf(a,t);return!o||!s?!1:Uf(e)||(n===`spring`||If(n))&&r}function Gf(e){e.duration=0,e.type=`keyframes`}var Kf=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`]),qf=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Jf(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&qf.test(e[t]))return!0;return!1}var Yf=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Xf=()=>!Pc.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function Zf(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(Kf.has(n)||Yf.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Xf()&&(Kf.has(n)||Yf.has(n)&&Jf(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Qf=(e,t)=>t&&typeof e==`number`?t.transform(e):e,$f={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ep=of.length,tp={},np=(e,t,n=Qf(t,Vd[e]))=>(tp[e]||(tp[e]=($f[e]||e)+`(`))+n+`)`,rp=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function ip(e,t,n){let r=``;for(let i=0;i<ep;i++){let a=of[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=Qf(o,Hd[a]));rp(a,o)||(r+=np(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=np(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var ap=/* @__PURE__ */ new WeakMap,op=200,sp=.001,cp=.1,lp=.001,up=100,dp=e=>/^(linear|ease(In|Out|InOut))$/.test(e),fp=(e,t)=>e-t,pp=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(pu(e,t,i/n));return r},mp=e=>e.motionValue.owner,hp=e=>ap.get(e),gp=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),_p=({name:e,motionValue:t})=>e&&of.includes(e)&&t?.owner?.current instanceof HTMLElement&&Xf()&&jf();function vp(e){let t=mp(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(gp(t,`transform`)||`none`)===`none`&&!gp(t,`pathRotation`)&&!t.projection?.isProjecting()}var yp=class extends Pd{constructor(e){let t=mp(e).current,{driver:n=Lu}=e,r,i=vp(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=hp(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=hp(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return hp(mp(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(hl.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=/* @__PURE__ */ ll(n)?Mf(n):dp(n)&&Nf[n];if(o&&!i&&!r&&e.length===2&&t===vd&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||vd)===vd?u||hd(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=hl.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||bp(mp(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(hl.now())}get time(){return this.isAccelerated()?/* @__PURE__ */ Wc(Nc(0,this.totalDuration,this.at(hl.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function bp(e){let t=e.current,n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Map,i={},a=[],o=/* @__PURE__ */ new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p=e=>{for(let t of n)if(t.name===e)return!0},m=(t,n)=>{let o={};for(let s of t===void 0?of:a){let a=r.get(s),c=t===void 0?gp(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},h=(e,t)=>{let n=``;for(let r in e){let i=e[r];t&&rp(r,i)||(n+=np(r,i)+` `)}return(t?n.trim():n)||`none`},g=(e,t)=>h(m(e,t)),_=(e=m())=>{t.style.transform=h(e,!0)},v=(e=!0)=>{e&&_(),s.forEach(({animation:e})=>e.cancel()),s=[]},y=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),b=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=hl.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),A.schedule(!1)}),e.oncancel=()=>s.includes(r)&&A.demote(),s.push(r)},x=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},S=(e,t,n,r)=>{let i=Math.min(op,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=pp(t,n,i).concat(r).sort(fp),o=e=>/* @__PURE__ */ Vc(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e.map(e=>e-n),i=r[r.length-1],o=r.some(e=>Math.abs(e)*sp>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(!o){if(l.some(e=>!(Math.abs(e)<=sp)))return}else if(!s)s=l,c=e=>(t.numberAt(e)-n)/o;else if(l.some((e,t)=>!(Math.abs(e-s[t])<=sp)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=sp))return`linear`;let l=[],u=(e,t=c(e))=>l.push(Nd(t)+` `+Nd(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&x(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},C=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?lp:cp))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...x(e=>r.numberAt(e),t,n));i.push(n)}},s=pp(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(fp))e>c&&o(c,e,0),c=e;return i.sort(fp)},w=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},T=(e,t,n,r={fill:`both`},i,a)=>{let o=e.flatMap(e=>e.boundaries(t,n)),s=a||S(e,t,n,o),c=s?[t,n]:C(e,t,n,o),l=c.map(e=>g(e,i)),u={transform:l};return s||(u.offset=c.map(e=>/* @__PURE__ */ Vc(t,n,e))),l.every(e=>e===l[0])&&(_(m(t,i)),u=null),y(u,{...r,duration:n-t,easing:s||`linear`})},E=t=>{let c=t,l=0,u=0,d=[],f=[],p=/* @__PURE__ */ new Set;r.clear(),o=/* @__PURE__ */ new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),a)e.sync();else{if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=of.filter(t=>{if(r.has(t))return!0;let n=i[t]=gp(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),v(!1);let m=!l&&w(d);try{if(m&&m[1]>t){let[e,n,r]=m;b(T(d,e,n,void 0,void 0,r),e-t,n-e)}else c>t&&(b(T(d,t,c),0,c-t),p.forEach(e=>e<c-1&&b(y(null,{duration:e-t}),0,e-t)));if(l){let e=u+Math.floor((c-u)/l)*l;b(T(f,e,e+l,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||v(),!0},D=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r&&n.updatePlaybackRate&&n.playState===`running`&&Math.abs(Number(n.currentTime)-o)<20?n.playbackRate!==r&&n.updatePlaybackRate(r):r?(n.playbackRate=r,n.startTime=e-o/r):(n.startTime=null,n.currentTime=o)}return!0},O=()=>!n.size&&(u=!0,hp(t)===A&&ap.delete(t),A.isJS||v(),!0),k=()=>{let t=hl.now();if(A.isJS||(A.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=gp(e,n.name),o.has(n)||(c=!0))}),A.isFinishing=!1),l=!1,u||(n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),O()))return;for(let e of n)if(!e.canAccelerate)return A.demote(!0);A.isJS&&(A.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=d;if(c=d=!1,r||!D(t)){if(a){if(t-f<up)return A.demote();f=t}if(!E(t))return A.demote()}},A={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,Y.isProcessing?Pu.render(k,!1,!0):queueMicrotask(k)))},release(e){let{state:t}=e;(t===`idle`||t===`finished`)&&n.delete(e),O()||A.schedule(!0)},check(){if(!A.isJS){for(let t in i)if(gp(e,t)!==i[t]&&!p(t))return A.schedule(!0,!0)}},demote(e){if(!(A.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),A.isJS=!0,o=/* @__PURE__ */ new Map,v(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return ap.set(t,A),A}var xp=class extends jd{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=hl.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Tf;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=hl.now();let u=Wf(e,i,a,o);u||((Pc.instantAnimations||!s)&&l?.(Cd(e,n,t)),e[0]=e[e.length-1],Gf(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&Zf(n),p=!f&&_p(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=Dd(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new Vf(n)}catch{m=new Pd(n)}}else m=p?new yp(n):new Pd(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),Cf()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},Sp=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return Cp(this.animations,`duration`)}get iterationDuration(){return Cp(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function Cp(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var wp=class extends Sp{then(e,t){return this.finished.finally(e).then(()=>{})}};function Tp(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Ep=30,Dp=e=>!isNaN(parseFloat(e)),Op={current:void 0},kp=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=hl.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=hl.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Dp(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Hc)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Hc,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Pu.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=/* @__PURE__ */ new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){Op.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=hl.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ep)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Ep);return/* @__PURE__ */ Gc(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function Ap(e,t){return new kp(e,t)}function jp(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Mp(e,t){let n=e?.[t]??e?.default??e;return n===e?n:jp(n,e)}var Np={type:`spring`,stiffness:500,damping:25,restSpeed:10},Pp=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fp={type:`keyframes`,duration:.8},Ip={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Lp=(e,{keyframes:t})=>t.length>2?Fp:sf.has(e)?e.startsWith(`scale`)?Pp(t[1]):Np:Ip,Rp=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`]);function zp(e){for(let t in e)if(!Rp.has(t))return!0;return!1}var Bp=(e,t,n,r={},i,a)=>o=>{let s=Mp(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ Uc(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};zp(s)||Object.assign(u,Lp(e,u)),u.duration&&=/* @__PURE__ */ Uc(u.duration),u.repeatDelay&&=/* @__PURE__ */ Uc(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Gf(u),u.delay===0&&(d=!0)),(Pc.instantAnimations||Pc.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Gf(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Cd(u.keyframes,s);if(e!==void 0){Pu.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Pd(u):new xp(u)},Vp=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hp(e){let t=Vp.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Up(e,t,n=1){let[r,i]=Hp(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Fc(e)?parseFloat(e):e}return bl(i)?Up(i,t,n+1):i}function Wp(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Gp(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Wp(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Kp(e,t,n){return Gp(e.getProps(),t,n,e)}var qp=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Jp=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...of]),Yp=e=>Array.isArray(e);function Xp(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ap(n))}function Zp(e){return Yp(e)?e[e.length-1]||0:e}function Qp(e,t){let{transitionEnd:n={},transition:r={},...i}=Kp(e,t)||{};i={...i,...n};for(let t in i)Xp(e,t,Zp(i[t]))}var $p=e=>!!(e&&e.getVelocity);function em(e){return!!($p(e)&&e.add)}function tm(e,t){let n=e.getValue(`willChange`);if(em(n))return n.add(t);if(!n&&Pc.WillChange){let n=new Pc.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var nm=`data-framer-appear-id`;function rm(e){return e.props[nm]}var im=typeof window<`u`;function am({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function om(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?jp(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&am(f,t))continue;let o={delay:n,...Mp(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Pu.update(()=>r.set(i));continue}let p=!1;if(im&&window.MotionHandoffAnimation){let n=rm(e);if(n){let e=window.MotionHandoffAnimation(n,t,Pu);e!==null&&(o.startTime=e,p=!0)}}tm(e,t);let m=l??e.shouldReduceMotion;r.start(Bp(t,r,i,m&&Jp.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Pu.update(()=>{o&&Qp(e,o)});d.length?Promise.all(d).then(t):t()}return d}function sm(e,t,n={}){let r=Kp(e,t,qp(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?om(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(sm(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Tp(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function cm(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>sm(e,t,n))):typeof t==`string`?sm(e,t,n):Promise.all(om(e,Kp(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var lm={test:e=>e===`auto`,parse:e=>e},um=e=>t=>t.test(e),dm=[Cl,X,zl,Rl,Vl,Bl,lm],fm=e=>dm.find(um(e));function pm(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Lc(e)}var mm=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function hm(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!mm.has(t)&&tu(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=Kd(n,i))}var gm=class extends Tf{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(Sl(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),bl(r))){let i=Up(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Jp.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=fm(r),o=fm(i);if(Sl(r)!==Sl(i)&&gf[n])this.needsMeasurement=!0;else if(a!==o){if(cf(a)&&cf(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else gf[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||pm(e[t]))&&n.push(t);n.length&&hm(e,n,t)}measure(){let{element:e,name:t}=this;return gf[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},_m=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],vm=[];function ym(e){bm(e),vm.unshift(e)}function bm(e){Mc(vm,e)}function xm(e){return vm.find(t=>t.test(e))}function Sm(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?Pu.update(()=>l.set(c)):(l.start(Bp(o,l,c,s&&Jp.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>Pu.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function Cm(e,t,n,r,i){return Sm(r=>{let a=e.get(t,r);if(!a){let o;if(!i){let i=n[r];o=wm(i)??e.read(t,r,i)}a=Ap(o,{owner:i}),e(t,{[r]:a})}return a},n,r,i)}function wm(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function Tm(e){return Ic(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Em(e){return Ic(e)&&`ownerSVGElement`in e}var Dm={};function Om(e){return Dm.current?.add(e),e}var km=e=>Dm.current?Dm.current.bind(e):e;function Am(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:Dm.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var jm=class{constructor(e=Pu.render){this.step=e,this.values=/* @__PURE__ */ new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=/* @__PURE__ */ new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function Mm(e,{step:t,...n}={}){let r=/* @__PURE__ */ new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new jm(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function Nm(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(rp(i,a)||(t+=(t&&` `)+np(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+np(`rotate`,i)),t||`none`}var Pm=/* @__PURE__ */ new Set([`originX`,`originY`,`originZ`]),Fm=(e,t)=>Qf(e.get(t)?.get(),Hd[t]),Im=(e,t,n,r)=>{let i,a;if(sf.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>of.indexOf(e)-of.indexOf(t)))}t.get(`transform`)||(!Tm(e)&&!t.get(`transformBox`)&&Im(e,t,`transformBox`,new kp(`fill-box`)),t.set(`transform`,new kp(`none`),()=>{ap.get(e)?.check(),e.style.transform=Nm(t)})),a=t.get(`transform`)}else Pm.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new kp(``),()=>{let n=Fm(t,`originX`)??`50%`,r=Fm(t,`originY`)??`50%`,i=Fm(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=Ef(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=Qf(r.getCurrent(),Hd[n])};return t.set(n,r,i,a)},Lm=e=>Tm(e)||Em(e),Rm=(e,t)=>{if(sf.has(t))return af(e,t);let n=getComputedStyle(e),r=Ef(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},zm=/*@__PURE__*/ Mm(Im,{test:Lm,read:Rm});function Bm(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function Vm(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(sf.has(e))o=!0;else if(vl(e))i[e]=n;else{let t=Qf(n,Hd[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=ip(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var Hm={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Um={offset:`strokeDashoffset`,array:`strokeDasharray`};function Wm(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Hm:Um;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Gm=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Km(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Vm(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Gm)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Wm(d,i,a,o,!1)}function qm(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var Jm=(e,t,n,r,i=n)=>{let a=qm(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=Bm(i));let o=Hd[n]||Hd[i],s=a?()=>{e[i]=Qf(r.get(),Hd[n])}:()=>{let t=Qf(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function Ym(e,t,n,r){return Pu.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new kp(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var Xm=/*@__PURE__*/ Mm((e,t,n,r)=>n.startsWith(`path`)&&!sf.has(n)?Ym(e,t,n,r):n.startsWith(`attr`)?Jm(e,t,n,r,Zm(n)):(sf.has(n)||Pm.has(n)||Ef(n)||n in e.style?Im:Jm)(e,t,n,r),{test:Em,read:(e,t)=>sf.has(t)?Hd[t]?.default||0:Ef(t)||Gm.includes(t)?Rm(e,t)||e.getAttribute(Bm(t))||0:(t=Zm(t),e.getAttribute(Bm(t))??e.getAttribute(t)??void 0)});function Zm(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function Qm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $m({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function eh(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function th(e){return e===void 0||e===1}function nh({scale:e,scaleX:t,scaleY:n}){return!th(e)||!th(t)||!th(n)}var rh=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function ih(e){return nh(e)||oh(e)||ah(e)}function ah(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function oh(e){return sh(e.x)||sh(e.y)}function sh(e){return e&&e!==`0%`}function ch(e,t,n){return n+t*(e-n)}function lh(e,t,n,r,i){return i!==void 0&&(e=ch(e,i,r)),ch(e,n,r)+t}function uh(e,t=0,n=1,r,i){e.min=lh(e.min,t,n,r,i),e.max=lh(e.max,t,n,r,i)}function dh(e,{x:t,y:n}){uh(e.x,t.translate,t.scale,t.originPoint),uh(e.y,n.translate,n.scale,n.originPoint)}var fh=.999999999999,ph=1.0000000000001;function mh(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(hh(e.x,-a.scroll.offset.x),hh(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,dh(e,o)),r&&(r.path?.[s]||r)!==a&&ih(a.latestValues)&&vh(e,a.latestValues,a.layout?.layoutBox));t.x<ph&&t.x>fh&&(t.x=1),t.y<ph&&t.y>fh&&(t.y=1)}function hh(e,t){e.min+=t,e.max+=t}function gh(e,t,n,r,i=.5){uh(e,t,n,pu(e.min,e.max,i),r)}function _h(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function vh(e,t,n){let r=n??e;gh(e.x,_h(t.x,r.x),t.scaleX,t.scale,t.originX),gh(e.y,_h(t.y,r.y),t.scaleY,t.scale,t.originY)}function yh(e,t){return Qm(eh(e.getBoundingClientRect(),t))}function bh(e,t,n){let r=yh(e,n),{scroll:i}=t;return i&&(hh(r.x,i.offset.x),hh(r.y,i.offset.y)),r}var xh={},Sh=e=>Em(e)?Xm:zm,Ch=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=gm}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return yh(this.current)}getProps(){return xh}};function wh(e,t,n,r){if(Dm.current?.track(e),r)return Sm(e=>r.getValue(e,null),t,n,r);let i=Sh(e);return Cm(i,e,t,n,new Ch(i,e))}var Th=/*@__PURE__*/ Mm((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>Ic(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:Eh,cancel:Dh}=/* @__PURE__ */ Nu(queueMicrotask,!1);function Oh(e,t,n){let r=$p(e)?e:Ap(e);return r.start(Bp(``,r,t,n)),r.animation}var kh={},Ah={value:null,addProjectionMetrics:null};function jh(e,t){let n=hl.now();e=km(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(Fu(r),e(a-t))};return Pu.setup(r,!0),Om(()=>Fu(r))}function Mh(e){return Em(e)&&e.tagName===`svg`}function Nh(e){return $p(e)?e.get():e}var Ph=e=>typeof e==`number`?e:parseFloat(e),Fh=_m.length,Ih=e=>typeof e==`number`||X.test(e);function Lh(e,t,n,r,i,a){i?(e.opacity=pu(0,n.opacity??1,zh(r)),e.opacityExit=pu(t.opacity??1,0,Bh(r))):a&&(e.opacity=pu(t.opacity??1,n.opacity??1,r));for(let i=0;i<Fh;i++){let a=_m[i],o=Rh(t,a),s=Rh(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Ih(o)===Ih(s)?(e[a]=Math.max(pu(Ph(o),Ph(s),r),0),(zl.test(s)||zl.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<rh.length;i++){let a=rh[i];(t[a]||n[a])&&(e[a]=pu(t[a]||0,n[a]||0,r))}}function Rh(e,t){return e[t]===void 0?e.borderRadius:e[t]}var zh=/*@__PURE__*/ Vh(0,.5,nl),Bh=/*@__PURE__*/ Vh(.5,.95,zc);function Vh(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ Vc(e,t,r))}function Hh(e,t){e.min=t.min,e.max=t.max}function Uh(e,t){Hh(e.x,t.x),Hh(e.y,t.y)}function Wh(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Gh=.9999,Kh=1.0001,qh=-.01,Jh=.01;function Yh(e){return e.max-e.min}function Xh(e,t,n){return Math.abs(e-t)<=n}function Zh(e,t,n,r=.5){e.origin=r,e.originPoint=pu(t.min,t.max,e.origin),e.scale=Yh(n)/Yh(t),e.translate=pu(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Gh&&e.scale<=Kh||isNaN(e.scale))&&(e.scale=1),(e.translate>=qh&&e.translate<=Jh||isNaN(e.translate))&&(e.translate=0)}function Qh(e,t,n,r){Zh(e.x,t.x,n.x,r?.originX),Zh(e.y,t.y,n.y,r?.originY)}function $h(e,t,n,r=0){e.min=(r?pu(n.min,n.max,r):n.min)+t.min,e.max=e.min+Yh(t)}function eg(e,t,n,r){$h(e.x,t.x,n.x,r?.x),$h(e.y,t.y,n.y,r?.y)}function tg(e,t,n,r=0){let i=r?pu(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Yh(t)}function ng(e,t,n,r){tg(e.x,t.x,n.x,r?.x),tg(e.y,t.y,n.y,r?.y)}function rg(e,t,n,r,i){return e-=t,e=ch(e,1/n,r),i!==void 0&&(e=ch(e,1/i,r)),e}function ig(e,t=0,n=1,r=.5,i,a=e,o=e){if(zl.test(t)&&(t=parseFloat(t),t=pu(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=pu(a.min,a.max,r);e===a&&(s-=t),e.min=rg(e.min,t,n,s,i),e.max=rg(e.max,t,n,s,i)}function ag(e,t,[n,r,i],a,o){ig(e,t[n],t[r],t[i],t.scale,a,o)}var og=[`x`,`scaleX`,`originX`],sg=[`y`,`scaleY`,`originY`];function cg(e,t,n,r){ag(e.x,t,og,n?.x,r?.x),ag(e.y,t,sg,n?.y,r?.y)}var lg=()=>({translate:0,scale:1,origin:0,originPoint:0}),ug=()=>({x:lg(),y:lg()}),dg=()=>({min:0,max:0}),fg=()=>({x:dg(),y:dg()});function pg(e){return e.translate===0&&e.scale===1}function mg(e){return pg(e.x)&&pg(e.y)}function hg(e,t){return e.min===t.min&&e.max===t.max}function gg(e,t){return hg(e.x,t.x)&&hg(e.y,t.y)}function _g(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vg(e,t){return _g(e.x,t.x)&&_g(e.y,t.y)}function yg(e){return Yh(e.x)/Yh(e.y)}function bg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var xg=class{constructor(){this.members=[]}add(e){jc(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(Mc(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Mc(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function Sg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Cg={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(X.test(e))e=parseFloat(e);else return e}return`${Sg(e,t.target.x)}% ${Sg(e,t.target.y)}%`}},wg={borderRadius:/* @__PURE__ */ Object.assign({},Cg,{applyTo:/* @__PURE__ */ _m.slice()}),borderTopLeftRadius:Cg,borderTopRightRadius:Cg,borderBottomLeftRadius:Cg,borderBottomRightRadius:Cg,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=lu.parse(e);if(i.length>5)return r;let a=lu.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=pu(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function Tg(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<rh.length;e++){let t=rh[e],i=n[t];i&&(r+=`${t}(${i}deg) `),!e&&n.pathRotation&&(r+=`rotate(${n.pathRotation}deg) `)}}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function Eg(e){return[e(`x`),e(`y`)]}var Dg=(e,t)=>e.depth-t.depth,Og=class{constructor(){this.children=[],this.isDirty=!1}add(e){jc(this.children,e),this.isDirty=!0}remove(e){Mc(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Dg),this.isDirty=!1,this.children.forEach(e)}},kg={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ag={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},jg=[`z`,`skew`,`skewZ`],Mg=1e3,Ng=0;function Pg(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var Fg=e=>e.instance&&ap.get(e.instance)?.demote()&&e.resetSkewAndRotation();function Ig(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=rm(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Pu,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ig(r)}function Lg({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(kh,{...wg,...kh}),class{constructor(e={},n=t?.()){this.id=Ng++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=/* @__PURE__ */ new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ah.value&&(Ag.nodes=Ag.calculatedTargetDeltas=Ag.calculatedProjections=0),this.nodes.forEach(Bg),this.nodes.forEach(Zg),this.nodes.forEach(Qg),this.nodes.forEach(Vg),Ah.addProjectionMetrics&&Ah.addProjectionMetrics(Ag)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Og)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Hc),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Em(t)&&!Mh(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Pu.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=jh(i,250),kg.hasAnimatedSinceResize&&(kg.hasAnimatedSinceResize=!1,this.nodes.forEach(Xg)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||i_,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!vg(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Mp(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Xg(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,Fu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach($g),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ig(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Fg(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,Fg(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Wg),this.nodes.forEach(Ug);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Gg);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qg),this.nodes.forEach(Jg),this.nodes.forEach(Yg),this.nodes.forEach(Rg),this.nodes.forEach(zg)):this.nodes.forEach(Gg),this.clearAllSnapshots();let e=hl.now();Y.delta=Nc(0,1e3/60,e-Y.timestamp),Y.timestamp=e,Y.isProcessing=!0,Iu.update.process(Y),Iu.preRender.process(Y),Iu.render.process(Y),Y.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Eh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Hg),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Pu.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Pu.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Yh(this.snapshot.measuredBox.x)&&!Yh(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=fg(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&Fg(this);let t=this.projectionDelta&&!mg(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ih(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),c_(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return fg();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(d_))){let{scroll:e}=this.root;e&&(hh(t.x,e.offset.x),hh(t.y,e.offset.y))}return t}removeElementScroll(e){let t=fg();if(Uh(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Uh(t,e),hh(t.x,i.offset.x),hh(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||fg();Uh(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(hh(a.x,-n.scroll.offset.x),hh(a.y,-n.scroll.offset.y)),ih(n.latestValues)&&vh(a,n.latestValues,n.layout?.layoutBox)}return!r&&ih(this.latestValues)&&vh(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=fg();Uh(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!ih(n.latestValues))continue;let r;n.instance&&(nh(n.latestValues)&&n.updateSnapshot(),r=fg(),Uh(r,n.measurePageBox())),cg(t,n.latestValues,n.snapshot?.layoutBox,r)}return ih(this.latestValues)&&cg(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Y.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Y.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=fg(),this.targetWithTransforms=fg()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),eg(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):Uh(this.target,this.layout.layoutBox),dh(this.target,this.targetDelta)):Uh(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Ah.value&&Ag.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||nh(this.parent.latestValues)||oh(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fg(),this.relativeTargetOrigin=fg(),ng(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Uh(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Y.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Uh(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;mh(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=fg());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Wh(this.prevProjectionDelta.x,this.projectionDelta.x),Wh(this.prevProjectionDelta.y,this.projectionDelta.y)),Qh(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&bg(this.projectionDelta.x,this.prevProjectionDelta.x)&&bg(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Ah.value&&Ag.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ug(),this.projectionDelta=ug(),this.projectionDeltaWithTransform=ug()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=ug();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=fg(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(r_));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);e_(o.x,e.x,n),e_(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ng(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),n_(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&gg(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=fg(),Uh(f,this.relativeTarget)),c&&(this.animationValues=a,Lh(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Fu(this.pendingAnimation),void 0),this.pendingAnimation=Pu.update(()=>{kg.hasAnimatedSinceResize=!0,this.motionValue||=Ap(0),this.motionValue.jump(0,!1),this.currentAnimation=Oh(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Ad(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(Mg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&u_(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||fg(),l_(i.x,t.x,e.x),l_(i.y,t.y,e.y)}Uh(t,i),vh(t,r),Qh(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new xg),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!ah(t))return;let n={};for(let t=0;t<jg.length;t++)Pg(jg[t],e,n,this.animationValues);for(let t=0;t<rh.length;t++)Pg(rh[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Nh(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Nh(t?.pointerEvents)||``),this.hasProjected&&!ih(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=Tg(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in kh){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=kh[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?Nh(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Ug),this.root.sharedNodes.clear()}}}function Rg(e){e.updateLayout(),Kg(e)}function zg(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)Eg(e=>{let t=Yh(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Hh(r[e],a[e])}else u_(i,t.layoutBox,n)&&Eg(t=>{let n=Yh(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=ug();Qh(c,n,t.layoutBox);let l=ug();Qh(l,a?e.applyTransform(r,!0):n,s);let u=!mg(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=fg();ng(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=fg();ng(l,n,i.layoutBox,s),a&&o(c,l),vg(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function Bg(e){Ah.value&&Ag.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Vg(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hg(e){e.clearSnapshot()}function Ug(e){e.clearMeasurements()}function Wg(e){e.isLayoutDirty=!0,e.updateLayout()}function Gg(e){e.isLayoutDirty=!1}function Kg(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;Eg(e=>hh(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function qg(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Jg(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Yg(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Xg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Zg(e){e.resolveTargetDelta()}function Qg(e){e.calcProjection()}function $g(e){e.resetSkewAndRotation()}function e_(e,t,n){e.translate=pu(t.translate,0,n),e.scale=pu(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function t_(e,t,n,r){e.min=pu(t.min,n.min,r),e.max=pu(t.max,n.max,r)}function n_(e,t,n,r){t_(e.x,t.x,n.x,r),t_(e.y,t.y,n.y,r)}function r_(e){return e.animationValues?.opacityExit!==void 0}var i_={duration:.45,ease:[.4,0,.1,1]},a_=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),o_=a_(`applewebkit/`)&&!a_(`chrome/`)?Math.round:zc;function s_(e){e.min=o_(e.min),e.max=o_(e.max)}function c_(e){s_(e.x),s_(e.y)}function l_(e,t,n){e.max=Yh(n)+(e.min=t.min)}function u_(e,t,n){return e===`position`||e===`preserve-aspect`&&!Xh(yg(t),yg(n),.2)}function d_(e){return e!==e.root&&e.scroll?.wasRoot}function f_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var p_=/* @__PURE__ */ Lg({attachResizeListener:(e,t)=>f_(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),m_={current:void 0},h_=/* @__PURE__ */ Lg({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!m_.current){let e=new p_({});e.mount(window),e.setOptions({layoutScroll:!0}),m_.current=e}return m_.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),g_=/* @__PURE__ */ new WeakMap;function __(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function v_(e){return typeof e==`string`||Array.isArray(e)}var y_=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],b_=/* @__PURE__ */ [`initial`].concat(y_);function x_(e){if(__(e.animate))return!0;for(let t=0;t<b_.length;t++)if(v_(e[b_[t]]))return!0;return!1}function S_(e){return!!(x_(e)||e.variants)}function C_(e,t,n){for(let r in t){let i=t[r],a=n[r];if($p(i))e.addValue(r,i);else if($p(a))e.addValue(r,Ap(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Ap(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var w_={current:null},T_={current:!1},E_=typeof window<`u`;function D_(){if(T_.current=!0,E_){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>w_.current=e.matches;e.addEventListener(`change`,t),t()}else w_.current=!1}}var O_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],k_={};function A_(e){k_=e}function j_(){return k_}var M_=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=Tf,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=hl.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Pu.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=x_(t),this.isVariantNode=S_(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&$p(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,g_.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(T_.current||D_(),this.shouldReduceMotion=w_.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),Fu(this.notifyUpdate),Fu(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=/* @__PURE__ */ new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&Kf.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Rf({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ Uc(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=sf.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Pu.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),ap.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in k_){let t=k_[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fg()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&ap.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<O_.length;t++){let n=O_[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=C_(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=Ap(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Fc(n)||Lc(n))?n=parseFloat(n):typeof n!=`number`&&!lu.test(n)&&lu.test(t)&&(n=Kd(e,t)),this.setBaseTarget(e,$p(n)?n.get():n)),$p(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new Hc)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){Eh.render(this.render)}},N_=class extends M_{constructor(){super(...arguments),this.KeyframeResolver=gm}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;$p(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function P_(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function F_(e,{layout:t,layoutId:n}){return sf.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!kh[e]||e===`opacity`)}function I_(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)($p(r[t])||i&&$p(i[t])||F_(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function L_(e){return window.getComputedStyle(e)}var R_=class extends N_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=P_}mount(e){super.mount(e)}readValueFromInstance(e,t){if(sf.has(t))return this.projection?.isProjecting?nf(t):af(e,t);{let n=L_(e),r=(vl(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return yh(e,t)}build(e,t,n){Vm(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return I_(e,t,n)}},z_=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function B_(e){return{point:{x:e.pageX,y:e.pageY}}}var V_=e=>t=>z_(t)&&e(t,B_(t));function H_(e,t,n,r){return f_(e,t,V_(n),r)}var U_=/* @__PURE__ */ new WeakMap,W_,G_=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Em(r)&&`getBBox`in r?r.getBBox()[t]:r[n],K_=/*@__PURE__*/ G_(`inline`,`width`,`offsetWidth`),q_=/*@__PURE__*/ G_(`block`,`height`,`offsetHeight`);function J_({target:e,borderBoxSize:t}){U_.get(e)?.forEach(n=>{n(e,{get width(){return K_(e,t)},get height(){return q_(e,t)}})})}function Y_(e){e.forEach(J_)}function X_(){typeof ResizeObserver<`u`&&(W_=new ResizeObserver(Y_))}function Z_(e,t){W_||X_();let n=Am(e);return n.forEach(e=>{let n=U_.get(e);n||(n=/* @__PURE__ */ new Set,U_.set(e,n)),n.add(t),W_?.observe(e)}),()=>{n.forEach(e=>{let n=U_.get(e);n?.delete(t),n?.size||W_?.unobserve(e)})}}var Q_=/* @__PURE__ */ new Set,$_;function ev(){$_=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Q_.forEach(t=>t(e))},window.addEventListener(`resize`,$_)}function tv(e){return Q_.add(e),$_||ev(),()=>{Q_.delete(e),!Q_.size&&typeof $_==`function`&&(window.removeEventListener(`resize`,$_),$_=void 0)}}function nv(e,t){return Om(typeof e==`function`?tv(e):Z_(e,t))}var rv=(e,t)=>Math.abs(e-t);function iv(e,t){let n=rv(e.x,t.x),r=rv(e.y,t.y);return Math.sqrt(n**2+r**2)}var av=/*#__PURE__*/ new Set([`auto`,`scroll`]),ov=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=cv(this.lastRawMoveEventInfo,this.transformPagePoint));let e=uv(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=iv(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:hl.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=cv(t,this.transformPagePoint),this.hasPendingMove=!0,Pu.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=uv(e.type===`pointercancel`?this.lastMoveEventInfo:cv(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!z_(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=cv(B_(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:hl.now()}];let{onSessionStart:l}=t;l&&l(e,uv(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=Bc(H_(this.contextWindow,`pointermove`,this.handlePointerMove,u),H_(this.contextWindow,`pointerup`,this.handlePointerUp,u),H_(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(av.has(e.overflowX)||av.has(e.overflowY))&&this.scrollPositions.set(t,sv(t)),t=t.parentElement}this.scrollPositions.set(window,sv(window)),this.removeScrollListeners=Bc(f_(window,`scroll`,this.onElementScroll,{capture:!0}),f_(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=sv(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Pu.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),Fu(this.updatePoint)}},sv=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function cv(e,t){return t?{point:t(e.point)}:e}function lv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uv({point:e},t){return{point:e,delta:lv(e,fv(t)),offset:lv(e,dv(t)),velocity:pv(t,.1)}}function dv(e){return e[0]}function fv(e){return e[e.length-1]}function pv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=fv(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ Uc(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ Uc(t)*2&&(r=e[1]);let a=/* @__PURE__ */ Wc(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var mv=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function hv(e){return mv.has(e.tagName)||e.isContentEditable===!0}var gv=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function _v(e){return gv.has(e.tagName)||e.isContentEditable===!0}var vv={x:!1,y:!1};function yv(){return vv.x||vv.y}function bv(e){return e===`x`||e===`y`?vv[e]?null:(vv[e]=!0,()=>{vv[e]=!1}):vv.x||vv.y?null:(vv.x=vv.y=!0,()=>{vv.x=vv.y=!1})}function xv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?pu(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?pu(n,e,r.max):Math.min(e,n)),e}function Sv(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Cv(e,{top:t,left:n,bottom:r,right:i}){return{x:Sv(e.x,n,i),y:Sv(e.y,t,r)}}function wv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Tv(e,t){return{x:wv(e.x,t.x),y:wv(e.y,t.y)}}function Ev(e,t){let n=.5,r=Yh(e),i=Yh(t);return i>r?n=/* @__PURE__ */ Vc(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ Vc(e.min,e.max-i,t.min)),Nc(0,1,n)}function Dv(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Ov=.35;function kv(e=Ov){return e===!1?e=0:e===!0&&(e=Ov),{x:Av(e,`left`,`right`),y:Av(e,`top`,`bottom`)}}function Av(e,t,n){return{min:jv(e,t),max:jv(e,n)}}function jv(e,t){return typeof e==`number`?e:e[t]||0}function Mv(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var Nv=/* @__PURE__ */ new WeakMap,Pv=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fg(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock?.(),this.openDragLock=bv(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:a}=this.visualElement;a&&(a.isAnimationBlocked=!0,a.target=void 0),Eg(e=>{let t=this.getAxisMotionValue(e).get()||0;if(bl(t)&&(t=Up(t,this.visualElement.current)||0),X.test(t))t=parseFloat(t);else if(zl.test(t)){let n=a?.layout?.layoutBox[e];n&&(t=Yh(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),i&&Pu.update(()=>i(e,t),!1,!0),tm(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Bv(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.visualElement.render(),a&&Pu.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new ov(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&Pu.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!zv(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=xv(i,a,this.elastic[e])),r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;Fv(e)?this.constraints&&this.scroll===Mv(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r?Cv(r.layoutBox,e):!1,this.elastic=kv(t),i!==this.constraints&&!Fv(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Eg(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Dv(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!Fv(e))return!1;let n=Iv(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Mv(r);let i=bh(n,r.root,this.visualElement.getTransformPagePoint()),a=Tv(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t($m(a));this.hasMutatedConstraints=!!e,e&&(a=Qm(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},l=Eg(s=>{if(!zv(s,t||n,this.currentDirection))return;let l=c[s]||{};(o===!0||o===s)&&(l={min:0,max:0});let u=i?200:1e6,d=i?40:1e7,f={type:`inertia`,velocity:r?e[s]:0,bounceStiffness:u,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,f)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return tm(this.visualElement,e),n.start(Bp(e,n,0,t,this.visualElement,!1))}stopAnimation(){Eg(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Eg(e=>{if(!zv(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-pu(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Fv(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Eg(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Ev({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Eg(t=>{let n=this.getAxisMotionValue(t);if(!zv(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(pu(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Nv.set(this.visualElement,this);let e=this.visualElement.current,t=H_(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&_v(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=Fv(t)&&Iv(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Rv(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),Pu.read(r);let o=f_(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Eg(t=>{if(!zv(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Ov,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function Fv(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Iv=e=>`current`in e?e.current:e;function Lv(e){let t=!0;return()=>{t?t=!1:e()}}function Rv(e,t,n){let r=nv(e,Lv(n)),i=nv(t,Lv(n));return()=>{r(),i()}}function zv(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Bv(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Vv(e,t){let n=Am(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Om(()=>r.abort())]}function Hv(e){return!(e.pointerType===`touch`||yv())}function Uv(e,t,n={}){t=km(t);let[r,i,a]=Vv(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Hv(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Wv=(e,t)=>t?e===t||Wv(e,t.parentElement):!1,Gv=/* @__PURE__ */ new WeakSet;function Kv(e){return t=>{t.key===`Enter`&&e(t)}}function qv(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Jv=(e,t)=>{let n=!1,r=Kv(()=>{Gv.has(e)||(n=!0,qv(e,`down`))}),i=Kv(()=>{n&&(n=!1,qv(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&qv(e,`cancel`)},{...t,once:!0})};function Yv(e){return z_(e)&&!yv()}var Xv=/* @__PURE__ */ new WeakSet;function Zv(e,t,n={}){t=km(t);let[r,i,a]=Vv(e,n),o=e=>{let r=e.currentTarget;if(!Yv(e)||Xv.has(e))return;Gv.add(r),n.stopPropagation&&Xv.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Gv.has(r)&&Gv.delete(r),Yv(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Wv(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Tm(e)&&(e.addEventListener(`focus`,()=>Jv(e,i),i),!hv(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var Qv=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},$v=/* @__PURE__ */ new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),ey=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function ty(e,t,n,r){P_(e,t,void 0,r);for(let n in t.attrs)e.setAttribute($v.has(n)?n:Bm(n),t.attrs[n])}function ny(e,t,n){let r=I_(e,t,n);for(let n in e)if(n!==`children`&&($p(e[n])||$p(t[n]))){let t=of.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var ry=class extends N_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=fg}getBaseTargetFromProps(e,t){return sf.has(t)?super.getBaseTargetFromProps(e,t)??nf(t):e[t]}getDefaultValue(e){return sf.has(e)?this.latestValues[e]??nf(e):void 0}readValueFromInstance(e,t){if(sf.has(t)){let e=Wd(t);return e&&e.default||0}if(Gm.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=$v.has(t)?t:Bm(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return ny(e,t,n)}build(e,t,n){Km(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){ty(e,t,n,r)}mount(e){this.isSVGTag=ey(e.tagName),super.mount(e)}};function iy(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ay=[...y_].reverse(),oy=e=>e?.out===!0?e:e?.out;function sy(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>cm(e,t,n))),n=ly(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&Kp(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=/* @__PURE__ */ new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&oy(f(l??(g&&g.props.initial))?.transition);if(ay.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?v_(f)||f===!1?f:void 0:l,y=v_(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||__(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=cy(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=Kp(e,n,qp(e,t))||{};E={...E,...a,...i},D=oy(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!iy(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=Kp(s,n)?.transition?.delayChildren;r.delay=Tp(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!$p(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=ly(),i=!0}}}function cy(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!iy(t,e):!1}function ly(){let e={};for(let t of y_)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var uy=/* @__PURE__ */ (0,I.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function dy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function fy(...e){return t=>{let n=!1,r=e.map(e=>{let r=dy(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():dy(e[t],null)}}}}function py(...e){return I.useCallback(fy(...e),e)}var my=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},hy=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=my(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=my(e.offsetParent);return[t/i,n/a]},gy=class extends I.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(Tm(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Tm(e)&&e.offsetWidth||0,r=Tm(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=hy(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function _y({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,I.useId)(),c=(0,I.useRef)(null),l=(0,I.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,I.useContext)(uy),d=py(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,I.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return Eh.setup(()=>{let[e,t]=hy(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),Eh.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,L.jsx)(gy,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:I.cloneElement(e,{ref:d})})}var vy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Oc(yy),d=(0,I.useId)(),f=(0,I.useRef)(),p=(0,I.useRef)(n),m=(0,I.useRef)(r);kc(()=>{p.current=n,m.current=r});let h=!0,g=(0,I.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,I.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),I.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,L.jsx)(_y,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,L.jsx)(Ac.Provider,{value:g,children:e})};function yy(){return/* @__PURE__ */ new Map}function by(e=!0){let t=(0,I.useContext)(Ac);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,I.useId)();(0,I.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,I.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var xy=e=>e.key||``;function Sy(e){let t=[];return I.Children.forEach(e,e=>{(0,I.isValidElement)(e)&&t.push(e)}),t}var Cy=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=by(o),f=(0,I.useMemo)(()=>Sy(e),[e]),p=o&&!u?[]:f.map(xy),m=(0,I.useRef)(!0),h=Oc(()=>/* @__PURE__ */ new Map),g=(0,I.useRef)(/* @__PURE__ */ new Set),[_,v]=(0,I.useState)(f),[y,b]=(0,I.useState)(f);kc(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]);let x=(0,I.useRef)();(0,I.useEffect)(()=>()=>{let e=x.current;x.current=void 0,e?.()},[y]),kc(()=>{m.current=!1;for(let e=0;e<y.length;e++){let t=xy(y[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[y,p.length,p.join(`-`)]);let S=[];if(f!==_){let e=[...f],t=0;for(let n of y){let r=p.indexOf(xy(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>h.get(xy(e)))?e=f:a===`wait`&&(e=S),b(Sy(e)),v(f),null}let{forceRender:C}=(0,I.useContext)(Dc);return(0,L.jsx)(L.Fragment,{children:y.map(e=>{let _=xy(e),b=o&&!u?!1:f===y||p.includes(_);return(0,L.jsx)(vy,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),v([]),o&&d?.(),x.current=r)},anchorX:s,anchorY:c,children:e},_)})})},wy=/* @__PURE__ */ (0,I.createContext)({strict:!1}),Ty={animation:[`variants`,...y_],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Ey=!1;function Dy(){if(Ey)return;let e={};for(let t in Ty)e[t]={isEnabled:e=>Ty[t].some(t=>!!e[t])};A_(e),Ey=!0}function Oy(){return Dy(),j_()}function ky(e){let t=Oy();for(let n in e)t[n]={...t[n],...e[n]};A_(t)}function Ay({children:e,...t}){let n=(0,I.useContext)(uy);t={...n,...t},t.transition=jp(t.transition,n.transition),t.isStatic=Oc(()=>t.isStatic);let r=(0,I.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,L.jsx)(uy.Provider,{value:r,children:e})}var jy=/* @__PURE__ */ (0,I.createContext)({});function My(e,t){if(x_(e)){let{initial:t,animate:n}=e;return{initial:t===!1||v_(t)?t:void 0,animate:v_(n)?n:void 0}}return e.inherit===!1?{}:t}function Ny(e){let{initial:t,animate:n}=My(e,(0,I.useContext)(jy));return(0,I.useMemo)(()=>({initial:t,animate:n}),[Py(t),Py(n)])}function Py(e){return Array.isArray(e)?e.join(` `):e}var Fy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Iy(e,t,n){for(let r in t)!$p(t[r])&&!F_(r,n)&&(e[r]=t[r])}function Ly({transformTemplate:e},t){return(0,I.useMemo)(()=>{let n=Fy();return Vm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ry(e,t){let n=e.style||{},r={};return Iy(r,n,e),Object.assign(r,Ly(e,t)),r}function zy(e,t){let n={},r=Ry(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var By=()=>({...Fy(),attrs:{}});function Vy(e,t,n,r){let i=(0,I.useMemo)(()=>{let n=By();return Km(n,t,ey(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return Iy(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var Hy=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Uy(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Hy.has(e)}function Wy(e,t){return e.startsWith(`on`)?!Uy(e):t?.(e)??!Uy(e)}function Gy(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||$p(e[a])||(Wy(a,r)||n===!0&&Uy(a)||!t&&!Uy(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var Ky=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function qy(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Ky.indexOf(e)>-1||/[A-Z]/u.test(e))}function Jy(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??qy(e)?Vy:zy)(t,r,i,e),l=Gy(t,typeof e==`string`,a,s),u=e===I.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,I.useMemo)(()=>$p(d)?d.get():d,[d]);return(0,I.createElement)(e,{...u,children:f})}function Yy({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Xy(n,r,i,e),renderState:t()}}function Xy(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Nh(a[e]);let{initial:o,animate:s}=e,c=x_(e),l=S_(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!__(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Gp(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Zy=e=>(t,n)=>{let r=(0,I.useContext)(jy),i=(0,I.useContext)(Ac),a=()=>Yy(e,t,r,i);return n?a():Oc(a)},Qy=/*@__PURE__*/ Zy({scrapeMotionValuesFromProps:I_,createRenderState:Fy}),$y=/*@__PURE__*/ Zy({scrapeMotionValuesFromProps:ny,createRenderState:By}),eb=/* @__PURE__ */ Symbol.for(`motionComponentSymbol`);function tb(e,t,n){let r=(0,I.useRef)(n);(0,I.useInsertionEffect)(()=>{r.current=n});let i=(0,I.useRef)(null);return(0,I.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var nb=/* @__PURE__ */ (0,I.createContext)({});function rb(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function ib(e,t,n,r,i,a){let{visualElement:o}=(0,I.useContext)(jy),s=(0,I.useContext)(wy),c=(0,I.useContext)(Ac),l=(0,I.useContext)(uy),u=l.reducedMotion,d=l.skipAnimations,f=(0,I.useRef)(null),p=(0,I.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,I.useContext)(nb);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&ab(f.current,n,i,h),(0,I.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[nm],_=(0,I.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return kc(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),kc(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,I.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function ab(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t,f=e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:ob(e.parent));f.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&rb(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u});let p=f.getStack()?.lead;p&&!f.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}function ob(e){if(e)return e.options.allowProjection===!1?ob(e.parent):e.projection}function sb(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&ky(r);let a=n?n===`svg`:qy(e),o=a?$y:Qy;function s(n,s){let c,l=cb(n);Oc(()=>!!m_.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,I.useContext)(uy),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=Ny(n),m=o(n,d);if(!d&&typeof window<`u`){lb(u,r);let t=ub(u);p.visualElement=ib(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,L.jsxs)(jy.Provider,{value:p,children:[c&&p.visualElement?(0,L.jsx)(c,{visualElement:p.visualElement,...u}):null,Jy(e,n,tb(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,I.forwardRef)(s);return c[eb]=e,c}function cb({layoutId:e}){let t=(0,I.useContext)(Dc).id;return t&&e!==void 0?t+`-`+e:e}function lb(e,t){(0,I.useContext)(wy).strict}function ub(e){let{drag:t,layout:n}=Oy();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function db(e,t){if(typeof Proxy>`u`)return sb;let n=/* @__PURE__ */ new Map,r=(n,r)=>sb(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,sb(a,void 0,e,t)),n.get(a))})}var fb=(e,t)=>t.isSVG??qy(e)?new ry(t):new R_(t,{allowProjection:e!==I.Fragment}),pb=class extends Qv{constructor(e){super(e),e.animationState||=sy(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();__(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},mb=0,hb={animation:{Feature:pb},exit:{Feature:class extends Qv{constructor(){super(...arguments),this.id=mb++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Kp(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},gb=class extends Qv{constructor(e){super(e),this.removeGroupControls=zc,this.removeListeners=zc,this.controls=new Pv(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||zc}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},_b=e=>(t,n)=>{e&&Pu.update(()=>e(t,n),!1,!0)},vb=class extends Qv{constructor(){super(...arguments),this.removePointerDownListener=zc}onPointerDown(e){this.session=new ov(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:_b(e),onStart:_b(t),onMove:_b(n),onEnd:(e,t)=>{delete this.session,r&&Pu.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=H_(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},yb=!1,bb=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),xb=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},Sb=class extends I.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),yb&&i.root.didUpdate(),i.options.layoutId!==r&&xb(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...bb(this.props),onExitComplete:()=>this.safeToRemove()})),kg.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),xb(o,n)),o.setOptions({...o.options,...bb(this.props)}),yb=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Pu.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),Eh.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;yb=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Cb(e){let[t,n]=by(),r=(0,I.useContext)(Dc);return(0,L.jsx)(Sb,{...e,layoutGroup:r,switchLayoutGroup:(0,I.useContext)(nb),isPresent:t,safeToRemove:n})}var wb={pan:{Feature:vb},drag:{Feature:gb,ProjectionNode:h_,MeasureLayout:Cb}};function Tb(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&Pu.postRender(()=>o(t,B_(t)))}var Eb=class extends Qv{mount(){let{current:e}=this.node;e&&(this.unmount=Uv(e,(e,t)=>(Tb(this.node,t,`Hover`,`Start`),e=>Tb(this.node,e,`Hover`,`End`))))}unmount(){}},Db=class extends Qv{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Bc(f_(this.node.current,`focus`,()=>this.onFocus()),f_(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Ob(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||Tb(e,t,`Tap`,n)}var kb=class extends Qv{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Zv(e,(e,t)=>(Ob(this.node,t,`Start`),(e,{success:t})=>Ob(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Ab=/* @__PURE__ */ new WeakMap,jb=/* @__PURE__ */ new WeakMap,Mb=e=>{let t=Ab.get(e.target);t&&t(e)},Nb=e=>{e.forEach(Mb)};function Pb({root:e,...t}){let n=e||document;jb.has(n)||jb.set(n,{});let r=jb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Nb,{root:e,...t})),r[i]}function Fb(e,t,n){let r=Pb(t);return Ab.set(e,n),r.observe(e),()=>{Ab.delete(e),r.unobserve(e)}}var Ib={some:0,all:1},Lb=class extends Qv{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Ib[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Fb(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Rb(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Rb({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var zb=/*@__PURE__*/ db(/* @__PURE__ */ Object.assign({},hb,{inView:{Feature:Lb},tap:{Feature:kb},focus:{Feature:Db},hover:{Feature:Eb}},wb,{layout:{ProjectionNode:h_,MeasureLayout:Cb}}),fb);function Bb(){!T_.current&&D_();let[e]=(0,I.useState)(w_.current);return e}function Vb(e){return typeof e==`object`&&!Array.isArray(e)}function Hb(e,t,n,r){return e==null?[]:typeof e==`string`&&Vb(t)?Am(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Ub(e,t,n){return e*(t+1)+n*t}function Wb(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function Gb(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):Wb(t,r)??e}function Kb(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(Mc(e,i),r--)}}function qb(e,t,n,r,i,a){Kb(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:pu(i,a,r[o]),easing:/* @__PURE__ */ cl(n,o)})}function Jb(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Yb(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Xb=`easeInOut`,Zb=20;function Qb(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map,l={},u=/* @__PURE__ */ new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:Gb(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=tx(e),{delay:l=0,times:u=hd(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(a,s):l,S=c.length,C=If(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&ix(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=/* @__PURE__ */ Uc(b));let r=Vu(n,e,C);v=r.ease,b=r.duration}b??=o;let w=f+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&md(u,T),c.length===1&&c.unshift(null),m&&m<Zb){let e=b>0?g/b:0;b=Ub(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?/* @__PURE__ */ Xc(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:/* @__PURE__ */ cl(f,e-1))}Jb(u,m,e)}let E=w+b;qb(r,c,v,u,w,E),y=Math.max(x+b,y),p=Math.max(E,p)};if($p(g)){let e=$b(g,c);b(_,v,ex(`default`,e))}else{let e=Hb(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=$b(r,c);for(let e in _)b(_[e],nx(v,e),ex(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};return m(e,0),a&&(a.duration=p,a.labels=u),c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Yb);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(/* @__PURE__ */ Vc(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(Xb)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o;let{type:d,...f}=t;u.transition[i]={...f,duration:p,ease:l,times:c,...n}}}),s}function $b(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function ex(e,t){return t[e]||(t[e]=[]),t[e]}function tx(e){return Array.isArray(e)?e:[e]}function nx(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var rx=e=>typeof e==`number`,ix=e=>e.every(rx);function ax(e,t){return $p(e)||typeof e==`number`||typeof e==`string`&&!Vb(t)}function ox(e,t,n,r){let i=[];if(ax(e,t))i.push(Oh(e,Vb(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Hb(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...wh(r,t,s,g_.get(r))):i.push(...Cm(xm(r)??Th,r,t,s))}}return i}function sx(e,t,n,r){let i=[];return Qb(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Ap(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:ud},r).forEach(({keyframes:e,transition:t},n)=>{i.push(...ox(n,e,t))}),i}var cx=0;function lx(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var ux=(e,t)=>t===void 0?e:{name:e,at:t};function dx(e){e.pause(),e.time=0,e.stop()}var fx=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=/* @__PURE__ */ new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new wp(n),this.watch()):(this.invalidate(),this.flush());let{scope:r}=t;r&&(r.animations.push(this),this.finished.then(()=>Mc(r.animations,this)))}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+cx++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+cx++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=Math.abs(this.speed);return this.speed=t<this.time?-n:n,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&this.build()}adopt(e){this.group&&=(dx(this.group),void 0),this.isDirty=!1,this.parent=e}build(){this.isDirty=!1,this.isWrapped=!1;let e=this.group,t=0;e&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),e.cancel()):(t=e.animations.length?e.time:0,dx(e)),this.isRebuilding=!1);let{defaultTransition:n,onComplete:r,onUpdate:i,onRepeat:a,onReverseComplete:o,autoplay:s,scope:c,...l}=this.options,u={};c?.reduceMotion!==void 0&&(u.reduceMotion=c.reduceMotion),c?.skipAnimations!==void 0&&(u.skipAnimations=c.skipAnimations),Object.assign(u,l);let d=/* @__PURE__ */ new Map,f={},p=sx(this.toSequence(d),{defaultTransition:n,...u},c,f),m=f.labels,h=u.duration??f.duration,g=f.duration?h/f.duration:1;if(m.forEach((e,t)=>m.set(t,e*g)),this.markers=[],d.forEach((e,t)=>{e.time=m.get(t),m.delete(t),h=Math.max(h,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=m,this.totalDuration=h,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||i||a){let e=this.clock=Ap(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),p.unshift(this.clockAnimation=Oh(e,[0,h],{...u,duration:h,ease:`linear`}))}let _=this.group=new wp(p);t=Math.min(t,h),this.isDone&&t<h&&this.newFinished(),this.scrollTimeline?this.detachScroll=_.attachTimeline(this.scrollTimeline):(_.speed=this.playbackSpeed,this.isPaused&&_.pause(),t&&(_.time=t)),this.repeatIndex=this.currentRepeat(),this.prevTime=t||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),ux(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?ux(n,r):r===void 0?n:Array.isArray(n)?lx(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:Wb(e,this.labels)??this.time}currentRepeat(){let{repeat:e=0,repeatDelay:t=0,delay:n=0}=this.options,r=this.totalDuration+t,i=(this.clockAnimation?.time??0)-n;return r&&i>0?Math.min(e,Math.floor(i/r)):0}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat();if(a!==this.repeatIndex&&(this.repeatIndex=a,r?.(),i===`loop`)){let e=this.speed>0;if(this.cross(t,e?this.totalDuration:0))return;t=e?-1:1/0}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=e,!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options;(this.speed<0&&n||t)?.(),this.resolveFinished()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e})}};function px(e){return Array.isArray(e)&&e.some(Array.isArray)}function mx(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=Dm.current,s=o?.transition,c={};n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r);let l;if(px(e)){let n={...c,...i,scope:t};s&&(n.defaultTransition={...s,...n.defaultTransition}),l=new fx(e,n)}else{let{onComplete:n,...r}=a||{},o={...c,...s,...r},{onUpdate:u}=r;l=new fx([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...o,onUpdate:void 0}]:[e,i,o]],{...c,onComplete:n,scope:t},ox(e,i,o,t))}return o&&l.finished.then(o.add(()=>l.stop())),l}return i}var hx=/* @__PURE__ */ Object.assign(/* @__PURE__ */ mx(),{addEffect:ym,removeEffect:bm}),gx=zb;function _x(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var vx=e=>{switch(e){case`success`:return xx;case`info`:return Cx;case`warning`:return Sx;case`error`:return wx;default:return null}},yx=Array(12).fill(0),bx=({visible:e,className:t})=>/*#__PURE__*/ I.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},/*#__PURE__*/ I.createElement(`div`,{className:`sonner-spinner`},yx.map((e,t)=>/*#__PURE__*/ I.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),xx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Sx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Cx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),wx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Tx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),/*#__PURE__*/ I.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Ex=()=>{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Dx=1,Ox=100,kx=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Dx++,Ax=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Ox;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=kx(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],I.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Mx(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=kx(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=/* @__PURE__ */ new Set,this.pendingDismissals=/* @__PURE__ */ new Map}},jx=(e,t)=>Ax.message(e,t),Mx=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Nx=Object.assign(jx,{success:Ax.success,info:Ax.info,warning:Ax.warning,error:Ax.error,custom:Ax.custom,message:Ax.message,promise:Ax.promise,dismiss:Ax.dismiss,loading:Ax.loading},{getHistory:()=>Ax.toasts,getToasts:()=>Ax.getActiveToasts()});_x(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Px(e){return e.label!==void 0}var Fx=3,Ix=`24px`,Lx=`16px`,Rx=4e3,zx=356,Bx=14,Vx=45,Hx=200;function Ux(...e){return e.filter(Boolean).join(` `)}function Wx(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Gx=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=I.useState(null),[O,k]=I.useState(null),[A,ee]=I.useState(!1),[te,j]=I.useState(!1),[M,ne]=I.useState(!1),[N,P]=I.useState(!1),[F,re]=I.useState(!1),[ie,ae]=I.useState(0),[oe,se]=I.useState(0),ce=I.useRef(n.duration||y||Rx),le=I.useRef(null),ue=I.useRef(null),de=c===0,L=c+1<=o,fe=n.type,R=fe??`default`,z=n.dismissible!==!1,pe=n.className||``,me=n.descriptionClassName||``,he=I.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ge=I.useMemo(()=>n.closeButton??p,[n.closeButton,p]),B=I.useMemo(()=>n.duration||y||Rx,[n.duration,y]),_e=I.useRef(0),ve=I.useRef(0),ye=I.useRef(0),V=I.useRef(null),[be,xe]=b.split(`-`),Se=I.useMemo(()=>s.reduce((e,t,n)=>n>=he?e:e+t.height,0),[s,he]),Ce=Ex(),we=I.useMemo(()=>e.swipeDirections??Wx(b),[e.swipeDirections,b]),Te=n.invert||t,Ee=fe===`loading`;ve.current=I.useMemo(()=>he*x+Se,[he,Se]),I.useEffect(()=>{ce.current=B},[B]),I.useEffect(()=>{ee(!0)},[]),I.useEffect(()=>{let e=ue.current;if(e){let t=e.getBoundingClientRect().height;return se(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),I.useLayoutEffect(()=>{if(!A)return;let e=ue.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,se(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=I.useCallback(()=>{j(!0),ae(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Hx)},[n,d,a,ve]);I.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ce?(()=>{if(ye.current<_e.current){let e=(/* @__PURE__ */ new Date()).getTime()-_e.current;ce.current-=e}ye.current=(/* @__PURE__ */ new Date()).getTime()})():ce.current!==1/0&&(_e.current=(/* @__PURE__ */ new Date()).getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},ce.current)),()=>clearTimeout(e)},[u,i,n,fe,Ce,De]),I.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?/*#__PURE__*/ I.createElement(`div`,{className:Ux(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":fe===`loading`},w.loading):/*#__PURE__*/ I.createElement(bx,{className:Ux(C?.loader,n?.classNames?.loader),visible:fe===`loading`})}let ke=n.icon||w?.[fe]||vx(fe);return/*#__PURE__*/ I.createElement(`li`,{tabIndex:0,ref:ue,className:Ux(_,pe,C?.toast,n?.classNames?.toast,C?.[R],n?.classNames?.[R]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":F,"data-removed":te,"data-visible":L,"data-y-position":be,"data-x-position":xe,"data-index":c,"data-front":de,"data-swiping":M,"data-dismissible":z,"data-type":fe,"data-invert":Te,"data-swipe-out":N,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${te?ie:ve.current}px`,"--initial-height":S?`auto`:`${oe}px`,...m,...n.style},onDragEnd:()=>{ne(!1),D(null),V.current=null},onPointerDown:e=>{e.button!==2&&!Ee&&z&&(le.current=/* @__PURE__ */ new Date,ae(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(ne(!0),V.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(N||!z)return;V.current=null;let e=Number(ue.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ue.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=(/* @__PURE__ */ new Date()).getTime()-le.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?we.includes(e>0?`right`:`left`):we.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Vx||a>.11))ae(ve.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),P(!0);else{var o,s;(o=ue.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ue.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),re(!1),ne(!1),D(null)}},onPointerMove:e=>{var t,n;if(!V.current||!z||window.getSelection()?.toString().length>0)return;let r=e.clientY-V.current.y,i=e.clientX-V.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(we.includes(`top`)||we.includes(`bottom`)){if(we.includes(`top`)&&r<0||we.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(we.includes(`left`)||we.includes(`right`))){if(we.includes(`left`)&&i<0||we.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&re(!0),(t=ue.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ue.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ge&&!n.jsx&&fe!==`loading`?/*#__PURE__*/ I.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!z?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Ux(C?.closeButton,n?.classNames?.closeButton)},w?.close??Tx):null,(fe||n.icon||n.promise)&&n.icon!==null&&(w?.[fe]!==null||n.icon)?/*#__PURE__*/ I.createElement(`div`,{"data-icon":``,className:Ux(C?.icon,n?.classNames?.icon)},fe===`loading`?n.icon||Oe():n.promise?Oe():null,fe===`loading`?null:ke):null,/*#__PURE__*/ I.createElement(`div`,{"data-content":``,className:Ux(C?.content,n?.classNames?.content)},/*#__PURE__*/ I.createElement(`div`,{"data-title":``,className:Ux(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?/*#__PURE__*/ I.createElement(`div`,{"data-description":``,className:Ux(v,me,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),/*#__PURE__*/ I.isValidElement(n.cancel)?n.cancel:n.cancel&&Px(n.cancel)?/*#__PURE__*/ I.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Px(n.cancel)&&z&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:Ux(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,/*#__PURE__*/ I.isValidElement(n.action)?n.action:n.action&&Px(n.action)?/*#__PURE__*/ I.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Px(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:Ux(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Kx(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function qx(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Lx:Ix;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Jx=/*#__PURE__*/ I.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Fx,toastOptions:g,dir:_=Kx(),gap:v=Bx,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=I.useState([]),w=I.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=I.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=I.useState([]),[O,k]=I.useState(!1),[A,ee]=I.useState(!1),[te,j]=I.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),M=I.useRef(null),ne=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),N=I.useRef(null),P=I.useRef(!1),F=I.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Ax.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return I.useEffect(()=>Ax.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Xt.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),I.useEffect(()=>{if(d!==`system`){j(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?j(`dark`):j(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{j(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{j(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),I.useEffect(()=>{S.length<=1&&k(!1)},[S]),I.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=M.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===M.current||M.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),I.useEffect(()=>{if(M.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,P.current=!1)}},[M.current]),/*#__PURE__*/ I.createElement(`section`,{ref:t,"aria-label":b??`${x} ${ne}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?/*#__PURE__*/ I.createElement(`ol`,{key:t,dir:_===`auto`?Kx():_,tabIndex:-1,ref:M,className:c,"data-sonner-toaster":!0,"data-sonner-theme":te,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${zx}px`,"--gap":`${v}px`,...m,...qx(l,u)},onBlur:e=>{P.current&&!e.currentTarget.contains(e.relatedTarget)&&(P.current=!1,N.current&&=(N.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||P.current||(P.current=!0,N.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ee(!0)},onPointerUp:()=>ee(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>/*#__PURE__*/ I.createElement(Gx,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:F,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),Yx=/* @__PURE__ */ new Map([[`avif`,`image/avif`],[`bmp`,`image/bmp`],[`css`,`text/css`],[`csv`,`text/csv`],[`doc`,`application/msword`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`gif`,`image/gif`],[`gz`,`application/gzip`],[`htm`,`text/html`],[`html`,`text/html`],[`ico`,`image/x-icon`],[`jpeg`,`image/jpeg`],[`jpg`,`image/jpeg`],[`js`,`application/javascript`],[`json`,`application/json`],[`md`,`text/markdown`],[`mjs`,`application/javascript`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`ogg`,`audio/ogg`],[`pdf`,`application/pdf`],[`png`,`image/png`],[`ppt`,`application/powerpoint`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`svg`,`image/svg+xml`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`txt`,`text/plain`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`weba`,`audio/webm`],[`webm`,`video/webm`],[`webp`,`image/webp`],[`xls`,`application/vnd.ms-excel`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xml`,`application/xml`],[`zip`,`application/zip`]]),Xx=class extends Error{constructor(e){super(`DataTransferItem is not a file`),this.item=e,this.name=`UnexpectedObjectError`}};function Zx(e,t,n){let r=e,{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&$x(r,`path`,a),n!==void 0&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),$x(r,`relativePath`,a),r}function Qx(e,t=Yx){let{name:n}=e;if(n&&n.lastIndexOf(`.`)!==-1&&!e.type){let r=n.split(`.`).pop().toLowerCase(),i=t.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function $x(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var eS=[`.DS_Store`,`Thumbs.db`];async function tS(e,{mimeTypes:t=Yx}={}){return(await nS(e)).map(e=>e instanceof File?Qx(e,t):e)}async function nS(e){return oS(e)&&rS(e.dataTransfer)?lS(e.dataTransfer,e.type):iS(e)?uS(e.clipboardData):aS(e)?sS(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?cS(e):[]}function rS(e){return oS(e)}function iS(e){return oS(e)&&rS(e.clipboardData)}function aS(e){return oS(e)&&oS(e.target)}function oS(e){return typeof e==`object`&&!!e}function sS(e){return fS(e.target.files).map(e=>Zx(e))}async function cS(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>Zx(e))}async function lS(e,t){let n=fS(e.items).filter(e=>e.kind===`file`);return t===`drop`?dS(mS(await Promise.all(n.map(pS)))):n}function uS(e){let t=fS(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return dS((t.length>0?t:fS(e.files)).map(e=>Zx(e)))}function dS(e){return e.filter(e=>eS.indexOf(e.name)===-1)}function fS(e){return e===null?[]:Array.from(e)}async function pS(e){if(typeof e.webkitGetAsEntry!=`function`)return hS(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let n=await gS(e);return n?.kind===`directory`?_S(n,`/${n.name}`):yS(t)}return hS(e,t)}function mS(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...mS(n)):t.push(n);return t}async function hS(e,t){let n=e.getAsFile(),r=await gS(e);if(r!=null){let e=n??await r.getFile();return e.handle=r,Zx(e)}if(!n)throw new Xx(e);return Zx(n,t?.fullPath??void 0)}async function gS(e){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`)return e.getAsFileSystemHandle()}async function _S(e,t){let n=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if(r.kind===`directory`)n.push(...await _S(r,e));else{let t=await r.getFile();n.push(Zx(t,e,r))}}return n}async function vS(e){return e.isDirectory?yS(e):bS(e)}function yS(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(vS));r.push(e),i()}else try{e(await Promise.all(r))}catch(e){n(e)}},e=>{n(e)})}i()})}async function bS(e){return new Promise((t,n)=>{e.file(n=>{t(Zx(n,e.fullPath))},e=>{n(e)})})}function xS(e,t){if(e&&t){let n=(Array.isArray(t)?t:t.split(`,`)).filter(e=>e.trim()!==``);if(n.length===0)return!0;let r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(e=>{let t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}var SS=typeof xS==`function`?xS:xS.default,CS=`file-invalid-type`,wS=`file-too-large`,TS=`file-too-small`,ES=`too-many-files`;function DS(e=``){let t=e.split(`,`);return{code:CS,message:`File type must be ${t.length>1?`one of ${t.join(`, `)}`:t[0]}`}}var OS=[`KB`,`MB`,`GB`,`TB`,`PB`];function kS(e){if(e<1024)return`${e} ${e===1?`byte`:`bytes`}`;let t=e/1024,n=0;for(;t>=1024&&n<OS.length-1;)t/=1024,n++;return`${Number(t.toFixed(2))} ${OS[n]}`}function AS(e){return{code:wS,message:`File is larger than ${kS(e)}`}}function jS(e){return{code:TS,message:`File is smaller than ${kS(e)}`}}var MS={code:ES,message:`Too many files`};function NS(e){return e.type===``&&typeof e.getAsFile==`function`}function PS(e,t){let n=e.type===`application/x-moz-file`||SS(e,t??``)||NS(e);return[n,n?null:DS(t)]}function FS(e,t,n){if(IS(e.size)){if(IS(t)&&IS(n)){if(e.size>n)return[!1,AS(n)];if(e.size<t)return[!1,jS(t)]}else if(IS(t)&&e.size<t)return[!1,jS(t)];else if(IS(n)&&e.size>n)return[!1,AS(n)]}return[!0,null]}function IS(e){return e!=null}function LS(e){return e!=null&&typeof e.then==`function`}function RS({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:a=0,validator:o,getErrorMessage:s}){let c=[],l=[],u=(e,t)=>s&&typeof File<`u`&&t instanceof File?{...e,message:s(e,t)}:e;e.forEach(e=>{let[i,a]=PS(e,t),[o,s]=FS(e,n,r);i&&o?c.push(e):l.push({file:e,errors:[a,s].filter(e=>e!=null).map(t=>u(t,e))})});let d=i?a>=1?a:1/0:1;return c.length>d&&c.slice(d).forEach(e=>{l.push({file:e,errors:[u(MS,e)]})}),l.length>0?{verdict:`reject`,rejections:l}:{verdict:o?`unknown`:`accept`,rejections:l}}function zS(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble!==void 0&&e.cancelBubble}function BS(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>e===`Files`||e===`application/x-moz-file`)||Array.prototype.some.call(t.items??[],VS):!!e.target&&!!e.target.files}function VS(e){return typeof e==`object`&&!!e&&e.kind===`file`}function HS(e){e.preventDefault()}function US(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function WS(e){return e.indexOf(`Edge/`)!==-1}function GS(e=window.navigator.userAgent){return US(e)||WS(e)}function KS(...e){return(t,...n)=>e.some(e=>(!zS(t)&&e&&e(t,...n),zS(t)))}function qS(){return`showOpenFilePicker`in window}function JS(e){return Array.isArray(e)?e:typeof e==`string`?[e]:[]}function YS(e){if(IS(e))return Array.isArray(e)?e.filter(e=>IS(e)&&IS(e.accept)):[{accept:e}]}function XS(e){let t=[],n=Object.keys(e);for(let n of Object.values(e))for(let e of JS(n))t.includes(e)||t.push(e);return t.length>0?t.join(`, `):n.length>0?n.join(`, `):`Files`}function ZS(e){let t=YS(e);if(!IS(t))return;let n={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=n[t]??(n[t]=[]);for(let t of JS(r))e.includes(t)||e.push(t)}return n}function QS(e){let t=YS(e);if(!IS(t))return;let n=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let n=!0;return rC(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),n=!1),(Array.isArray(t)||typeof t==`string`)&&JS(t).every(aC)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),n=!1),n}).reduce((e,[t,n])=>(e[t]=JS(n),e),{});return{description:IS(e.description)&&e.description!==``?e.description:XS(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return n.length>0?n:void 0}function $S(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(IS(e))return Object.entries(e).reduce((e,[n,r])=>{let i=JS(r);return t&&iC(n)&&i.some(aC)?e.push(...i):e.push(n,...i),e},[]).filter(e=>rC(e)||aC(e)).join(`,`)}function eC(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function tC(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function nC(e){return e instanceof DOMException&&e.name===`NotAllowedError`}function rC(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function iC(e){return e.endsWith(`/*`)}function aC(e){return/^.*\.[\w]+$/.test(e)}var oC=(0,I.forwardRef)(({children:e,...t},n)=>{let{open:r,...i}=cC(t);return(0,I.useImperativeHandle)(n,()=>({open:r}),[r]),/* @__PURE__ */ (0,L.jsx)(L.Fragment,{children:e?.({...i,open:r})})});oC.displayName=`Dropzone`;var sC={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function cC(e={}){let{accept:t,disabled:n=!1,getFilesFromEvent:r=tS,maxSize:i=1/0,minSize:a=0,multiple:o=!0,maxFiles:s=0,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,onDropAccepted:f,onDropRejected:p,onFileDialogCancel:m,onFileDialogOpen:h,useFsAccessApi:g=!1,autoFocus:_=!1,preventDropOnDocument:v=!0,noClick:y=!1,noKeyboard:b=!1,noDrag:x=!1,noDragEventsBubbling:S=!1,noPaste:C=!1,onError:w,validator:T,getErrorMessage:E}=e,D=(0,I.useMemo)(()=>ZS(t),[t]),O=(0,I.useMemo)(()=>$S(D),[D]),k=(0,I.useMemo)(()=>$S(D,{omitWildcardMimeTypesWithExtensions:!0}),[D]),A=(0,I.useMemo)(()=>QS(t),[t]),ee=(0,I.useMemo)(()=>typeof h==`function`?h:uC,[h]),te=(0,I.useMemo)(()=>typeof m==`function`?m:uC,[m]),j=(0,I.useRef)(null),M=(0,I.useRef)(null),[ne,N]=(0,I.useReducer)(lC,sC),{isFocused:P,isFileDialogActive:F}=ne,re=(0,I.useRef)(F);re.current=F;let ie=(0,I.useRef)(null),ae=(0,I.useCallback)(()=>{ie.current?.abort();let e=new AbortController;return ie.current=e,N({type:`setProcessing`,isProcessing:!0}),e.signal},[]),oe=(0,I.useCallback)(e=>{e.aborted||N({type:`setProcessing`,isProcessing:!1})},[]);(0,I.useEffect)(()=>()=>ie.current?.abort(),[]);let se=(0,I.useRef)(typeof window<`u`&&window.isSecureContext&&g&&qS()),ce=()=>{!se.current&&F&&setTimeout(()=>{if(M.current){let{files:e}=M.current;e?.length||(N({type:`closeDialog`}),te())}},300)};(0,I.useEffect)(()=>(window.addEventListener(`focus`,ce,!1),()=>{window.removeEventListener(`focus`,ce,!1)}),[M,F,te,se]);let le=(0,I.useRef)([]),ue=(0,I.useRef)([]),de=e=>{j.current&&e.target&&j.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),le.current=[])};(0,I.useEffect)(()=>(v&&(document.addEventListener(`dragover`,HS,!1),document.addEventListener(`drop`,de,!1)),()=>{v&&(document.removeEventListener(`dragover`,HS),document.removeEventListener(`drop`,de))}),[j,v]),(0,I.useEffect)(()=>{let e=e=>{e.target&&(ue.current=[...ue.current,e.target]),BS(e)&&N({isDragGlobal:!0,type:`setDragGlobal`})},t=e=>{ue.current=ue.current.filter(t=>t!==e.target&&t!==null),!(ue.current.length>0)&&N({isDragGlobal:!1,type:`setDragGlobal`})},n=()=>{ue.current=[],N({isDragGlobal:!1,type:`setDragGlobal`})},r=()=>{ue.current=[],N({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[j]),(0,I.useEffect)(()=>(!n&&_&&j.current&&j.current.focus(),()=>{}),[j,_,n]);let L=(0,I.useCallback)(e=>{w?w(e):console.error(e)},[w]),fe=(0,I.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e),!re.current&&(le.current=[...le.current,e.target],BS(e)&&Promise.resolve(r(e)).then(t=>{if(zS(e)&&!S)return;let n=t.length>0?RS({files:t,accept:O,minSize:a,maxSize:i,multiple:o,maxFiles:s,validator:T,getErrorMessage:E}):null;N({isDragAccept:n?.verdict===`accept`,isDragReject:n?.verdict===`reject`,isDragUnknown:n?.verdict===`unknown`,isDragActive:!0,dragFileRejections:n?.rejections??[],type:`setDraggedFiles`}),c&&c(e)}).catch(e=>L(e)))},[r,c,L,S,O,a,i,o,s,T,E]),R=(0,I.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),re.current)return!1;let t=BS(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&u&&u(e),!1},[u,S]),z=(0,I.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e);let t=le.current.filter(e=>j.current?.contains(e)),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),le.current=t,!(t.length>0)&&(N({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),BS(e)&&l&&l(e))},[j,l,S]),pe=(0,I.useCallback)(async(e,t,n)=>{let r=(e,t)=>E?{...e,message:E(e,t)}:e,c=e=>{let n=[],i=[];e.forEach(({file:e,accepted:t,acceptError:a,sizeMatch:o,sizeError:s,customErrors:c})=>{let l=!c||Array.isArray(c)&&c.length===0;if(t&&o&&l)n.push(e);else{let t=[a,s];c&&(t=t.concat(c)),i.push({file:e,errors:t.filter(e=>e!=null).map(t=>r(t,e))})}});let a=o?s>=1?s:1/0:1;n.length>a&&n.splice(a).forEach(e=>{i.push({file:e,errors:[r(MS,e)]})}),N({acceptedFiles:n,fileRejections:i,type:`setFiles`}),d&&d(n,i,t),i.length>0&&p&&p(i,t),n.length>0&&f&&f(n,t)},l=e.map(e=>{let[t,n]=PS(e,k),[r,o]=FS(e,a,i);return{file:e,accepted:t,acceptError:n,sizeMatch:r,sizeError:o,customErrors:T?T(e):null}});if(!l.some(({customErrors:e})=>LS(e))){c(l);return}let u;try{u=await Promise.all(l.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){n.aborted||(oe(n),L(e));return}n.aborted||c(u)},[N,o,k,a,i,s,d,f,p,T,E,L,oe]),me=(0,I.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),le.current=[],!(re.current&&e.dataTransfer)&&(N({type:`reset`}),BS(e))){let t=ae();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(zS(e)&&!S)oe(t);else return pe(n,e,t)}}).catch(e=>{t.aborted||(oe(t),L(e))})}},[r,pe,L,S,ae,oe]),he=(0,I.useCallback)(e=>{if(!BS(e))return;e.preventDefault(),e.persist?.(),Ce(e);let t=ae();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(zS(e)&&!S)oe(t);else return pe(n,e,t)}}).catch(e=>{t.aborted||(oe(t),L(e))})},[r,pe,L,S,ae,oe]),ge=(0,I.useCallback)(()=>{if(se.current){N({type:`openDialog`}),ee();let e={multiple:o,types:A},t;window.showOpenFilePicker(e).then(e=>(t=ae(),r(e))).then(e=>{if(N({type:`closeDialog`}),!t.aborted)return pe(e,null,t)}).catch(e=>{t&&oe(t),eC(e)?(te(e),N({type:`closeDialog`})):tC(e)||nC(e)?(se.current=!1,M.current?(M.current.value=``,M.current.click()):L(/* @__PURE__ */ Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):L(e)})}else M.current&&(N({type:`openDialog`}),ee(),M.current.value=``,M.current.click())},[N,ee,te,g,pe,L,A,o,ae,oe]),B=(0,I.useCallback)(e=>{j.current?.isEqualNode(e.target)&&(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),ge())},[j,ge]),_e=(0,I.useCallback)(()=>{N({type:`focus`})},[]),ve=(0,I.useCallback)(()=>{N({type:`blur`})},[]),ye=(0,I.useCallback)(()=>{y||(GS()?setTimeout(ge,0):ge())},[y,ge]),V=e=>n?null:e,be=e=>b?null:V(e),xe=e=>x?null:V(e),Se=e=>C?null:V(e),Ce=e=>{S&&e.stopPropagation()},we=(0,I.useMemo)(()=>({refKey:e=`ref`,role:t,onKeyDown:r,onFocus:i,onBlur:a,onClick:o,onDragEnter:s,onDragOver:c,onDragLeave:l,onDrop:u,onPaste:d,...f}={})=>({onKeyDown:be(KS(r,B)),onFocus:be(KS(i,_e)),onBlur:be(KS(a,ve)),onClick:V(KS(o,ye)),onDragEnter:xe(KS(s,fe)),onDragOver:xe(KS(c,R)),onDragLeave:xe(KS(l,z)),onDrop:xe(KS(u,me)),onPaste:Se(KS(d,he)),role:typeof t==`string`&&t!==``?t:`presentation`,[e]:j,...!n&&!b?{tabIndex:0}:{},...n?{"aria-disabled":!0}:{},...f}),[j,B,_e,ve,ye,fe,R,z,me,he,b,x,C,n]),Te=(0,I.useCallback)(e=>{e.stopPropagation()},[]),Ee=(0,I.useMemo)(()=>({refKey:e=`ref`,onChange:t,onClick:n,...r}={})=>({accept:k,multiple:o,type:`file`,"aria-label":`file upload`,style:{border:0,display:`block`,height:0,margin:0,maxWidth:0,opacity:0,overflow:`hidden`,padding:0,width:0},onChange:V(KS(t,me)),onClick:V(KS(n,Te)),tabIndex:-1,[e]:M,...r}),[M,t,o,me,n]);return{...ne,isFocused:P&&!n,getRootProps:we,getInputProps:Ee,rootRef:j,inputRef:M,open:V(ge)}}function lC(e,t){switch(t.type){case`focus`:return{...e,isFocused:!0};case`blur`:return{...e,isFocused:!1};case`openDialog`:return{...sC,isFileDialogActive:!0};case`closeDialog`:return{...e,isFileDialogActive:!1};case`setDraggedFiles`:return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case`setProcessing`:return{...e,isProcessing:t.isProcessing};case`setFiles`:return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case`setDragGlobal`:return{...e,isDragGlobal:t.isDragGlobal};case`reset`:return{...sC};default:return e}}function uC(){}var dC={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};dC.node;var fC=A(dC),pC={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};pC.node;var mC=A(pC),hC={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};hC.node;var gC=A(hC),_C={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};_C.node;var vC=A(_C),yC={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};yC.node;var bC=A(yC),xC={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};xC.node;var SC=A(xC),CC={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};CC.node;var wC=A(CC),TC={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};TC.node;var EC=A(TC),DC={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};DC.node;var OC=A(DC),kC={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};kC.node;var AC=A(kC),jC={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};jC.node;var MC=A(jC),NC={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};NC.node;var PC=A(NC),FC={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};FC.node;var IC=A(FC),LC={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};LC.node;var RC=A(LC),zC={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};zC.node;var BC=A(zC),VC={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};VC.node;var HC=A(VC),UC={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};UC.node;var WC=A(UC),GC={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};GC.node;var KC=A(GC),qC={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};qC.node;var JC=A(qC),YC={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};YC.node;var XC=A(YC),ZC={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};ZC.node;var QC=A(ZC),$C={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};$C.node;var ew=A($C),tw={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};tw.node;var nw=A(tw),rw={name:`ruler`,size:24,node:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]};rw.node;var iw=A(rw),aw={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};aw.node;var ow=A(aw),sw={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};sw.node;var cw=A(sw),lw={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};lw.node;var uw=A(lw),dw={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};dw.node;var fw=A(dw),pw={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};pw.node;var mw=A(pw),hw={primary:`bg-ink text-ink-contrast hover:opacity-90 disabled:opacity-40`,secondary:`bg-panel text-ink border border-rule hover:border-muted disabled:opacity-50`,ghost:`text-ink hover:bg-raise disabled:opacity-40`},gw={md:`h-9 px-3.5 gap-2 text-[14px]`,lg:`h-11 px-5 gap-2.5 text-[15px]`,icon:`size-9 justify-center`};function _w({variant:e=`secondary`,size:t=`md`,className:n,...r}){return/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,className:k(`inline-flex shrink-0 items-center rounded-lg font-medium transition-[opacity,border-color,background-color]`,hw[e],gw[t],n),...r})}var vw=`__empty`;function yw({value:e,onChange:t,options:n,label:r,className:i}){return/* @__PURE__ */ (0,L.jsx)(gc,{type:`single`,"aria-label":r,value:e===``?vw:String(e),onValueChange:e=>{e&&t(e===vw?``:e)},className:k(`grid auto-cols-fr grid-flow-col rounded-lg bg-raise p-0.5`,i),children:n.map(e=>/* @__PURE__ */ (0,L.jsx)(Tc,{value:e.value===``?vw:String(e.value),className:`num h-8 rounded-md px-2 text-[13px] text-muted transition-colors hover:text-ink data-[state=on]:bg-panel data-[state=on]:text-ink data-[state=on]:shadow-[0_1px_2px_rgb(0_0_0/0.08)]`,children:e.label},e.value))})}function bw({health:e}){let{data:t,isLoading:n,isError:r}=e,[i,a]=n?[`bg-muted`,`Checking server`]:r?[`bg-danger`,`Server unreachable`]:t.slicer?[`bg-ok`,`Slicer ready`]:[`bg-warn`,`Slicing is off on this server`];return/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`hidden items-center gap-2 rounded-full border border-rule px-3 py-1 text-[13px] text-muted sm:inline-flex`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`size-2 rounded-full`,i),"aria-hidden":!0}),a]})}function xw({apiKey:e,onSave:t,needed:n}){let[r,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(e),{portal:c}=i();return/* @__PURE__ */ (0,L.jsxs)(Xa,{open:r,onOpenChange:t=>{a(t),t&&s(e)},children:[/* @__PURE__ */ (0,L.jsx)(M,{label:`API key`,children:/* @__PURE__ */ (0,L.jsx)(Qa,{asChild:!0,children:/* @__PURE__ */ (0,L.jsxs)(_w,{variant:`ghost`,size:`icon`,"aria-label":`API key`,className:`relative`,children:[/* @__PURE__ */ (0,L.jsx)(BC,{className:`size-[18px]`,"aria-hidden":!0}),n&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`absolute top-1.5 right-1.5 size-2 rounded-full bg-danger`,"aria-hidden":!0})]})})}),/* @__PURE__ */ (0,L.jsx)(no,{container:c,children:/* @__PURE__ */ (0,L.jsx)(io,{align:`end`,sideOffset:8,className:`z-50 w-72 rounded-xl border border-rule bg-panel p-4 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,L.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),t(o.trim()),a(!1)},children:[/* @__PURE__ */ (0,L.jsx)(`label`,{className:`block text-[14px] font-medium`,htmlFor:`api-key`,children:`API key`}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1 mb-3 text-[13px] text-muted`,children:n?`This server needs a key before it lists printers or slices.`:`Only needed when the server asks for one. Kept in this browser.`}),/* @__PURE__ */ (0,L.jsx)(`input`,{id:`api-key`,type:`password`,autoComplete:`off`,value:o,onChange:e=>s(e.target.value),className:`h-10 w-full rounded-lg border border-rule bg-raise px-3 text-[14px] outline-none focus:border-muted`}),/* @__PURE__ */ (0,L.jsx)(_w,{type:`submit`,variant:`primary`,className:`mt-3 w-full justify-center`,children:`Save key`})]})})})]})}var Sw={system:[JC,`Theme: system`],light:[uw,`Theme: light`],dark:[XC,`Theme: dark`]},Cw={system:`light`,light:`dark`,dark:`system`};function ww({mode:e,onMode:t,health:n,onOpenGcode:r,apiKey:i,onSaveKey:a,keyNeeded:o,theme:s,onTheme:c}){let l=e===`advanced`,[u,d]=Sw[s];return/* @__PURE__ */ (0,L.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b border-rule bg-panel px-4`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[/* @__PURE__ */ (0,L.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:`size-6`,"aria-hidden":!0,children:[/* @__PURE__ */ (0,L.jsx)(`rect`,{x:`3`,y:`15`,width:`18`,height:`4`,rx:`1.2`,fill:`currentColor`}),/* @__PURE__ */ (0,L.jsx)(`rect`,{x:`5`,y:`10`,width:`14`,height:`4`,rx:`1.2`,fill:`currentColor`,opacity:`0.65`}),/* @__PURE__ */ (0,L.jsx)(`rect`,{x:`7`,y:`5`,width:`10`,height:`4`,rx:`1.2`,fill:`currentColor`,opacity:`0.35`})]}),/* @__PURE__ */ (0,L.jsx)(`h1`,{className:`display sr-only text-[17px] font-semibold whitespace-nowrap sm:not-sr-only`,children:`Print Preview`})]}),l&&/* @__PURE__ */ (0,L.jsx)(bw,{health:n}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[/* @__PURE__ */ (0,L.jsx)(yw,{label:`Mode`,value:e,onChange:t,className:`mr-1 w-[168px] sm:w-[188px]`,options:[{value:`simple`,label:`Simple`},{value:`advanced`,label:`Advanced`}]}),l&&/* @__PURE__ */ (0,L.jsxs)(_w,{variant:`ghost`,onClick:r,children:[/* @__PURE__ */ (0,L.jsx)(PC,{className:`size-[18px]`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`hidden sm:inline`,children:`Open G-code`})]}),(l||o)&&/* @__PURE__ */ (0,L.jsx)(xw,{apiKey:i,onSave:a,needed:o}),c&&/* @__PURE__ */ (0,L.jsx)(M,{label:d,children:/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,size:`icon`,"aria-label":d,onClick:()=>c(Cw[s]),children:/* @__PURE__ */ (0,L.jsx)(u,{className:`size-[18px]`,"aria-hidden":!0})})})]})]})}function Tw({pick:e,onPick:t,onClose:n}){let{portal:r}=i(),a=(0,I.useMemo)(()=>e?e.plates.map(e=>e.thumbnail?URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`})):null):[],[e]);return(0,I.useEffect)(()=>()=>a.forEach(e=>e&&URL.revokeObjectURL(e)),[a]),/* @__PURE__ */ (0,L.jsx)(Ar,{open:!!e,onOpenChange:e=>{e||n()},children:/* @__PURE__ */ (0,L.jsxs)(Pr,{container:r,children:[/* @__PURE__ */ (0,L.jsx)(Ir,{className:`fixed inset-0 z-50 bg-black/40`}),/* @__PURE__ */ (0,L.jsxs)(Br,{className:`fixed top-1/2 left-1/2 z-50 w-[min(560px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-5 shadow-[0_24px_64px_-24px_rgb(0_0_0/0.5)]`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{children:[/* @__PURE__ */ (0,L.jsx)(Wr,{className:`text-[16px] font-semibold`,children:`Which plate?`}),/* @__PURE__ */ (0,L.jsx)(Gr,{className:`mt-1 text-[13px] text-muted`,children:e&&`${e.file.name} has ${e.plates.length} sliced plates. Open one; you can come back for the others.`})]}),/* @__PURE__ */ (0,L.jsx)(qr,{className:`grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,"aria-label":`Close`,children:/* @__PURE__ */ (0,L.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,L.jsx)(`div`,{className:`mt-4 grid grid-cols-2 gap-3 @sm:grid-cols-3`,children:e&&e.plates.map((e,n)=>/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e.plate),className:`overflow-hidden rounded-xl border border-rule bg-raise text-left transition-colors hover:border-ink`,children:[a[n]?/* @__PURE__ */ (0,L.jsx)(`img`,{src:a[n],alt:``,className:`aspect-square w-full bg-viewer object-contain`}):/* @__PURE__ */ (0,L.jsx)(`div`,{className:`aspect-square w-full bg-viewer`}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num block px-3 py-2 text-[13px] font-medium`,children:[`Plate `,e.plate]})]},e.plate))})})]})]})})}function Ew({show:e,text:t}){return/* @__PURE__ */ (0,L.jsx)(Cy,{children:e&&/* @__PURE__ */ (0,L.jsx)(gx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`pointer-events-none fixed inset-0 z-50 grid place-items-center bg-bench/80 backdrop-blur-sm`,children:/* @__PURE__ */ (0,L.jsx)(`p`,{className:`rounded-2xl border-2 border-dashed border-ink px-8 py-6 font-display text-[18px] font-semibold`,children:t})})})}function Dw({n:e,title:t,done:n,aside:r,children:i}){return/* @__PURE__ */ (0,L.jsxs)(`section`,{className:`border-b border-rule px-5 py-5 last:border-b-0`,children:[/* @__PURE__ */ (0,L.jsxs)(`header`,{className:`mb-3.5 flex items-center gap-2.5`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`num grid size-6 shrink-0 place-items-center rounded-full text-[12px] font-semibold transition-colors`,n?`bg-ink text-ink-contrast`:`border border-rule text-muted`),"aria-hidden":!0,children:n?/* @__PURE__ */ (0,L.jsx)(fC,{className:`size-3.5`,strokeWidth:3}):e}),/* @__PURE__ */ (0,L.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:t}),r&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`ml-auto truncate text-[13px] text-muted`,children:r})]}),i]})}function Ow({label:e,hint:t,children:n}){return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`text-[13px] font-medium`,children:e}),t&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num text-[13px] text-muted`,children:t})]}),n]})}var kw=e=>e>1e6?`${(e/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1e3))} kB`;function Aw({rows:e,selected:t,onSelect:n,onRemove:r,onAdd:i,max:a}){let o=e.length>=a;return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-2`,children:[/* @__PURE__ */ (0,L.jsx)(`ul`,{className:`space-y-1.5`,children:e.map(({item:e,status:i,aside:a,warn:o})=>{let s=e.id===t;return/* @__PURE__ */ (0,L.jsxs)(`li`,{className:k(`flex items-center gap-1 rounded-xl border bg-raise pr-1.5 transition-colors`,s?`border-ink`:`border-rule`),children:[/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,"aria-current":s||void 0,onClick:()=>n(e.id),className:`flex min-w-0 flex-1 items-center gap-3 rounded-xl py-2.5 pl-3 text-left`,children:[/* @__PURE__ */ (0,L.jsx)(_,{className:k(`size-5 shrink-0`,s?`text-ink`:`text-muted`),"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:e.file.name,children:e.file.name}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`block truncate text-[12px]`,o?`text-warn`:`text-muted`),title:i,children:i})]}),a&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num shrink-0 pl-1 text-[13px] font-semibold`,children:a})]}),/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,size:`icon`,className:`size-8`,"aria-label":`Remove ${e.file.name}`,onClick:()=>r(e.id),children:/* @__PURE__ */ (0,L.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})]},e.id)})}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[/* @__PURE__ */ (0,L.jsxs)(_w,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,disabled:o,onClick:i,children:[/* @__PURE__ */ (0,L.jsx)(QC,{className:`size-4`,"aria-hidden":!0}),` Add files`]}),o&&/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[`Up to `,a,` files in one estimate`]})]})]})}var jw=[{id:`PLA`,hint:`Everyday parts, easiest to print`},{id:`PETG`,hint:`Tougher, handles water and some heat`},{id:`ABS`,hint:`Heat-resistant, best in an enclosed printer`},{id:`TPU`,hint:`Flexible, rubber-like`}],Mw=[`PLA`,`PETG`,`ABS`],Nw=[{id:`standard`,label:`Standard`,mm:.2},{id:`medium`,label:`Fine`,mm:.15},{id:`high`,label:`Extra fine`,mm:.1}],Pw=[1,2,3,4,5,6],Fw={printer:``,material:`PLA`,quality:`standard`,infill:15,walls:3};function Iw(e){let t=e||Mw;return jw.filter(e=>t.includes(e.id))}function Lw(e){return{printer:e.printer,material:e.material,process:``,filament:``,quality:e.quality,infill:e.infill,walls:e.walls,supports:e.supports?`true`:`false`,mode:e.mode,gcode:!1}}var Rw=(e,t)=>e===`exact`||e===`estimate`?e:t===!1?`estimate`:`exact`;function zw(e){return/\b(P1S|X1|X1 Carbon|X1E|H2D|H2S|P2S)\b/.test(e)?!0:!/\b(A1|A1 mini|P1P)\b/.test(e)&&null}function Bw(e,t){return e===`ABS`&&zw(t)===!1?`ABS can warp on an open-frame printer like ours; PETG is often a better choice.`:null}var Vw=e=>e.replace(/\s+[\d.]+\s*nozzle$/i,``);function Hw(e){return e?e.printers.map(t=>({value:`printer:`+t,label:t,...t===e.defaultPrinter?{hint:`default`}:{}})):[]}function Uw(e){let t=Math.round(e/60),n=Math.floor(t/60),r=t%60;return n?r?`${n} h ${r} min`:`${n} h`:r?`${r} min`:`under a minute`}var Ww=e=>Math.round(e*100)/100,Gw=(e,t)=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t,maximumFractionDigits:2}).format(e);function Kw(e,t){return e==null?null:t?{low:Math.floor(Ww(e)),high:Math.ceil(Ww(e*(100+t)/100))}:{low:e,high:e}}function qw(e,t){if(!t)return{low:e,high:e};let n=Kw(e/60,t);return{low:n.low*60,high:n.high*60}}function Jw(e,t){if(e.low===e.high)return Gw(e.low,t);let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e);return`${n(e.low)} – ${n(e.high)}`}var Yw=e=>e.low===e.high?`${e.low} g`:`${e.low} – ${e.high} g`;function Xw(e){return e.low===e.high?Uw(e.low):e.high<3600?`${e.low/60} – ${e.high/60} min`:`${Uw(e.low)} – ${Uw(e.high)}`}function Zw(e,t,n,r){let i=Ww(e.weightG*t),a=e.seconds*t,o=r&&r.perGram[n],s=o==null?null:Ww(i*o),c=r&&r.range;return{grams:i,seconds:a,cost:s,currency:r?r.currency:null,range:Kw(s,c),gramsRange:Kw(i,c),secondsRange:qw(a,c)}}function Qw(e,t){let n=e.map(e=>Zw(e.stats,e.copies,e.material,t)),r=[...new Set(e.filter((e,t)=>n[t].cost==null).map(e=>e.material))],i=e=>Ww(n.reduce((t,n)=>t+e(n),0)),a=e=>({low:i(t=>t[e].low),high:i(t=>t[e].high)});return{grams:i(e=>e.grams),seconds:n.reduce((e,t)=>e+t.seconds,0),currency:t?t.currency:null,unpriced:r,cost:r.length?null:i(e=>e.cost),range:r.length?null:a(`range`),gramsRange:a(`gramsRange`),secondsRange:a(`secondsRange`)}}var $w={"model/stl":[`.stl`],"model/3mf":[`.3mf`],"model/obj":[`.obj`],"model/step":[`.step`,`.stp`],"model/iges":[`.iges`,`.igs`]},eT=[{axis:0,label:`Tip forward`,tip:`Tip it toward you, a quarter turn`},{axis:1,label:`Tip sideways`,tip:`Tip it onto its side, a quarter turn`},{axis:2,label:`Spin`,tip:`Spin it on the plate, a quarter turn`}];function tT({rot:e,onRotate:t}){let n=n=>t(e.map((e,t)=>t===n?(e+90)%360:e)),r=e.some(Boolean);return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`mr-1 text-[13px] text-muted`,children:`Turn`}),eT.map(e=>/* @__PURE__ */ (0,L.jsx)(M,{label:e.tip,children:/* @__PURE__ */ (0,L.jsx)(_w,{className:`h-8 px-2.5 text-[13px]`,onClick:()=>n(e.axis),children:e.label})},e.axis)),r&&/* @__PURE__ */ (0,L.jsx)(M,{label:`Back to how the file has it`,children:/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,size:`icon`,className:`size-8`,"aria-label":`Undo turns`,onClick:()=>t([0,0,0]),children:/* @__PURE__ */ (0,L.jsx)(ew,{className:`size-4`,"aria-hidden":!0})})})]})}function nT({item:e,stale:t}){return e.error?{item:e,status:e.error,warn:!0}:e.result?t?{item:e,status:`Settings changed, slice again`,warn:!0}:{item:e,status:`${e.result.stats.weightG} g, ${Uw(e.result.stats.seconds)}`}:{item:e,status:`${kw(e.file.size)}, not sliced yet`}}function rT({files:e,onFiles:t,model:n,rot:r,onRotate:i}){let{getRootProps:a,getInputProps:o,isDragActive:s,open:c}=cC({accept:$w,multiple:!0,maxSize:52428800,noDragEventsBubbling:!0,noClick:!!n,onDrop:e=>{e.length&&t(e)}}),l=e.rows.length>1,u=e.rows.filter(e=>e.item.result&&!e.stale),d=u.length>1&&Qw(u.map(e=>({stats:e.item.result.stats,copies:1,material:e.item.result.material})),null);return/* @__PURE__ */ (0,L.jsxs)(Dw,{n:1,title:l?`Models`:`Model`,done:!!n,aside:l?`${e.rows.length} files`:void 0,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{...a(),className:k(`rounded-xl outline-none`,!n&&`cursor-pointer`,s&&n&&`ring-2 ring-ink ring-offset-2 ring-offset-panel`),children:[/* @__PURE__ */ (0,L.jsx)(`input`,{...o()}),n?/* @__PURE__ */ (0,L.jsx)(Aw,{rows:e.rows.map(nT),selected:e.selected,max:e.max,onSelect:e.onSelect,onRemove:e.onRemove,onAdd:c}):/* @__PURE__ */ (0,L.jsxs)(`div`,{className:k(`flex flex-col items-center gap-2 rounded-xl border-2 border-dashed border-rule px-4 py-7 text-center transition-colors hover:border-muted`,s&&`border-ink bg-raise`),children:[/* @__PURE__ */ (0,L.jsx)(fw,{className:`size-6 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[14px] font-medium`,children:s?`Drop the files to use them`:`Drop models here, or choose them`}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`text-[12px] text-muted`,children:[`STL, 3MF, OBJ, STEP or IGES, up to `,e.max,` files of 50 MB each`]})]})]}),d&&/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`num mt-2 text-[13px] text-muted`,children:[`Total for `,u.length,` sliced models: `,d.grams,` g, `,Uw(d.seconds)]}),n&&/* @__PURE__ */ (0,L.jsx)(tT,{rot:r,onRotate:i}),l&&/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2 rounded-lg bg-raise py-1 pr-1 pl-3`,children:[/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`min-w-0 truncate text-[13px] text-muted`,children:[`Steps 2 to 4 are for `,/* @__PURE__ */ (0,L.jsx)(`span`,{className:`font-medium text-ink`,children:n.name})]}),/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,onClick:()=>e.onApplyAll(e.selected),children:`Use for all`})]})]})}var iT=1,aT=.9,oT=.8,sT=.17,cT=.1,lT=.999,uT=.9999,dT=.99,fT=/[\\\/_+.#"@\[\(\{&]/,pT=/[\\\/_+.#"@\[\(\{&]/g,mT=/[\s-]/,hT=/[\s-]/g;function gT(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?iT:dT;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=gT(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=iT:fT.test(e.charAt(l-1))?(d*=oT,p=e.slice(i,l-1).match(pT),p&&i>0&&(d*=lT**+p.length)):mT.test(e.charAt(l-1))?(d*=aT,m=e.slice(i,l-1).match(hT),m&&i>0&&(d*=lT**+m.length)):(d*=sT,i>0&&(d*=lT**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=uT)),(d<cT&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=gT(e,t,n,r,l+1,a+2,o),f*cT>d&&(d=f*cT)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function _T(e){return e.toLowerCase().replace(hT,` `)}function vT(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,gT(e,t,_T(e),_T(t),0,0,{})}var yT=`[cmdk-group=""]`,bT=`[cmdk-group-items=""]`,xT=`[cmdk-group-heading=""]`,ST=`[cmdk-item=""]`,CT=`${ST}:not([aria-disabled="true"])`,wT=`cmdk-item-select`,TT=`data-value`,ET=(e,t,n)=>vT(e,t,n),DT=I.createContext(void 0),OT=()=>I.useContext(DT),kT=I.createContext(void 0),AT=()=>I.useContext(kT),jT=I.createContext(void 0),MT=I.forwardRef((e,t)=>{let n=KT(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=KT(()=>/* @__PURE__ */ new Set),i=KT(()=>/* @__PURE__ */ new Map),a=KT(()=>/* @__PURE__ */ new Map),o=KT(()=>/* @__PURE__ */ new Set),s=WT(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=F(),b=F(),x=F(),S=I.useRef(null),C=YT();GT(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),GT(()=>{C(6,A)},[]);let w=I.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=ee()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=I.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=ee();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??ET;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;te().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(bT);t?t.appendChild(e.parentElement===t?e:e.closest(`${bT} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${bT} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${yT}[${TT}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=te().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(TT);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=ee();t&&(t.parentElement?.firstChild===t&&((e=t.closest(yT)?.querySelector(xT))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function ee(){return S.current?.querySelector(`${ST}[aria-selected="true"]`)}function te(){return Array.from(S.current?.querySelectorAll(CT)||[])}function j(e){let t=te()[e];t&&w.setState(`value`,t.getAttribute(TT))}function M(e){var t;let n=ee(),r=te(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(TT))}function ne(e){let t=ee()?.closest(yT),n;for(;t&&!n;)t=e>0?HT(t,yT):UT(t,yT),n=t?.querySelector(CT);n?w.setState(`value`,n.getAttribute(TT)):M(e)}let N=()=>j(te().length-1),P=e=>{e.preventDefault(),e.metaKey?N():e.altKey?ne(1):M(1)},re=e=>{e.preventDefault(),e.metaKey?j(0):e.altKey?ne(-1):M(-1)};return I.createElement(p.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&P(e);break;case`ArrowDown`:P(e);break;case`p`:case`k`:_&&e.ctrlKey&&re(e);break;case`ArrowUp`:re(e);break;case`Home`:e.preventDefault(),j(0);break;case`End`:e.preventDefault(),N();break;case`Enter`:{e.preventDefault();let t=ee();if(t){let e=new Event(wT);t.dispatchEvent(e)}}}}},I.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:QT},c),ZT(e,e=>I.createElement(kT.Provider,{value:w},I.createElement(DT.Provider,{value:T},e))))}),NT=I.forwardRef((e,t)=>{let n=F(),r=I.useRef(null),i=I.useContext(jT),a=OT(),o=WT(e),s=o.current?.forceMount??i?.forceMount;GT(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=JT(n,r,[e.value,e.children,r],e.keywords),l=AT(),u=qT(e=>e.value&&e.value===c.current),d=qT(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);I.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(wT,f),()=>t.removeEventListener(wT,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return I.createElement(p.div,{ref:T(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:f},e.children)}),PT=I.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=F(),s=I.useRef(null),c=I.useRef(null),l=F(),u=OT(),d=qT(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));GT(()=>u.group(o),[]),JT(o,s,[e.value,e.heading,c]);let f=I.useMemo(()=>({id:o,forceMount:i}),[i]);return I.createElement(p.div,{ref:T(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&I.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),ZT(e,e=>I.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},I.createElement(jT.Provider,{value:f},e))))}),FT=I.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=I.useRef(null),a=qT(e=>!e.search);return!n&&!a?null:I.createElement(p.div,{ref:T(i,t),...r,"cmdk-separator":``,role:`separator`})}),IT=I.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=AT(),o=qT(e=>e.search),s=qT(e=>e.selectedItemId),c=OT();return I.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),I.createElement(p.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),LT=I.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=I.useRef(null),o=I.useRef(null),s=qT(e=>e.selectedItemId),c=OT();return I.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),I.createElement(p.div,{ref:T(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},ZT(e,e=>I.createElement(`div`,{ref:T(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),RT=I.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return I.createElement(Ar,{open:n,onOpenChange:r},I.createElement(Pr,{container:o},I.createElement(Ir,{"cmdk-overlay":``,className:i}),I.createElement(Br,{"aria-label":e.label,"cmdk-dialog":``,className:a},I.createElement(MT,{ref:t,...s}))))}),zT=I.forwardRef((e,t)=>qT(e=>e.filtered.count===0)?I.createElement(p.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),BT=I.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return I.createElement(p.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ZT(e,e=>I.createElement(`div`,{"aria-hidden":!0},e)))}),VT=Object.assign(MT,{List:LT,Item:NT,Input:IT,Group:PT,Separator:FT,Dialog:RT,Empty:zT,Loading:BT});function HT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function UT(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WT(e){let t=I.useRef(e);return GT(()=>{t.current=e}),t}var GT=typeof window>`u`?I.useEffect:I.useLayoutEffect;function KT(e){let t=I.useRef();return t.current===void 0&&(t.current=e()),t}function qT(e){let t=AT(),n=()=>e(t.snapshot());return I.useSyncExternalStore(t.subscribe,n,n)}function JT(e,t,n,r=[]){let i=I.useRef(),a=OT();return GT(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(TT,s),i.current=s}),i}var YT=()=>{let[e,t]=I.useState(),n=KT(()=>/* @__PURE__ */ new Map);return GT(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function XT(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function ZT({asChild:e,children:t},n){return e&&I.isValidElement(t)?I.cloneElement(XT(t),{ref:t.ref},n(t.props.children)):n(t)}var QT={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function $T(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.has(n.group||``)||t.set(n.group||``,[]),t.get(n.group||``).push(n);return[...t]}function eE({value:e,onChange:t,items:n,placeholder:r=`Choose…`,searchPlaceholder:a=`Search`,emptyText:o=`Nothing matches`,disabled:s,label:c,className:l}){let[u,d]=(0,I.useState)(!1),{portal:f}=i(),p=n.find(t=>t.value===e);return/* @__PURE__ */ (0,L.jsxs)(Xa,{open:u,onOpenChange:d,children:[/* @__PURE__ */ (0,L.jsx)(Qa,{asChild:!0,disabled:s,children:/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,role:`combobox`,"aria-expanded":u,"aria-label":c,className:k(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted disabled:opacity-50`,l),children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`truncate`,!p&&`text-muted`),children:p?p.label:r}),/* @__PURE__ */ (0,L.jsx)(bC,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0})]})}),/* @__PURE__ */ (0,L.jsx)(no,{container:f,children:/* @__PURE__ */ (0,L.jsx)(io,{align:`start`,sideOffset:6,className:`z-50 w-[var(--radix-popover-trigger-width)] min-w-56 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,L.jsxs)(VT,{loop:!0,filter:(e,t)=>+!!e.toLowerCase().includes(t.toLowerCase()),children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule px-3`,children:[/* @__PURE__ */ (0,L.jsx)(cw,{className:`size-4 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(VT.Input,{placeholder:a,className:`h-10 w-full bg-transparent text-[14px] outline-none placeholder:text-muted`})]}),/* @__PURE__ */ (0,L.jsxs)(VT.List,{className:`max-h-72 overflow-y-auto p-1`,children:[/* @__PURE__ */ (0,L.jsx)(VT.Empty,{className:`px-3 py-6 text-center text-[13px] text-muted`,children:o}),$T(n).map(([n,r])=>{let i=r.map(n=>/* @__PURE__ */ (0,L.jsxs)(VT.Item,{value:`${n.label} ${n.hint||``} ${n.value}`,onSelect:()=>{t(n.value),d(!1)},className:`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-2 text-[14px] data-[selected=true]:bg-raise`,children:[/* @__PURE__ */ (0,L.jsx)(fC,{className:k(`size-4 shrink-0`,n.value===e?`opacity-100`:`opacity-0`),"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`truncate`,children:n.label}),n.hint&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num ml-auto shrink-0 text-[12px] text-muted`,children:n.hint})]},n.value));return n?/* @__PURE__ */ (0,L.jsx)(VT.Group,{heading:n,className:`[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,children:i},n):i})]})]})})})]})}var tE={BBL:`Bambu Lab`},nE=e=>tE[e]||e,rE=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`});function iE(e){let t=/* @__PURE__ */ new Map;for(let n of e){t.has(n.vendor)||t.set(n.vendor,{id:n.vendor,label:nE(n.vendor),models:/* @__PURE__ */ new Map});let e=t.get(n.vendor);if(!e.models.has(n.model)){let t=e.label.toLowerCase()+` `,r=n.model.toLowerCase().startsWith(t)?n.model.slice(t.length):n.model;e.models.set(n.model,{id:n.model,label:r,nozzles:[]})}e.models.get(n.model).nozzles.push({size:n.nozzleMm,name:n.name})}return[...t.values()].map(e=>({...e,models:[...e.models.values()].map(e=>({...e,nozzles:aE(e)})).sort(rE)})).sort(rE)}function aE(e){let t=/* @__PURE__ */ new Map;for(let n of e.nozzles)t.set(n.size,(t.get(n.size)||0)+1);let n=t=>(t.toLowerCase().startsWith(e.id.toLowerCase()+` `)?t.slice(e.id.length+1):t).replace(/\bnozzle\b/gi,``).replace(/\s+-\s+/g,` `).replace(/\s+/g,` `).trim();return e.nozzles.map(e=>({...e,label:t.get(e.size)>1?n(e.name):String(e.size)})).sort((e,t)=>e.size-t.size||rE(e,t))}function oE(e,t){for(let n of e)for(let e of n.models){let r=e.nozzles.find(e=>e.name===t);if(r)return{brand:n,model:e,nozzle:r}}return null}var sE=`__mine`,cE=e=>e.nozzles.find(e=>e.label===`0.4`)||e.nozzles[0];function lE(e){return e.isLoading?`Loading printers…`:e.error?.status===401?`Add the API key (key icon, top right) to list printers.`:e.error?`This server has no OrcaSlicer printer list, so only your own printer is available.`:null}function uE({printers:e,ourPrinters:t=[],printer:n,onChange:r}){let i=e.data,a=(0,I.useMemo)(()=>i&&n?oE(i,n):null,[i,n]),[o,s]=(0,I.useState)(sE),[c,l]=(0,I.useState)(``);(0,I.useEffect)(()=>{a?(s(a.brand.id),l(a.model.id)):n===``&&(s(sE),l(``))},[a,n]);let u=i&&i.find(e=>e.id===o),d=u&&u.models.find(e=>e.id===c),f=(e,t=u)=>{let n=t.models.find(t=>t.id===e);l(e),r(cE(n).name)},p=e=>{if(e.startsWith(`printer:`))return r(e.slice(8));if(s(e),l(``),e===sE)return r(``);let t=i.find(t=>t.id===e);t.models.length===1?f(t.models[0].id,t):r(null)},m=[...t.map(e=>({...e,group:`Our printers`})),{value:sE,label:`My printer`,hint:`house profiles`,group:t.length?`All printers`:void 0},...(i||[]).map(e=>({value:e.id,label:e.label,hint:`${e.models.length} ${e.models.length===1?`model`:`models`}`,group:t.length?`All printers`:void 0}))],h=lE(e),g=o===sE?`My printer`:d?`${u.label} ${d.label}`:u?.label;return/* @__PURE__ */ (0,L.jsx)(Dw,{n:2,title:`Printer`,done:n!==null,aside:g,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Brand`,children:/* @__PURE__ */ (0,L.jsx)(eE,{label:`Printer brand`,value:o,onChange:p,items:m,searchPlaceholder:`Search brands`,emptyText:`No brand by that name`,disabled:!i})}),h&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[13px] text-muted`,children:h}),o===sE&&!h&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Slices with the PLA, PETG and ABS profiles set up on this server.`}),/* @__PURE__ */ (0,L.jsx)(Cy,{initial:!1,children:u&&/* @__PURE__ */ (0,L.jsxs)(gx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`space-y-3 overflow-hidden`,children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Model`,children:/* @__PURE__ */ (0,L.jsx)(eE,{label:`Printer model`,value:c,onChange:e=>f(e),placeholder:`Choose a ${u.label} model`,items:u.models.map(e=>({value:e.id,label:e.label})),searchPlaceholder:`Search models`,emptyText:`No model by that name`})}),d&&/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Nozzle`,hint:`mm`,children:/* @__PURE__ */ (0,L.jsx)(yw,{label:`Nozzle size`,value:n||``,onChange:r,className:d.nozzles.every(e=>e.label.length<=4)?void 0:`flex flex-wrap gap-1`,options:d.nozzles.map(e=>({value:e.name,label:e.label}))})})]},u.id)})]})})}var dE=`__empty`;function fE({value:e,onChange:t,options:n,label:r,className:a}){let{portal:o}=i();return/* @__PURE__ */ (0,L.jsxs)(Ao,{value:e===``?dE:e,onValueChange:e=>t(e===dE?``:e),children:[/* @__PURE__ */ (0,L.jsxs)(Mo,{"aria-label":r,className:k(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted`,a),children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`truncate`,children:/* @__PURE__ */ (0,L.jsx)(Po,{})}),/* @__PURE__ */ (0,L.jsx)(Fo,{children:/* @__PURE__ */ (0,L.jsx)(mC,{className:`size-4 text-muted`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,L.jsx)(K,{container:o,children:/* @__PURE__ */ (0,L.jsx)(Ro,{position:`popper`,sideOffset:6,className:`z-50 max-h-80 w-[var(--radix-select-trigger-width)] min-w-48 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,L.jsx)(Xo,{className:`p-1`,children:n.map(e=>/* @__PURE__ */ (0,L.jsxs)(ns,{value:e.value===``?dE:e.value,className:`relative flex cursor-pointer items-center rounded-md py-2 pr-2.5 pl-8 text-[14px] outline-none data-[highlighted]:bg-raise`,children:[/* @__PURE__ */ (0,L.jsx)(os,{className:`absolute left-2.5`,children:/* @__PURE__ */ (0,L.jsx)(fC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(is,{children:e.label})]},e.value))})})})]})}var pE=[`PLA`,`PETG`,`ABS`];function mE({settings:e,onChange:t,options:n}){let[r,i]=(0,I.useState)(!1),a=!!e.printer,o=a?n.data:null,s=o?o.materials:pE,c=s.map(e=>({value:e,label:e})),l=e.process||e.filament;return/* @__PURE__ */ (0,L.jsx)(Dw,{n:3,title:`Material`,done:!0,aside:e.filament||null,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Material`,children:s.length>8?/* @__PURE__ */ (0,L.jsx)(eE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),items:c,searchPlaceholder:`Search materials`}):/* @__PURE__ */ (0,L.jsx)(fE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),options:c})}),a&&/* @__PURE__ */ (0,L.jsxs)(`div`,{children:[/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,className:`flex items-center gap-1 text-[13px] font-medium text-muted hover:text-ink`,children:[/* @__PURE__ */ (0,L.jsx)(gC,{className:k(`size-4 transition-transform`,r&&`rotate-90`),"aria-hidden":!0}),`Process and filament presets`,l&&!r?`, changed`:``]}),/* @__PURE__ */ (0,L.jsx)(Cy,{initial:!1,children:r&&/* @__PURE__ */ (0,L.jsx)(gx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-3 pt-3`,children:[n.isLoading&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Loading presets…`}),o&&/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Process`,children:/* @__PURE__ */ (0,L.jsx)(fE,{label:`Process preset`,value:e.process,onChange:e=>t({process:e}),options:[{value:``,label:`Printer default${o.defaultProcess?` (${o.defaultProcess})`:``}`},...o.processes.map(e=>({value:e,label:e}))]})}),/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Filament`,hint:`${o.filaments.length} for ${e.material}`,children:/* @__PURE__ */ (0,L.jsx)(eE,{label:`Filament preset`,value:e.filament,onChange:e=>t({filament:e}),searchPlaceholder:`Search filaments`,items:[{value:``,label:`Generic ${e.material}`},...o.filaments.map(e=>({value:e.name,label:e.name}))]})})]})]})})})]})]})})}function hE({label:e,values:t,value:n,onChange:r,format:i,valueText:a=i,defaultValue:o,defaultLabel:s,captions:c,bare:l}){let u=s!==void 0,d=n!==``,f=Math.max(0,t.indexOf(d?Number(n):o));return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[!l&&/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:d?`num text-[13px] font-semibold`:`text-[13px] text-muted`,children:d?i(Number(n)):s}),u&&d&&/* @__PURE__ */ (0,L.jsx)(M,{label:`Back to default`,children:/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,onClick:()=>r(``),"aria-label":`${e} back to default`,className:`grid size-6 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(ew,{className:`size-3.5`,"aria-hidden":!0})})})]})]}),/* @__PURE__ */ (0,L.jsxs)(Os,{min:0,max:t.length-1,step:1,value:[f],onValueChange:([e])=>r(t[e]),className:`relative flex h-6 touch-none items-center select-none`,"aria-label":e,children:[/* @__PURE__ */ (0,L.jsx)(Fs,{className:`relative h-2 flex-1 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,L.jsx)(Ls,{className:d?`absolute h-full bg-accent`:`absolute h-full bg-rule`})}),/* @__PURE__ */ (0,L.jsx)(Ws,{"aria-valuetext":d?a(Number(n)):s,className:d?`block size-5 rounded-full border-2 border-accent bg-panel shadow-sm`:`block size-5 rounded-full border-2 border-rule bg-panel`})]}),c&&/* @__PURE__ */ (0,L.jsx)(`div`,{className:`grid text-[11px] text-muted`,style:{gridTemplateColumns:`repeat(${c.length}, minmax(0, 1fr))`},children:c.map((e,i)=>{let a=i===0?`text-left`:i===c.length-1?`text-right`:`text-center`;return c.length===t.length?/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,onClick:()=>r(t[i]),tabIndex:-1,className:`${a} hover:text-ink ${t[i]===Number(n)?`font-semibold text-ink`:``}`,children:e},i):/* @__PURE__ */ (0,L.jsx)(`span`,{className:a,children:e},i)})})]})}var gE={printer:``,material:`PLA`,process:``,filament:``,quality:``,infill:``,walls:``,supports:``},_E=[10,15,20,30,40,50,60,70,80,90];function vE(e,t,n=[0,0,0]){let r=new FormData;r.append(`model`,e),[`rotX`,`rotY`,`rotZ`].forEach((e,t)=>{n[t]&&r.append(e,String(n[t]))});let i={printer:t.printer,material:t.material,quality:t.quality,infill:t.infill,walls:t.walls,supports:t.supports};t.printer&&Object.assign(i,{process:t.process,filament:t.filament});for(let e of[`printer`,`material`,`process`,`filament`,`quality`,`infill`,`walls`,`supports`])i[e]!==void 0&&String(i[e])!==``&&r.append(e,String(i[e]));return t.mode&&r.append(`mode`,t.mode),t.mode!==`estimate`&&t.gcode!==!1&&r.append(`gcode`,`true`),r}var yE=[{value:``,label:`Default`},{value:`standard`,label:`0.2`},{value:`medium`,label:`0.15`},{value:`high`,label:`0.1`}],bE=[{value:``,label:`Default`},{value:`false`,label:`Off`},{value:`true`,label:`On`}],xE=e=>`${e} ${e===1?`wall`:`walls`}`;function SE({settings:e,onChange:t}){let n=!!e.printer;return/* @__PURE__ */ (0,L.jsx)(Dw,{n:4,title:`Print settings`,done:!0,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-4`,children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Layer height`,hint:`mm`,children:/* @__PURE__ */ (0,L.jsx)(yw,{label:`Layer height`,value:e.quality,onChange:e=>t({quality:e}),options:yE})}),/* @__PURE__ */ (0,L.jsx)(hE,{label:`Infill`,values:_E,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,defaultValue:15,defaultLabel:n?`Printer default`:`Default, 15%`}),/* @__PURE__ */ (0,L.jsx)(hE,{label:`Walls`,values:Pw,value:e.walls,onChange:e=>t({walls:e}),format:xE,defaultValue:3,defaultLabel:n?`Printer default`:`Default, 3 walls`}),/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Supports`,children:/* @__PURE__ */ (0,L.jsx)(yw,{label:`Supports`,value:e.supports,onChange:e=>t({supports:e}),options:bE})}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[13px] text-muted`,children:n?`Default keeps what the printer’s own process uses.`:`Default on your printer: 0.2 mm layers, 15% infill, 3 walls, no supports.`})]})})}function CE(e){let[t,n]=(0,I.useState)(Date.now);return(0,I.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),e?Math.max(0,Math.round((t-e)/1e3)):0}function wE({files:e,onFiles:t,model:n,rot:r,onRotate:i,settings:a,onSettings:o,printers:s,ourPrinters:c=[],options:l,toSlice:u,slicingSince:d,blocker:f,onSlice:p}){let m=CE(d);return/* @__PURE__ */ (0,L.jsxs)(`aside`,{className:`flex flex-col border-rule bg-panel lg:min-h-0 lg:w-[380px] lg:shrink-0 lg:border-r`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`lg:min-h-0 lg:flex-1 lg:overflow-y-auto`,children:[/* @__PURE__ */ (0,L.jsx)(rT,{files:e,onFiles:t,model:n,rot:r,onRotate:i}),/* @__PURE__ */ (0,L.jsx)(uE,{printers:s,ourPrinters:c,printer:a.printer,onChange:e=>o({printer:e,process:``,filament:``})}),/* @__PURE__ */ (0,L.jsx)(mE,{settings:a,onChange:o,options:l}),/* @__PURE__ */ (0,L.jsx)(SE,{settings:a,onChange:o})]}),/* @__PURE__ */ (0,L.jsxs)(`footer`,{className:`sticky bottom-0 border-t border-rule bg-panel px-5 py-4`,children:[f&&!d&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mb-2.5 text-[13px] text-muted`,children:f}),/* @__PURE__ */ (0,L.jsx)(_w,{variant:`primary`,size:`lg`,className:`w-full justify-center`,disabled:!!f||!!d,onClick:p,children:d?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(w,{className:`size-[18px] animate-spin`,"aria-hidden":!0}),` Slicing `,/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num`,children:[m,` s`]})]}):/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(HC,{className:`size-[18px]`,"aria-hidden":!0}),` `,u>1?`Slice ${u} models`:`Slice model`]})})]})]})}var TE=e=>{let t=oe.indexOf(e);return t<0?oe.length-1:t};function EE({features:e,hidden:t,onHidden:n,open:r,onOpen:i}){let a=e.reduce((e,t)=>e+t.e,0)||1,o=e.map((e,t)=>({...e,i:t})).sort((e,t)=>TE(e.name)-TE(t.name)),s=e.map((e,t)=>t),c=(e,r)=>{if(e.altKey){let e=t.size===s.length-1&&!t.has(r);n(new Set(e?[]:s.filter(e=>e!==r)))}else{let e=new Set(t);e.has(r)?e.delete(r):e.add(r),n(e)}};return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:k(`overflow-hidden rounded-xl border border-rule bg-panel/90 backdrop-blur`,r?`w-64`:`w-auto`),children:[/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":r,className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-[14px] font-semibold`,children:[`Features`,t.size>0&&/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num text-[12px] font-normal text-muted`,children:[e.length-t.size,` of `,e.length,` shown`]}),/* @__PURE__ */ (0,L.jsx)(mC,{className:k(`ml-auto size-4 text-muted transition-transform`,r&&`rotate-180`),"aria-hidden":!0})]}),/* @__PURE__ */ (0,L.jsx)(Cy,{initial:!1,children:r&&/* @__PURE__ */ (0,L.jsxs)(gx.div,{initial:{height:0},animate:{height:`auto`},exit:{height:0},transition:{duration:.2,ease:`easeOut`},children:[/* @__PURE__ */ (0,L.jsx)(`ul`,{className:`px-1.5 pb-1.5`,children:o.map(e=>{let n=t.has(e.i),r=e.e/a*100;return/* @__PURE__ */ (0,L.jsx)(`li`,{children:/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:t=>c(t,e.i),"aria-pressed":!n,className:k(`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-[13px] hover:bg-raise`,n&&`text-muted`),children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`size-3 shrink-0 rounded-[3px]`,style:{background:ie(e.name),opacity:n?.3:1},"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ae(e.name)}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num text-[12px] text-muted`,children:[r<.1?`<0.1`:r.toFixed(1),`%`]}),n?/* @__PURE__ */ (0,L.jsx)(AC,{className:`size-3.5 text-muted`,"aria-hidden":!0}):/* @__PURE__ */ (0,L.jsx)(MC,{className:`size-3.5 text-muted/60`,"aria-hidden":!0})]})},e.i)})}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`border-t border-rule px-3.5 py-2 text-[12px] text-muted`,children:t.size?/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,className:`font-medium text-ink underline underline-offset-2`,onClick:()=>n(/* @__PURE__ */ new Set),children:`Show all`}):`Alt-click a feature to see only it`})]})})]})}function DE(e){let t=e.length?e[e.length-1].z:0,n=[1,2,5,10,20,25,50,100].find(e=>t/e<=10)||200,r=[];for(let i=n;i<=t+1e-6;i+=n){let t=e.findIndex(e=>e.z>=i-1e-6);t>=0&&r.push({z:i,at:e.length>1?t/(e.length-1):0})}return r}function OE({layer:e,z:t,vertical:n,at:r}){return/* @__PURE__ */ (0,L.jsxs)(`span`,{className:k(`pointer-events-none absolute flex items-baseline gap-1.5 whitespace-nowrap rounded-md bg-ink px-2 py-1 text-ink-contrast shadow-sm`,n?`top-1/2 right-[calc(100%+10px)] -translate-y-1/2`:`bottom-[calc(100%+10px)] left-1/2`),style:n?void 0:{transform:`translateX(-${r*100}%)`},children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num text-[11px] opacity-70`,children:[t.toFixed(2),` mm`]})]})}function kE({layers:e,fallbackZ:t,value:n,onChange:r,vertical:i}){let a=Math.max(1,e.length),o=(0,I.useMemo)(()=>DE(e),[e]),s=n=>e[n-1]?e[n-1].z:t,c=e=>a>1?(e-1)/(a-1):0,[l,u]=n;return/* @__PURE__ */ (0,L.jsx)(`div`,{className:k(`flex rounded-xl border border-rule bg-panel/90 backdrop-blur`,i?`h-full w-16 flex-col items-center py-4`:`h-14 w-full items-center px-5`),children:/* @__PURE__ */ (0,L.jsxs)(Os,{orientation:i?`vertical`:`horizontal`,min:1,max:a,step:1,minStepsBetweenThumbs:0,value:n,onValueChange:r,className:k(`relative flex touch-none select-none`,i?`h-full w-5 flex-col items-center`:`h-5 w-full items-center`),children:[/* @__PURE__ */ (0,L.jsx)(Fs,{className:k(`relative grow rounded-full bg-raise`,i?`w-1.5`:`h-1.5`),children:/* @__PURE__ */ (0,L.jsx)(Ls,{className:k(`absolute rounded-full bg-ink`,i?`w-full`:`h-full`)})}),o.map(e=>/* @__PURE__ */ (0,L.jsxs)(`span`,{className:k(`pointer-events-none absolute flex items-center gap-1 text-[10px] text-muted`,i?`left-[calc(100%+4px)] -translate-y-1/2`:`top-[calc(100%+3px)] -translate-x-1/2 flex-col`),style:i?{bottom:`${e.at*100}%`}:{left:`${e.at*100}%`},"aria-hidden":!0,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`bg-muted/60`,i?`h-px w-1.5`:`h-1.5 w-px`)}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num`,children:e.z})]},e.z)),/* @__PURE__ */ (0,L.jsx)(Ws,{"aria-label":`Bottom layer`,className:`relative block size-4 rounded-full border-2 border-ink bg-panel`,children:l>1&&/* @__PURE__ */ (0,L.jsx)(OE,{layer:l,z:s(l),vertical:i,at:c(l)})}),/* @__PURE__ */ (0,L.jsx)(Ws,{"aria-label":`Top layer`,className:`relative block size-5 rounded-full border-2 border-ink bg-ink`,children:/* @__PURE__ */ (0,L.jsx)(OE,{layer:u,z:s(u),vertical:i,at:c(u)})})]})})}var AE=e=>e==null?null:`${+e.toFixed(3)} mm`;function jE(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.round(e%60);return[t&&`${t}h`,(t||n)&&`${n}m`,`${r}s`].filter(Boolean).join(` `)}function ME(e){if(!e.bed)return null;let t=e.bed.map(e=>e[0]),n=e.bed.map(e=>e[1]);return[Math.max(...t)-Math.min(...t),Math.max(...n)-Math.min(...n),e.bedHeight].filter(e=>e!=null).map(e=>+e.toFixed(1)).join(` × `)+` mm`}function NE({value:e,unit:t,label:n}){return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`num display text-[20px] leading-none font-semibold whitespace-nowrap`,children:[e,t&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`ml-0.5 text-[13px] font-medium text-muted`,children:t})]}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1 text-[12px] text-muted`,children:n})]})}function PE({result:e,quote:t}){let n=e.meta,r=t&&t.used,i=t&&t.stats,a=[[`Sliced with`,n.generatedBy&&n.generatedBy.split(` on `)[0]],[`Printer`,r&&r.printer||n.printer],[`Process`,r&&r.process||n.process],[`Filament`,r&&r.filament||n.filament],[`Material`,n.filamentType],[`Layer height`,AE(n.layerHeight)],[`Nozzle`,AE(n.nozzle)],[`Total time`,n.totalTime&&`${n.totalTime} with start and end`],[`Filament volume`,n.filamentCm3!=null&&`${n.filamentCm3} cm³`],[`Bed`,ME(n)],[`Model size`,i&&i.sizeMm.map(e=>+e.toFixed(1)).join(` × `)+` mm`],[`Model volume`,i&&`${i.volumeCm3} cm³`],[`Watertight`,i&&(i.watertight?`Yes`:`No, results may be off`)]].filter(([,e])=>e);return/* @__PURE__ */ (0,L.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-[13px]`,children:a.flatMap(([e,t])=>[/* @__PURE__ */ (0,L.jsx)(`dt`,{className:`text-muted`,children:e},e),/* @__PURE__ */ (0,L.jsx)(`dd`,{className:`text-right font-medium [overflow-wrap:anywhere]`,children:t},e+`:`)])})}function FE({result:e,quote:t,thumbnail:n}){let{portal:r}=i(),a=e.meta,o=t&&t.stats,s=a.filamentG??(o&&o.weightG),c=a.printTime||o&&jE(o.seconds);return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex w-full items-start gap-3 rounded-xl border border-rule bg-panel/90 px-4 py-3 backdrop-blur lg:w-auto lg:items-center`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`grid flex-1 grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4 lg:flex lg:gap-6`,children:[s!=null&&/* @__PURE__ */ (0,L.jsx)(NE,{value:s,unit:`g`,label:`Weight`}),c&&/* @__PURE__ */ (0,L.jsx)(NE,{value:c,label:`Print time`}),a.filamentMm!=null&&/* @__PURE__ */ (0,L.jsx)(NE,{value:(a.filamentMm/1e3).toFixed(2),unit:`m`,label:`Filament`}),/* @__PURE__ */ (0,L.jsx)(NE,{value:Math.max(1,e.layers.length),label:`Layers`})]}),/* @__PURE__ */ (0,L.jsxs)(Xa,{children:[/* @__PURE__ */ (0,L.jsx)(M,{label:`Print details`,children:/* @__PURE__ */ (0,L.jsx)(Qa,{asChild:!0,children:/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Print details`,className:`ml-auto grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(RC,{className:`size-[18px]`,"aria-hidden":!0})})})}),/* @__PURE__ */ (0,L.jsx)(no,{container:r,children:/* @__PURE__ */ (0,L.jsxs)(io,{side:`top`,align:`start`,sideOffset:10,className:`z-50 w-80 rounded-xl border border-rule bg-panel p-4 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:[/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mb-3 text-[14px] font-semibold`,children:`Print details`}),n&&/* @__PURE__ */ (0,L.jsx)(`img`,{src:n,alt:`The sliced plate`,className:`mb-3 aspect-[4/3] w-full rounded-lg bg-viewer object-contain`}),/* @__PURE__ */ (0,L.jsx)(PE,{result:e,quote:t})]})})]})]})}function IE(){let{layout:e}=i(),[t,n]=(0,I.useState)(()=>e.clientWidth);return(0,I.useEffect)(()=>{let t=new ResizeObserver(()=>n(e.clientWidth));return t.observe(e),()=>t.disconnect()},[e]),t}var LE=(0,I.lazy)(()=>import(`./chunks/Viewer3D-o2piEXHZ.js`)),RE=(0,I.lazy)(()=>import(`./chunks/ModelPreview-CYVyGDd1.js`)),zE=[{value:`iso`,label:`3D`},{value:`top`,label:`Top`},{value:`front`,label:`Front`}];function BE({children:e}){return/* @__PURE__ */ (0,L.jsx)(gx.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2},className:`absolute top-1/2 left-1/2 z-20 w-[min(360px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-6 text-center`,children:e})}function VE({slicing:e}){let t=CE(e.since);return/* @__PURE__ */ (0,L.jsxs)(BE,{children:[/* @__PURE__ */ (0,L.jsx)(w,{className:`mx-auto size-7 animate-spin text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-3 text-[15px] font-semibold`,children:e.title}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1 text-[13px] text-muted`,children:e.printer}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,L.jsx)(gx.div,{className:`h-full w-1/3 rounded-full bg-ink`,animate:{x:[`-100%`,`300%`]},transition:{repeat:1/0,duration:1.4,ease:`easeInOut`}})}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`num mt-2 text-[12px] text-muted`,children:[t,` s`]})]})}function HE({onChooseModel:e,onOpenGcode:t}){return/* @__PURE__ */ (0,L.jsx)(`div`,{className:`absolute inset-0 grid place-items-center p-6`,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`max-w-sm text-center`,children:[/* @__PURE__ */ (0,L.jsx)(HC,{className:`mx-auto size-10 text-muted`,strokeWidth:1.5,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`display mt-4 text-[20px] font-semibold`,children:`Slice a model to see how it prints`}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-2 text-[14px] text-muted`,children:`Drop a model anywhere on the page (STL, 3MF, OBJ, STEP or IGES), set the printer on the left, then slice. Already have G-code or a sliced 3MF? Open it to inspect it.`}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-5 flex flex-wrap justify-center gap-2`,children:[/* @__PURE__ */ (0,L.jsxs)(_w,{variant:`primary`,onClick:e,children:[/* @__PURE__ */ (0,L.jsx)(fw,{className:`size-4`,"aria-hidden":!0}),` Choose model`]}),/* @__PURE__ */ (0,L.jsxs)(_w,{onClick:t,children:[/* @__PURE__ */ (0,L.jsx)(PC,{className:`size-4`,"aria-hidden":!0}),` Open G-code`]})]})]})})}function UE({label:e,pressed:t,onClick:n,children:r,...i}){return/* @__PURE__ */ (0,L.jsx)(M,{label:e,children:/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":t,onClick:n,...i,className:k(`grid size-9 place-items-center rounded-lg border border-rule bg-panel/90 text-muted backdrop-blur hover:text-ink`,t&&`border-ink text-ink`),children:r})})}function WE({gcode:e,model:t,rot:n,slicing:r,onChooseModel:i,onOpenGcode:a}){let{status:o,result:s}=e,c=o===`ready`,l=IE()>=1024,u=Bb(),[d,f]=(0,I.useState)([1,1]),[p,m]=(0,I.useState)(()=>/* @__PURE__ */ new Set),[h,g]=(0,I.useState)(!1),[_,v]=(0,I.useState)(`iso`),[y,b]=(0,I.useState)(0),[x,S]=(0,I.useState)(l),C=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!s)return;let e=Math.max(1,s.layers.length);if(m(/* @__PURE__ */ new Set),v(`iso`),u||e<3){f([1,e]);return}f([1,1]);let t=hx(1,e,{duration:1.2,ease:[.22,1,.36,1],onUpdate:e=>f([1,Math.round(e)])});return C.current=t,()=>t.stop()},[s,u]);let w=c,T=!r&&!!t&&o===`empty`,E=(0,I.useMemo)(()=>e.download?URL.createObjectURL(e.download):null,[e.download]);return(0,I.useEffect)(()=>()=>{E&&URL.revokeObjectURL(E)},[E]),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`relative flex min-h-0 flex-col lg:h-full`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`relative h-[58vh] min-h-[340px] overflow-hidden bg-viewer lg:h-auto lg:flex-1`,children:[w&&/* @__PURE__ */ (0,L.jsx)(`div`,{className:`absolute inset-0`,children:/* @__PURE__ */ (0,L.jsx)(I.Suspense,{fallback:null,children:/* @__PURE__ */ (0,L.jsx)(LE,{result:s,layerMin:d[0]-1,layerMax:d[1]-1,hidden:p,showTravels:h,view:_,fitKey:y})})}),o===`empty`&&!r&&!t&&/* @__PURE__ */ (0,L.jsx)(HE,{onChooseModel:i,onOpenGcode:a}),T&&/* @__PURE__ */ (0,L.jsx)(I.Suspense,{fallback:null,children:/* @__PURE__ */ (0,L.jsx)(RE,{file:t,rot:n})}),r&&/* @__PURE__ */ (0,L.jsx)(VE,{slicing:r}),o===`loading`&&!r&&/* @__PURE__ */ (0,L.jsxs)(BE,{children:[/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`text-[15px] font-semibold`,children:[`Reading `,e.name]}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,L.jsx)(`div`,{className:`h-full rounded-full bg-ink transition-[width]`,style:{width:`${Math.round(e.progress*100)}%`}})})]}),o===`error`&&!r&&/* @__PURE__ */ (0,L.jsxs)(BE,{children:[/* @__PURE__ */ (0,L.jsx)(te,{className:`mx-auto size-7 text-danger`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-3 text-[14px]`,role:`alert`,children:e.error}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[/* @__PURE__ */ (0,L.jsx)(_w,{onClick:a,children:`Open another file`}),/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,onClick:e.close,children:`Close`})]})]}),w&&/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(`div`,{className:`absolute top-3 left-3 z-10`,children:/* @__PURE__ */ (0,L.jsx)(EE,{features:s.features,hidden:p,onHidden:m,open:x,onOpen:S})}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex flex-col items-end gap-2 sm:flex-row sm:items-center`,children:[/* @__PURE__ */ (0,L.jsx)(yw,{label:`View`,value:_,onChange:e=>{v(e),b(e=>e+1)},options:zE,className:`w-40 border border-rule bg-panel/90 backdrop-blur`}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,L.jsx)(UE,{label:h?`Hide travel moves`:`Show travel moves`,pressed:h,onClick:()=>g(e=>!e),children:/* @__PURE__ */ (0,L.jsx)(nw,{className:`size-[18px]`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(UE,{label:`Fit to model`,onClick:()=>b(e=>e+1),children:/* @__PURE__ */ (0,L.jsx)(ow,{className:`size-[18px]`,"aria-hidden":!0})})]})]}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:l?`absolute top-[72px] right-3 bottom-28 z-10`:`absolute inset-x-3 bottom-3 z-10`,children:/* @__PURE__ */ (0,L.jsx)(kE,{layers:s.layers,fallbackZ:s.bounds.max[2],value:d,vertical:l,onChange:e=>{C.current?.stop(),f(e)}})})]})]}),c&&/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t border-rule bg-panel p-3 lg:absolute lg:bottom-3 lg:left-3 lg:z-10 lg:max-w-[calc(100%-110px)] lg:flex-nowrap lg:border-0 lg:bg-transparent lg:p-0`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 rounded-xl border border-rule bg-panel/90 py-1.5 pr-1.5 pl-3 backdrop-blur`,children:[/* @__PURE__ */ (0,L.jsx)(PC,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`max-w-[220px] truncate text-[13px] font-medium`,title:e.name,children:e.name}),E&&/* @__PURE__ */ (0,L.jsx)(M,{label:`Download G-code`,children:/* @__PURE__ */ (0,L.jsx)(`a`,{href:E,download:e.name,"aria-label":`Download G-code`,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(EC,{className:`size-4`,"aria-hidden":!0})})}),/* @__PURE__ */ (0,L.jsx)(M,{label:`Close`,children:/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Close file`,onClick:e.close,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,L.jsx)(FE,{result:s,quote:e.quote,thumbnail:e.thumbnail})]})]})}var GE=`gcode-viewer.api-key`,KE=()=>{try{return localStorage.getItem(GE)||``}catch{return``}},qE=e=>{try{localStorage.setItem(GE,e)}catch{}},JE=(e,t)=>`${String(e||``).replace(/\/+$/,``)}${t}`;async function YE(e,{key:t,...n}={}){let r=await fetch(e,{...n,headers:t?{"x-api-key":t}:{}}),i=null;try{i=await r.json()}catch{}if(!r.ok)throw Object.assign(Error(i&&i.error||`Request failed (HTTP ${r.status})`),{status:r.status});return i}var XE=[`process`,`model`,`files`,`material`,`strength`,`cost`,`contact`],ZE=[`auto`,`exact`,`estimate`],QE=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0,$E=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function eD(e,t=e=>console.warn(`slicer-studio: ${e}`)){let n=e;if(typeof e==`string`){if(!e.trim())return{};try{n=JSON.parse(e)}catch(e){return t(`config is not valid JSON: ${e.message}`),{}}}if(n==null)return{};if(!$E(n))return t(`config must be an object`),{};let{currency:r,pricePerGram:i,priceRange:a,regularMode:o,contact:s,defaultPrinter:c,defaults:l,cards:u,...d}=n;for(let e of Object.keys(d))t(`unknown config key "${e}" left out`);let f={};if(r!==void 0&&(typeof r==`string`&&/^[a-z]{3}$/i.test(r)?f.currency=r.toUpperCase():t(`currency ${JSON.stringify(r)} left out: use a code like INR`)),$E(i)){f.pricePerGram={};for(let[e,n]of Object.entries(i))QE(n)?f.pricePerGram[e.toUpperCase()]=n:t(`pricePerGram.${e} left out: it must be a number of 0 or more`)}if(a!==void 0&&(QE(a)?f.priceRange=a:t(`priceRange left out: it must be a percentage of 0 or more`)),$E(o)&&(f.regularMode={},typeof o.supports==`boolean`?f.regularMode.supports=o.supports:o.supports!==void 0&&t(`regularMode.supports left out: it must be true or false`),ZE.includes(o.mode)?f.regularMode.mode=o.mode:o.mode!==void 0&&t(`regularMode.mode left out: it must be ${ZE.join(`, `)}`)),$E(s)&&(f.contact={},typeof s.name==`string`&&(f.contact.name=s.name.trim()),typeof s.email==`string`&&s.email.includes(`@`)?f.contact.email=s.email.trim():s.email!==void 0&&t(`contact.email "${s.email}" left out: it is not an email address`)),typeof c==`string`&&c.trim()&&(f.defaultPrinter=c.trim()),$E(l)){f.defaults={},typeof l.material==`string`&&(f.defaults.material=l.material.toUpperCase());let e=(e,n)=>{n.includes(l[e])?f.defaults[e]=l[e]:l[e]!==void 0&&t(`defaults.${e} left out: it must be one of ${n.join(`, `)}`)};e(`quality`,Nw.map(e=>e.id)),e(`infill`,_E),e(`walls`,Pw)}if(Array.isArray(u)){f.cards=u.filter(e=>XE.includes(e));for(let e of u)XE.includes(e)||t(`card "${e}" left out: it must be one of ${XE.join(`, `)}`);!f.cards.includes(`model`)&&!f.cards.includes(`files`)&&(t(`cards need model or files, or there is nowhere to add a file: keeping model`),f.cards.push(`model`))}return f}var tD=e=>new Set(e.cards||XE);function nD(e,t){let n={...e.pricing&&e.pricing.perGram,...t.pricePerGram};return{...e,pricing:Object.keys(n).length?{currency:t.currency??(e.pricing?e.pricing.currency:`INR`),perGram:n,range:t.priceRange??(e.pricing?e.pricing.range:0)}:null,defaultPrinter:t.defaultPrinter??e.defaultPrinter,regularMode:{...e.regularMode,...t.regularMode},contact:{...e.contact,...t.contact}}}var rD=()=>{let{apiUrl:e}=i();return t=>JE(e,t)};function iD(){let e=rD(),{config:t}=i();return At({queryKey:[`config`],queryFn:()=>YE(e(`/api/config`)),select:e=>nD(e,t)})}function aD(){let e=rD();return At({queryKey:[`health`],queryFn:()=>fetch(e(`/health`)).then(e=>e.json()),staleTime:6e4})}function oD(e){let t=rD();return At({queryKey:[`printers`,e],queryFn:()=>YE(t(`/api/printers`),{key:e}),select:e=>iE(e.printers)})}function sD(e,t,n){let r=rD();return At({queryKey:[`options`,e,t,n],queryFn:()=>YE(r(`/api/options?printer=${encodeURIComponent(e)}&material=${encodeURIComponent(t)}`),{key:n}),enabled:!!e,placeholderData:t=>t&&t.printer===e?t:void 0})}function cD(e){let t=rD();return jt({mutationFn:({model:n,settings:r,rot:i})=>YE(t(`/api/quote`),{key:e,method:`POST`,body:vE(n,r,i)})})}var lD='const e=Math.PI/18,t=1e-9;var n=class{constructor(e,t=4096){this.Type=e,this.a=new e(t),this.n=0}push(e){if(this.n===this.a.length){let e=new this.Type(this.n*2);e.set(this.a),this.a=e}this.a[this.n++]=e}done(){return this.a.slice(0,this.n)}};const r=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:null},i=e=>Math.round(e*1e4)/1e4;function a(e){let t={};for(let[,n,r]of e.matchAll(/([A-Za-z])\\s*([-+]?(?:\\d+\\.?\\d*|\\.\\d+))/g))t[n.toUpperCase()]=Number(r);return t}function o(o,s){let c=/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/m.test(o),l={start:new n(Float32Array),end:new n(Float32Array),feature:new n(Uint8Array),layer:new n(Float32Array),width:new n(Float32Array),height:new n(Float32Array)},u={pos:new n(Float32Array),layer:new n(Float32Array)},d=[],f=[],p=/* @__PURE__ */ new Map,m={},h={},g=[1/0,1/0,1/0],_=[-1/0,-1/0,-1/0],v=0,y=0,b=0,x=0,S=!1,C=!1,w=-1,T=null,E=null,D=!1,O=!1,k=()=>Math.max(0,d.length-1),A=e=>(p.has(e)||(p.set(e,f.length),f.push({name:e,e:0})),p.get(e));function j(e,t,n,a,o,s,u){if(!c&&(!d.length||Math.abs(s-d[d.length-1].z)>1e-4)){let e=d.length?d[d.length-1].z:0;d.push({z:i(s),height:i(Math.abs(s-e))})}w<0&&(w=A(`Custom`)),f[w].e+=u,l.start.push(e),l.start.push(t),l.start.push(n),l.end.push(a),l.end.push(o),l.end.push(s),l.feature.push(w),l.layer.push(k()),l.width.push(T??r(m.nozzle_diameter)??.4),l.height.push(E??r(m.layer_height)??.2),M(0,e),M(1,t),M(2,n),M(0,a),M(1,o),M(2,s)}function M(e,t){t<g[e]&&(g[e]=t),t>_[e]&&(_[e]=t)}function N(e,t,n,r,i,a){for(let o of[e,t,n,r,i,a])u.pos.push(o);u.layer.push(k())}function P(e,n,r,i,a,o,s){s>t&&(Math.abs(i-e)>t||Math.abs(a-n)>t)?j(e,n,r,i,a,o,s):(Math.abs(i-e)>t||Math.abs(a-n)>t||Math.abs(o-r)>t)&&N(e,n,r,i,a,o)}function F(e){let t;if(/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/.test(e))d.push({z:i(b),height:E??r(m.layer_height)??.2}),D=O=!1;else if(t=e.match(/^;\\s*(?:Z_HEIGHT|Z):\\s*([-+\\d.]+)/))c&&d.length&&!D&&(d[d.length-1].z=r(t[1]),D=!0);else if(t=e.match(/^;\\s*(?:LAYER_HEIGHT|HEIGHT):\\s*([\\d.]+)/))E=r(t[1]),c&&d.length&&!O&&(d[d.length-1].height=E,O=!0);else if(t=e.match(/^;\\s*(?:FEATURE|TYPE):\\s*(.+?)\\s*$/))w=A(t[1]);else if(t=e.match(/^;\\s*(?:LINE_WIDTH|WIDTH):\\s*([\\d.]+)/))T=r(t[1]);else if(t=e.match(/^;\\s*(?:total )?filament used \\[(g|mm|cm3)\\]\\s*=\\s*([\\d.]+)/)){let e={g:`filamentG`,mm:`filamentMm`,cm3:`filamentCm3`}[t[1]];h[e]??(h[e]=r(t[2]))}else(t=e.match(/^;\\s*(\\w+)\\s*=\\s*(.*?)\\s*$/))?m[t[1]]=t[2].replace(/^"(.*)"$/,`$1`):(t=e.match(/^;\\s*generated by\\s+(.+?)\\s*$/i))?h.generatedBy=t[1]:/printing time/i.test(e)&&((t=e.match(/model printing time:\\s*([^;]+)/i))&&(h.printTime=t[1].trim()),(t=e.match(/total estimated time:\\s*([^;]+)/i))&&(h.totalTime=t[1].trim()),(t=e.match(/estimated printing time \\(normal mode\\)\\s*=\\s*(.+)/i))&&!h.printTime&&(h.printTime=t[1].trim()))}function I(n,r){let i=`X`in r?S?v+r.X:r.X:v,a=`Y`in r?S?y+r.Y:r.Y:y,o=`Z`in r?S?b+r.Z:r.Z:b,s=0;if(`E`in r){let e=S||C;s=e?r.E:r.E-x,x=e?x+r.E:r.E}if(!((n===2||n===3)&&(`I`in r||`J`in r)))P(v,y,b,i,a,o,s);else{let c=v+(r.I||0),l=y+(r.J||0),u=Math.hypot(v-c,y-l),d=Math.atan2(y-l,v-c),f=Math.atan2(a-l,i-c)-d;n===3&&f<=t&&(f+=2*Math.PI),n===2&&f>=-1e-9&&(f-=2*Math.PI);let p=Math.max(1,Math.ceil(Math.max(Math.abs(f)*u/1,Math.abs(f)/e))),m=v,h=y,g=b;for(let e=1;e<=p;e++){let t=d+f*e/p,n=e===p?i:c+u*Math.cos(t),r=e===p?a:l+u*Math.sin(t),_=b+(o-b)*e/p;P(m,h,g,n,r,_,s/p),m=n,h=r,g=_}}v=i,y=a,b=o}let L=0,R=0;for(;L<o.length;){let e=o.indexOf(`\n`,L);e<0&&(e=o.length);let t=o.slice(L,e).trim();if(L=e+1,s&&++R%5e4==0&&s(L/o.length),!t)continue;if(t[0]===`;`){F(t);continue}let n=t.indexOf(`;`),r=(n<0?t:t.slice(0,n)).trim(),i=r.match(/^([GMgm])(\\d+(?:\\.\\d+)?)(?=\\s|$)/);if(!i||i[2].includes(`.`))continue;let c=i[1].toUpperCase(),l=Number(i[2]);if(c===`G`&&l<=3)I(l,a(r.slice(i[0].length)));else if(c===`G`&&l===90)S=!1;else if(c===`G`&&l===91)S=!0;else if(c===`M`&&l===82)C=!1;else if(c===`M`&&l===83)C=!0;else if(c===`G`&&l===92){let e=a(r.slice(i[0].length));Object.keys(e).length||(v=y=b=x=0),`X`in e&&(v=e.X),`Y`in e&&(y=e.Y),`Z`in e&&(b=e.Z),`E`in e&&(x=e.E)}}s&&s(1);let z=m.printable_area?m.printable_area.split(`,`).map(e=>e.split(`x`).map(Number)):null;return Object.assign(h,{generatedBy:h.generatedBy??null,printer:m.printer_settings_id||null,process:m.print_settings_id||null,filament:m.filament_settings_id||null,filamentType:m.filament_type||null,nozzle:r(m.nozzle_diameter),layerHeight:r(m.layer_height),bed:z&&z.every(e=>e.length===2&&e.every(Number.isFinite))?z:null,bedHeight:r(m.printable_height),printTime:h.printTime??null,totalTime:h.totalTime??null,filamentG:h.filamentG??null,filamentMm:h.filamentMm??null,filamentCm3:h.filamentCm3??null}),{segments:{count:l.feature.n,start:l.start.done(),end:l.end.done(),feature:l.feature.done(),layer:l.layer.done(),width:l.width.done(),height:l.height.done()},travels:{count:u.layer.n,pos:u.pos.done(),layer:u.layer.done()},layers:d,features:f,meta:h,bounds:l.feature.n?{min:g,max:_}:null}}\n/*!\nfflate - fast JavaScript compression/decompression\n<https://101arrowz.github.io/fflate>\nLicensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE\nversion 0.8.2\n*/\nvar s=Uint8Array,c=Uint16Array,l=Int32Array,u=new s([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),d=new s([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var n=new c(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new l(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},m=p(u,2),h=m.b,g=m.r;h[28]=258,g[258]=28;var _=p(d,0),v=_.b;_.r;for(var y=new c(32768),b=0;b<32768;++b){var x=(b&43690)>>1|(b&21845)<<1;x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,y[b]=((x&65280)>>8|(x&255)<<8)>>1}for(var S=(function(e,t,n){for(var r=e.length,i=0,a=new c(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new c(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new c(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],f=o[e[i]-1]++<<d,p=f|(1<<d)-1;f<=p;++f)s[y[f]>>l]=u}else for(s=new c(r),i=0;i<r;++i)e[i]&&(s[i]=y[o[e[i]-1]++]>>15-e[i]);return s}),C=new s(288),b=0;b<144;++b)C[b]=8;for(var b=144;b<256;++b)C[b]=9;for(var b=256;b<280;++b)C[b]=7;for(var b=280;b<288;++b)C[b]=8;for(var w=new s(32),b=0;b<32;++b)w[b]=5;var T=/*#__PURE__*/ S(C,9,1),E=/*#__PURE__*/ S(w,5,1),D=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},O=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},k=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},A=function(e){return(e+7)/8|0},j=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new s(e.subarray(t,n))},M=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],N=function(e,t,n){var r=Error(t||M[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,N),!n)throw r;return r},P=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new s(0);var o=!n,c=o||t.i!=2,l=t.i;o&&(n=new s(i*3));var p=function(e){var t=n.length;if(e>t){var r=new s(Math.max(t*2,e));r.set(n),n=r}},m=t.f||0,g=t.p||0,_=t.b||0,y=t.l,b=t.d,x=t.m,C=t.n,w=i*8;do{if(!y){m=O(e,g,1);var M=O(e,g+1,3);if(g+=3,!M){var P=A(g)+4,F=e[P-4]|e[P-3]<<8,I=P+F;if(I>i){l&&N(0);break}c&&p(_+F),n.set(e.subarray(P,I),_),t.b=_+=F,t.p=g=I*8,t.f=m;continue}if(M==1)y=T,b=E,x=9,C=5;else if(M==2){var L=O(e,g,31)+257,R=O(e,g+10,15)+4,z=L+O(e,g+5,31)+1;g+=14;for(var B=new s(z),V=new s(19),H=0;H<R;++H)V[f[H]]=O(e,g+H*3,7);g+=R*3;for(var U=D(V),W=(1<<U)-1,ee=S(V,U,1),H=0;H<z;){var G=ee[O(e,g,W)];g+=G&15;var P=G>>4;if(P<16)B[H++]=P;else{var K=0,q=0;for(P==16?(q=3+O(e,g,3),g+=2,K=B[H-1]):P==17?(q=3+O(e,g,7),g+=3):P==18&&(q=11+O(e,g,127),g+=7);q--;)B[H++]=K}}var te=B.subarray(0,L),J=B.subarray(L);x=D(te),C=D(J),y=S(te,x,1),b=S(J,C,1)}else N(1);if(g>w){l&&N(0);break}}c&&p(_+131072);for(var ne=(1<<x)-1,re=(1<<C)-1,Y=g;;Y=g){var K=y[k(e,g)&ne],X=K>>4;if(g+=K&15,g>w){l&&N(0);break}if(K||N(2),X<256)n[_++]=X;else if(X==256){Y=g,y=null;break}else{var ie=X-254;if(X>264){var H=X-257,Z=u[H];ie=O(e,g,(1<<Z)-1)+h[H],g+=Z}var Q=b[k(e,g)&re],$=Q>>4;Q||N(3),g+=Q&15;var J=v[$];if($>3){var Z=d[$];J+=k(e,g)&(1<<Z)-1,g+=Z}if(g>w){l&&N(0);break}c&&p(_+131072);var ae=_+ie;if(_<J){var oe=a-J,se=Math.min(J,ae);for(oe+_<0&&N(3);_<se;++_)n[_]=r[oe+_]}for(;_<ae;++_)n[_]=n[_-J]}}t.l=y,t.p=Y,t.b=_,t.f=m,y&&(m=1,t.m=x,t.d=b,t.n=C)}while(!m);return _!=n.length&&o?j(n,0,_):n.subarray(0,_)},F=/*#__PURE__*/ new s(0),I=function(e,t){return e[t]|e[t+1]<<8},L=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},R=function(e,t){return L(e,t)+L(e,t+4)*4294967296};function z(e,t){return P(e,{i:2},t&&t.out,t&&t.dictionary)}var B=typeof TextDecoder<`u`&&/*#__PURE__*/ new TextDecoder;try{B.decode(F,{stream:!0})}catch{}var V=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:j(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function H(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(B)return B.decode(e);var i=V(e),a=i.s,n=i.r;return n.length&&N(8),a}var U=function(e,t){return t+30+I(e,t+26)+I(e,t+28)},W=function(e,t,n){var r=I(e,t+28),i=H(e.subarray(t+46,t+46+r),!(I(e,t+8)&2048)),a=t+46+r,o=L(e,t+20),s=n&&o==4294967295?ee(e,a):[o,L(e,t+24),L(e,t+42)],c=s[0],l=s[1],u=s[2];return[I(e,t+10),c,l,i,a+I(e,t+30)+I(e,t+32),u]},ee=function(e,t){for(;I(e,t)!=1;t+=4+I(e,t+2));return[R(e,t+12),R(e,t+4),R(e,t+20)]};function G(e,t){for(var n={},r=e.length-22;L(e,r)!=101010256;--r)(!r||e.length-r>65558)&&N(13);var i=I(e,r+8);if(!i)return{};var a=L(e,r+16),o=a==4294967295||i==65535;if(o){var c=L(e,r-12);o=L(e,c)==101075792,o&&(i=L(e,c+32),a=L(e,c+48))}for(var l=t&&t.filter,u=0;u<i;++u){var d=W(e,a,o),f=d[0],p=d[1],m=d[2],h=d[3],g=d[4],_=d[5],v=U(e,_);a=g,(!l||l({name:h,size:p,originalSize:m,compression:f}))&&(f?f==8?n[h]=z(e.subarray(v,v+p),{out:new s(m)}):N(14,`unknown compression type `+f):n[h]=j(e,v,v+p))}return n}Object.keys({stl:`stl`,"3mf":`3mf`,obj:`obj`,step:`step`,stp:`step`,iges:`iges`,igs:`iges`}).map(e=>`.`+e).join(`,`);function K(e,t,n=()=>{}){try{return G(e,{filter:e=>(n(e),t(e.name))})}catch{return null}}function q(e,t){let n=K(e,e=>e===`Metadata/plate_${t}.gcode`||e===`Metadata/plate_${t}.png`)||{},r=n[`Metadata/plate_${t}.gcode`];if(!r)throw Error(`This file has no G-code for plate ${t}`);return{text:new TextDecoder().decode(r),thumbnail:n[`Metadata/plate_${t}.png`]||null}}self.onmessage=async({data:e})=>{try{let t=e.text,n=null;e.plate==null?e.file&&(t=await e.file.text()):{text:t,thumbnail:n}=q(new Uint8Array(await e.file.arrayBuffer()),e.plate);let r=o(t,e=>self.postMessage({type:`progress`,value:e})),i=r.segments,a=r.travels,s=[i.start.buffer,i.end.buffer,i.feature.buffer,i.layer.buffer,i.width.buffer,i.height.buffer,a.pos.buffer,a.layer.buffer];self.postMessage({type:`done`,result:r,thumbnail:n},n?[...s,n.buffer]:s)}catch(e){self.postMessage({type:`error`,message:e.message})}};',uD=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,lD],{type:`text/javascript;charset=utf-8`});function dD(e){let t;try{if(t=uD&&(self.URL||self.webkitURL).createObjectURL(uD),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(lD),{type:`module`,name:e?.name})}}function fD(){let[e,t]=(0,I.useState)({status:`empty`}),n=(0,I.useRef)(null),r=(0,I.useRef)(null),i=()=>{n.current?.terminate(),n.current=null},a=()=>{r.current&&URL.revokeObjectURL(r.current),r.current=null},o=(0,I.useCallback)((e,o,s=null,{plate:c=null}={})=>{i(),a();let l=typeof e==`string`?e:null,u=l==null?s?e:null:new Blob([l],{type:`text/plain`});t({status:`loading`,name:o,text:l,download:u,quote:s,plate:c,progress:0});let d=e=>{i(),t(t=>({...t,status:`error`,error:`Could not read this G-code: `+e}))},f=n.current=new dD;f.onmessage=({data:e})=>{if(e.type===`progress`)t(t=>({...t,progress:e.value}));else if(e.type===`error`)d(e.message);else if(e.type===`done`){i();let n=e.result;e.thumbnail&&(r.current=URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`}))),t(e=>n.segments.count?{...e,status:`ready`,result:n,thumbnail:r.current}:{...e,status:`error`,error:`No extrusion moves found. Is this a G-code file?`})}},f.onerror=e=>d(e.message||`parser failed`),f.postMessage(l==null?{file:e,plate:c}:{text:l})},[]),s=(0,I.useCallback)(()=>{i(),a(),t({status:`empty`})},[]);return(0,I.useEffect)(()=>()=>{i(),a()},[]),{...e,open:o,close:s}}var pD=e=>Math.max(1,Math.ceil(e/2)),mD=e=>Math.floor(e/2),hD={items:[],selected:null},gD=(e,t,n)=>e.items.some(e=>e.id===t)?{...e,items:e.items.map(e=>e.id===t?n(e):e)}:e;function _D(e,t){switch(t.type){case`add`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults,r=t.files.slice(0,10-e.items.length).map(({id:e,file:t})=>({id:e,file:t,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}));return r.length?{items:[...e.items,...r],selected:r[0].id}:e}case`replace`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults;return{items:[{id:t.id,file:t.file,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}],selected:t.id}}case`remove`:{let n=e.items.findIndex(e=>e.id===t.id);if(n<0)return e;let r=e.items.filter(e=>e.id!==t.id),i=r[Math.min(n,r.length-1)];return{items:r,selected:e.selected===t.id?i?i.id:null:e.selected}}case`select`:return e.items.some(e=>e.id===t.id)?{...e,selected:t.id}:e;case`settings`:return gD(e,t.id,e=>({...e,settings:{...e.settings,...t.patch}}));case`applyToAll`:{let n=e.items.find(n=>n.id===(t.id??e.selected));return n?{...e,items:e.items.map(e=>({...e,settings:{...n.settings}}))}:e}case`copies`:return gD(e,t.id,e=>({...e,copies:typeof t.value==`function`?t.value(e.copies):t.value}));case`rotate`:return gD(e,t.id,e=>({...e,rot:t.rot}));case`result`:return gD(e,t.id,e=>({...e,result:t.result,error:null}));case`error`:return gD(e,t.id,e=>({...e,error:t.error}));default:return e}}var vD=(e,t)=>JSON.stringify([t,e.rot,[e.file.name,e.file.size,e.file.lastModified]]),yD=(e,t)=>!e.result||e.result.sig!==t||!!e.error,bD=e=>e.replace(/\.\w+$/,``);function xD({defaults:e,slice:t,requestFor:n}){let[r,i]=(0,I.useReducer)(_D,hD),a=(0,I.useRef)(0),[o,s]=(0,I.useState)(null),c=r.items.find(e=>e.id===r.selected)||null,l=e=>vD(e,n(e)),u=r.items.map(e=>({item:e,stale:!!e.result&&e.result.sig!==l(e)})),d=r.items.filter(e=>yD(e,l(e))),f=t=>{let n=10-r.items.length;if(n<=0)return Nx.error(`Up to 10 files at a time. Remove one to add another.`);i({type:`add`,defaults:e,files:t.slice(0,n).map(e=>({id:`file-${++a.current}`,file:e}))});let o=t.length-n;o>0&&Nx.error(`Up to 10 files at a time, so ${o} ${o===1?`was`:`were`} left out.`)},p=t=>i({type:`replace`,defaults:e,id:`file-${++a.current}`,file:t}),m=async({verb:e,success:r})=>{let a=(d.length?d:[c]).slice().sort((e,t)=>(t===c)-(e===c)),o=Date.now(),u=0,f=null;for(let[e,r]of a.entries()){let c=n(r),d=l(r);s({since:o,step:e+1,of:a.length,file:r.file.name,printer:c.printer});try{let e=await t.mutateAsync({model:r.file,settings:c,rot:r.rot}),n=e.gcode?new Blob([e.gcode],{type:`text/plain`}):null;i({type:`result`,id:r.id,result:{stats:e.stats,used:e.used,gcode:n,name:bD(r.file.name)+`.gcode`,material:c.material,sig:d}}),u++}catch(e){if(f=e,i({type:`error`,id:r.id,error:e.status===401?`This server needs an API key.`:e.message}),e.status===401)break}}s(null);let p=Math.max(1,Math.round((Date.now()-o)/1e3));f&&f.status===401?Nx.error(`This server needs an API key.`):u===a.length?Nx.success(r(a.length===1?a[0].file.name:`${a.length} files`,p)):a.length===1?Nx.error(f.message):Nx.error(u?`${u} of ${a.length} files ${e}. The list says what went wrong with the others.`:`None of the ${a.length} files could be ${e}. The list says why.`)},h=c&&c.id;return{items:r.items,selected:c,rows:u,todo:d,slicing:o,add:f,replace:p,sliceAll:m,setSettings:e=>i({type:`settings`,id:h,patch:e}),rotate:e=>i({type:`rotate`,id:h,rot:e}),list:{rows:u,selected:r.selected,max:10,onSelect:e=>i({type:`select`,id:e}),onRemove:e=>i({type:`remove`,id:e}),onCopies:(e,t)=>i({type:`copies`,id:e,value:t}),onApplyAll:e=>{i({type:`applyToAll`,id:e}),Nx.success(`${r.items.find(t=>t.id===e).file.name}'s settings now apply to all ${r.items.length} files`)}}}}var SD=`print-preview.theme`,CD=()=>{try{return localStorage.getItem(SD)||`system`}catch{return`system`}};function wD(){let{root:e,theme:t}=i(),[n,r]=(0,I.useState)(CD),a=t||n;return(0,I.useLayoutEffect)(()=>{let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.dataset.theme=a===`dark`||a===`system`&&t.matches?`dark`:`light`};if(n(),a===`system`)return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a,e]),(0,I.useEffect)(()=>{if(!t)try{n===`system`?localStorage.removeItem(SD):localStorage.setItem(SD,n)}catch{}},[n,t]),[a,t?null:r]}var TD=`print-preview.printer`,ED=()=>{try{return localStorage.getItem(TD)}catch{return null}},DD=[`PLA`,`PETG`,`ABS`];function OD({onMode:e}){let[t,n]=wD(),[r,i]=(0,I.useState)(KE),a=aD(),o=iD(),s=oD(r),c=fD(),l=cD(r),[u,d]=(0,I.useState)(null),f=(0,I.useRef)(null),p=(0,I.useRef)(null),[m,h]=(0,I.useState)(()=>({...gE,printer:ED()??``})),g=(0,I.useRef)(ED()!==null),_=xD({defaults:m,slice:l,requestFor:e=>e.settings}),{selected:v}=_,y=v?v.settings:m,b=e=>v?_.setSettings(e):h(t=>({...t,...e})),x=sD(y.printer,y.material,r);(0,I.useEffect)(()=>{if(typeof y.printer==`string`)try{localStorage.setItem(TD,y.printer)}catch{}},[y.printer]),(0,I.useEffect)(()=>{!g.current&&o.data&&(g.current=!0,o.data.defaultPrinter&&b({printer:o.data.defaultPrinter,process:``,filament:``}))},[o.data]),(0,I.useEffect)(()=>{(s.data&&y.printer&&!oE(s.data,y.printer)||s.error&&s.error.status!==401&&y.printer)&&b({printer:``})},[s.data,s.error,v&&v.id]);let S=y.printer?x.data&&x.data.materials:DD;(0,I.useEffect)(()=>{S&&S.length&&!S.includes(y.material)&&b({material:S.includes(`PLA`)?`PLA`:S[0],filament:``})},[S,y.material]);let C=async e=>{let{models:t,others:n}=await se(e);if(t.length){_.add(t),n.length&&Nx.error(`${n.map(e=>e.file.name).join(`, `)}: not added. Open G-code files on their own.`);return}if(!n.length)return;let{file:r,what:i}=n[0];i.kind===`gcode`?c.open(r,r.name):i.kind===`gcode3mf`&&i.plates.length===1?c.open(r,r.name,null,{plate:i.plates[0].plate}):i.kind===`gcode3mf`?d({file:r,plates:i.plates}):Nx.error(`${r.name} is not a model or G-code file. Use STL, 3MF, OBJ, STEP, IGES or G-code.`)},w=cC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:C}),T=v&&v.result;(0,I.useEffect)(()=>{T&&T.gcode?c.open(T.gcode,T.name,{stats:T.stats,used:T.used}):c.close()},[v&&v.id,T]);let E=e=>{_.rotate(e),c.status!==`empty`&&c.close()},D=_.items.find(e=>e.settings.printer===null),O=_.items.length?D?D===v?`Choose a model for this brand.`:`Choose a printer model for ${D.file.name}.`:a.isError?`The server can’t be reached.`:a.data&&!a.data.slicer?`Slicing is off on this server. You can still open G-code files.`:null:`Choose a model file to slice.`,k=[o.error,s.error,x.error,l.error].some(e=>e&&e.status===401),A=_.slicing&&{..._.slicing,title:`Slicing ${_.slicing.file}${_.slicing.of>1?` (${_.slicing.step} of ${_.slicing.of})`:``}`,printer:_.slicing.printer||`Your printer`};return/* @__PURE__ */ (0,L.jsxs)(`div`,{...w.getRootProps({className:`flex min-h-full flex-col outline-none lg:h-full`}),children:[/* @__PURE__ */ (0,L.jsx)(ww,{mode:`advanced`,onMode:e,health:a,onOpenGcode:()=>f.current.click(),apiKey:r,keyNeeded:k,onSaveKey:e=>{qE(e),i(e)},theme:t,onTheme:n}),/* @__PURE__ */ (0,L.jsx)(`input`,{ref:f,type:`file`,accept:le,hidden:!0,onChange:e=>{C([...e.target.files].slice(0,1)),e.target.value=``}}),/* @__PURE__ */ (0,L.jsx)(`input`,{ref:p,type:`file`,accept:ce,multiple:!0,hidden:!0,onChange:e=>{C([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex flex-1 flex-col lg:min-h-0 lg:flex-row`,children:[/* @__PURE__ */ (0,L.jsx)(`main`,{className:`min-w-0 lg:order-2 lg:flex-1`,children:/* @__PURE__ */ (0,L.jsx)(WE,{gcode:c,model:v&&v.file,rot:v?v.rot:[0,0,0],slicing:A,onOpenGcode:()=>f.current.click(),onChooseModel:()=>p.current.click()})}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:`lg:order-1 lg:flex lg:min-h-0`,children:/* @__PURE__ */ (0,L.jsx)(wE,{files:{..._.list,onAdd:()=>p.current.click()},onFiles:C,model:v&&v.file,rot:v?v.rot:[0,0,0],onRotate:E,settings:y,onSettings:b,printers:s,ourPrinters:Hw(o.data),options:x,toSlice:_.todo.length,slicingSince:_.slicing&&_.slicing.since,blocker:O,onSlice:()=>_.sliceAll({verb:`sliced`,success:(e,t)=>`Sliced ${e} in ${t} s`})})})]}),/* @__PURE__ */ (0,L.jsx)(Ew,{show:w.isDragActive,text:`Drop models to slice them, or G-code to open it`}),/* @__PURE__ */ (0,L.jsx)(Tw,{pick:u,onClose:()=>d(null),onPick:e=>{c.open(u.file,`${u.file.name}, plate ${e}`,null,{plate:e}),d(null)}})]})}function kD({title:e,aside:t,action:n}){return/* @__PURE__ */ (0,L.jsxs)(`header`,{className:`mb-3 flex items-baseline justify-between gap-4`,children:[/* @__PURE__ */ (0,L.jsx)(`h2`,{className:`font-display text-[16px] leading-tight font-semibold tracking-[-0.01em]`,children:e}),t&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`min-w-0 text-right text-[11px] text-muted`,children:t}),n]})}function AD({area:e,title:t,aside:n,action:r,className:i,children:a}){return/* @__PURE__ */ (0,L.jsxs)(`section`,{className:k(`min-w-0 rounded-[20px] bg-panel p-5`,i),style:{gridArea:e},children:[t&&/* @__PURE__ */ (0,L.jsx)(kD,{title:t,aside:n,action:r}),a]})}function jD({label:e,value:t,onChange:n,options:r,stack:i}){return/* @__PURE__ */ (0,L.jsx)(gc,{type:`single`,"aria-label":e,value:String(t),onValueChange:e=>{e&&n(e)},className:i?`grid gap-1.5`:`flex flex-wrap gap-1.5`,children:r.map(e=>/* @__PURE__ */ (0,L.jsxs)(Tc,{value:String(e.value),className:k(`flex min-h-10 items-center justify-between gap-3 rounded-[12px] bg-raise px-3.5 text-[14px] font-medium text-ink transition-colors hover:bg-rule`,`data-[state=on]:bg-accent data-[state=on]:text-accent-contrast`,!i&&`flex-1 justify-center`),children:[/* @__PURE__ */ (0,L.jsx)(`span`,{children:e.label}),e.aside&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num text-[12px] font-normal opacity-75`,children:e.aside})]},e.value))})}var MD=[{id:`FDM`,name:`Filament`,hint:`Strong everyday parts in PLA, PETG, ABS or TPU`,priced:!0},{id:`SLA`,name:`Resin`,hint:`Fine detail and smooth surfaces, for small precise parts`,priced:!1},{id:`SLS`,name:`Nylon powder`,hint:`Tough, functional nylon parts, no supports needed`,priced:!1}];function ND(e,t,n){if(!e||!e.email)return null;let r=`${e.name?`Hello ${e.name},`:`Hello,`}\n\n${n.length?`I'd like these printed in ${t}:\n${n.map(e=>`- ${e}`).join(`
|
|
55
|
-
`)}`:`I'd like some parts printed in ${t}. I'll attach the models.`}\n\nWhat they're for, and how many I need:\n\n`;return`mailto:${e.email}?subject=${encodeURIComponent(`${t} print enquiry`)}&body=${encodeURIComponent(r)}`}function PD({id:e}){let t={width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`FDM`?/* @__PURE__ */ (0,L.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M10 4h8v5l-3 4h-2l-3-4z`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M14 13v3`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M5 20h18M7 23.5h14`})]}):e===`SLA`?/* @__PURE__ */ (0,L.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M8 5h12v6H8z`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M5 17h18l-2 6H7z`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M14 11v6`,strokeDasharray:`1.5 2`})]}):/* @__PURE__ */ (0,L.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M4 18h20v6H4z`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M9 21h.01M14 21h.01M19 21h.01`,strokeWidth:2.4}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M20 4l-5 12`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M18 4h4`})]})}function FD({value:e,onChange:t,action:n}){let r=MD.find(t=>t.id===e);return/* @__PURE__ */ (0,L.jsxs)(AD,{area:`process`,title:`How should we print it?`,action:n,children:[/* @__PURE__ */ (0,L.jsx)(gc,{type:`single`,"aria-label":`Printing process`,value:e,onValueChange:e=>{e&&t(e)},className:`grid grid-cols-3 gap-2`,children:MD.map(e=>/* @__PURE__ */ (0,L.jsxs)(Tc,{value:e.id,className:`flex flex-col items-start gap-2 rounded-[16px] bg-raise p-3 text-left outline-offset-2 transition-colors hover:bg-rule data-[state=on]:bg-panel data-[state=on]:ring-2 data-[state=on]:ring-silver-edge`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`text-muted in-data-[state=on]:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(PD,{id:e.id})}),/* @__PURE__ */ (0,L.jsxs)(`span`,{children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`block font-display text-[18px] leading-none font-semibold`,children:e.id}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`mt-1 block text-[12px] text-muted`,children:e.name})]})]},e.id))}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-3 text-[13px] text-muted`,children:[r.hint,`.`,!r.priced&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`font-medium text-ink`,children:` Quoted by our team.`})]})]})}var ID=(0,I.lazy)(()=>import(`./chunks/ModelPreview-CYVyGDd1.js`));function LD({model:e,single:t,onChoose:n}){return/* @__PURE__ */ (0,L.jsx)(`section`,{style:{gridArea:`model`},className:k(`relative overflow-hidden rounded-[28px] lg:min-h-[480px]`,e?`min-h-[480px] bg-viewer`:`min-h-[360px] bg-panel p-3`),children:e?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(I.Suspense,{fallback:null,children:/* @__PURE__ */ (0,L.jsx)(ID,{file:e,customer:!0})}),t&&/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,onClick:n,className:`absolute right-3 bottom-3 rounded-xl bg-panel px-3.5 py-2 text-[13px] font-medium transition-colors hover:bg-raise`,children:`Choose another file`})]}):/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:n,className:`group flex h-full min-h-[336px] w-full flex-col items-center justify-center gap-3 rounded-[20px] border-2 border-dashed border-rule bg-raise px-6 text-center transition-colors hover:border-accent lg:min-h-[456px]`,style:{backgroundImage:`linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px)`,backgroundSize:`28px 28px`,backgroundPosition:`center`},children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`grid size-14 place-items-center rounded-2xl bg-accent text-accent-contrast transition-transform group-hover:-translate-y-0.5`,children:/* @__PURE__ */ (0,L.jsx)(fw,{className:`size-6`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 font-display text-[24px] leading-tight font-semibold`,children:[`Drop your 3D `,t?`model`:`models`,` here`]}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 text-[14px] text-muted`,children:[`or `,/* @__PURE__ */ (0,L.jsx)(`span`,{className:`font-medium text-ink underline underline-offset-4`,children:t?`choose a file`:`choose files`}),`. STL, 3MF, OBJ or STEP, up to `,t?`50 MB`:`10 files of 50 MB`]})]})})}function RD({icon:e,children:t}){return/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[/* @__PURE__ */ (0,L.jsx)(e,{className:`size-3 shrink-0`,"aria-hidden":!0}),` `,t]})}function zD({name:e,value:t,onChange:n}){let r=e=>n(t=>Math.min(50,Math.max(1,t+e))),i=`grid size-9 place-items-center rounded-lg text-ink transition-colors hover:bg-rule disabled:text-muted disabled:opacity-50`;return/* @__PURE__ */ (0,L.jsxs)(`div`,{role:`group`,"aria-label":`Copies of ${e}`,className:`flex shrink-0 items-center rounded-xl bg-raise p-0.5`,children:[/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`One copy fewer`,disabled:t<=1,onClick:()=>r(-1),className:i,children:/* @__PURE__ */ (0,L.jsx)(KC,{className:`size-3`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num w-8 text-center text-[14px] font-semibold`,"aria-live":`polite`,children:t}),/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`One copy more`,disabled:t>=50,onClick:()=>r(1),className:i,children:/* @__PURE__ */ (0,L.jsx)(QC,{className:`size-4`,"aria-hidden":!0})})]})}function BD({name:e,onApplyAll:t,onRemove:n}){let{portal:r}=i(),a=`cursor-pointer rounded-lg px-3 py-2 text-[14px] outline-none data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,L.jsxs)(Ma,{children:[/* @__PURE__ */ (0,L.jsx)(Pa,{"aria-label":`More for ${e}`,className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(OC,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(Fa,{container:r,children:/* @__PURE__ */ (0,L.jsxs)(La,{align:`end`,sideOffset:4,className:`z-50 min-w-[240px] rounded-xl border border-rule bg-panel p-1 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:[t&&/* @__PURE__ */ (0,L.jsx)(Ra,{className:a,onSelect:t,children:`Use these settings for all files`}),/* @__PURE__ */ (0,L.jsx)(Ra,{className:k(a,`text-danger`),onSelect:n,children:`Remove file`})]})})]})}function VD({row:{item:e,stale:t},line:n,thumb:r,on:i,priced:a,onSelect:o,onRemove:s,onCopies:c,onApplyAll:l}){let u=e.file.name,d=e.result&&e.result.stats.sizeMm||r&&r.size,f=d?/* @__PURE__ */ (0,L.jsxs)(RD,{icon:iw,children:[d.map(e=>e.toFixed(1)).join(` × `),` mm`]}):/* @__PURE__ */ (0,L.jsx)(`span`,{children:kw(e.file.size)}),p=a&&n&&!t&&!e.error;return/* @__PURE__ */ (0,L.jsxs)(`li`,{className:k(`flex flex-wrap items-center gap-x-3 gap-y-2 rounded-2xl border bg-panel p-2 transition-colors @xl:flex-nowrap`,i?`border-accent`:`border-rule`),children:[/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,"aria-current":i||void 0,onClick:o,className:`flex min-w-0 flex-1 basis-full items-center gap-3.5 rounded-xl text-left @xl:basis-0`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`grid size-[62px] shrink-0 place-items-center overflow-hidden rounded-xl bg-raise`,children:r?/* @__PURE__ */ (0,L.jsx)(`img`,{src:r.url,alt:``,className:`size-full object-contain`}):/* @__PURE__ */ (0,L.jsx)(_,{className:`size-6 text-muted`,strokeWidth:1.6,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:u,children:u}),e.error?/* @__PURE__ */ (0,L.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-[13px] text-warn`,title:e.error,children:e.error}):/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12px] text-muted`,children:[p&&/* @__PURE__ */ (0,L.jsx)(RD,{icon:_,children:Yw(n.gramsRange)}),p&&/* @__PURE__ */ (0,L.jsx)(RD,{icon:wC,children:Xw(n.secondsRange)}),f,a&&!n&&/* @__PURE__ */ (0,L.jsx)(`span`,{children:`Not priced yet`}),a&&t&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`text-warn`,children:`Changed, update the price`})]})]})]}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-3 @xl:w-auto`,children:[p&&n.range&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num mr-auto text-[14px] font-semibold whitespace-nowrap @xl:mr-1`,children:Jw(n.range,n.currency)}),a&&/* @__PURE__ */ (0,L.jsx)(zD,{name:u,value:e.copies,onChange:c}),/* @__PURE__ */ (0,L.jsx)(BD,{name:u,onApplyAll:a?l:void 0,onRemove:s})]})]})}function HD({page:e,pages:t,first:n,last:r,count:i,onPage:a}){let o=`grid size-8 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink disabled:opacity-40 disabled:hover:bg-transparent`;return/* @__PURE__ */ (0,L.jsxs)(`nav`,{"aria-label":`File pages`,className:`flex items-center justify-between gap-2 pt-1`,children:[/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num text-[13px] text-muted`,children:[n===r?n:`${n}–${r}`,` of `,i]}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Previous files`,disabled:e===0,onClick:()=>a(e-1),className:o,children:/* @__PURE__ */ (0,L.jsx)(vC,{className:`size-4`,"aria-hidden":!0})}),Array.from({length:t},(t,n)=>/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Page ${n+1}`,"aria-current":n===e?`page`:void 0,onClick:()=>a(n),className:k(`num grid size-8 place-items-center rounded-lg text-[13px] font-medium transition-colors`,n===e?`bg-accent text-accent-contrast`:`text-muted hover:bg-raise hover:text-ink`),children:n+1},n)),/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Next files`,disabled:e===t-1,onClick:()=>a(e+1),className:o,children:/* @__PURE__ */ (0,L.jsx)(gC,{className:`size-4`,"aria-hidden":!0})})]})]})}function UD({files:e,lineCost:t,thumbs:n,priced:r}){let i=e.rows.length,a=pD(i),[o,s]=(0,I.useState)(0),c=Math.min(o,a-1);(0,I.useEffect)(()=>{let t=e.rows.findIndex(t=>t.item.id===e.selected);t>=0&&s(mD(t))},[e.selected]);let l=e.rows.slice(c*2,(c+1)*2),u=i>0&&/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num rounded-full border border-rule px-2.5 py-0.5 text-[13px] text-muted`,children:[i,` of `,e.max]});return/* @__PURE__ */ (0,L.jsx)(AD,{area:`files`,title:`Your files`,action:u,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`@container space-y-2`,children:[i<e.max&&/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:e.onAdd,className:`flex w-full items-center gap-4 rounded-2xl border border-dashed border-rule p-2.5 text-left transition-colors hover:border-accent`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`grid size-12 shrink-0 place-items-center rounded-full bg-raise`,children:/* @__PURE__ */ (0,L.jsx)(QC,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`block text-[14px] font-semibold`,children:i?`Add more files`:`Add files`}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Upload STL, 3MF, OBJ or STEP (max `,e.max,` files)`]})]})]}),i>0&&/* @__PURE__ */ (0,L.jsx)(`ul`,{className:k(`space-y-2`,a>1&&`min-h-[284px] @xl:min-h-[188px]`),children:l.map(a=>/* @__PURE__ */ (0,L.jsx)(VD,{row:a,line:a.item.result?t(a.item):null,thumb:n[a.item.id],on:a.item.id===e.selected,priced:r,onSelect:()=>e.onSelect(a.item.id),onRemove:()=>e.onRemove(a.item.id),onCopies:t=>e.onCopies(a.item.id,t),onApplyAll:i>1?()=>e.onApplyAll(a.item.id):void 0},a.item.id))}),a>1&&/* @__PURE__ */ (0,L.jsx)(HD,{page:c,pages:a,first:c*2+1,last:Math.min((c+1)*2,i),count:i,onPage:s})]})})}function WD({simple:e,onSimple:t,materials:n,printer:r}){let i=n.find(t=>t.id===e.material),a=Bw(e.material,r),o=Math.max(0,Nw.findIndex(t=>t.id===e.quality));return/* @__PURE__ */ (0,L.jsxs)(AD,{area:`material`,children:[/* @__PURE__ */ (0,L.jsx)(kD,{title:`Material`,aside:i&&i.hint}),/* @__PURE__ */ (0,L.jsx)(jD,{label:`Material`,value:e.material,onChange:e=>t({material:e}),options:n.map(e=>({value:e.id,label:e.id}))}),a&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-2.5 text-[13px] text-warn`,children:a}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-5 border-t border-rule pt-4`,children:[/* @__PURE__ */ (0,L.jsx)(kD,{title:`Finish`,aside:`${Nw[o].mm} mm layers`}),/* @__PURE__ */ (0,L.jsx)(hE,{bare:!0,label:`Finish`,values:Nw.map((e,t)=>t),value:o,onChange:e=>t({quality:Nw[e].id}),format:e=>Nw[e].label,valueText:e=>`${Nw[e].label}, ${Nw[e].mm} mm layers`,captions:Nw.map(e=>e.label)})]})]})}function GD({simple:e,onSimple:t}){return/* @__PURE__ */ (0,L.jsx)(AD,{area:`strength`,title:`Strength`,children:/* @__PURE__ */ (0,L.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`grid gap-4 @md:grid-cols-2 @md:gap-6`,children:[/* @__PURE__ */ (0,L.jsx)(hE,{label:`Infill`,values:_E,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,captions:[`Lighter`,`Stronger`]}),/* @__PURE__ */ (0,L.jsx)(hE,{label:`Walls`,values:Pw,value:e.walls,onChange:e=>t({walls:e}),format:e=>`${e} ${e===1?`wall`:`walls`}`,captions:[Pw[0],Pw[Pw.length-1]]})]})})})}var KD=`silver-fill inline-flex h-11 w-full items-center justify-center gap-2 rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90 disabled:opacity-50`;function qD({children:e}){let{portal:t}=i();return/* @__PURE__ */ (0,L.jsxs)(Xa,{children:[/* @__PURE__ */ (0,L.jsx)(Qa,{"aria-label":`How this price is worked out`,className:`grid size-6 place-items-center rounded-full opacity-75 transition-opacity hover:opacity-100`,children:/* @__PURE__ */ (0,L.jsx)(RC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(no,{container:t,children:/* @__PURE__ */ (0,L.jsx)(io,{side:`top`,sideOffset:4,collisionPadding:12,className:`z-50 max-w-[260px] space-y-1.5 rounded-xl border border-rule bg-panel p-3 text-[13px] text-ink shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:e})})]})}function JD({children:e}){return/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[13px] text-hero-warn`,children:[/* @__PURE__ */ (0,L.jsx)(SC,{className:`mt-px size-4 shrink-0`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{children:e})]})}function YD({estimate:e,percent:t,files:n,missing:r,stale:i,pieces:a,quick:o,ready:s,slicing:c,blocker:l,onEstimate:u,onDetails:d}){let f=CE(c&&c.since),p=i+r>0,m=e&&e.range;return/* @__PURE__ */ (0,L.jsxs)(`section`,{style:{gridArea:`cost`},className:`hero @container flex min-w-0 flex-col justify-between gap-5 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,L.jsx)(`h2`,{className:`text-[14px] font-medium opacity-75`,children:`Estimated price`}),e&&(m||o)&&/* @__PURE__ */ (0,L.jsxs)(qD,{children:[m&&/* @__PURE__ */ (0,L.jsxs)(`p`,{children:[`Worked out from the material your models use.`,t>0&&` The range runs from that price to ${t}% more.`]}),o&&/* @__PURE__ */ (0,L.jsx)(`p`,{children:`A quick estimate, from the shape of your models.`})]})]}),e?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[m?/* @__PURE__ */ (0,L.jsx)(gx.p,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.35},className:`num mt-1.5 font-display text-[34px] leading-[1.05] font-semibold tracking-[-0.02em] @sm:text-[40px]`,children:Jw(m,e.currency)},`${m.low}-${m.high}`):/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-1.5 font-display text-[24px] leading-tight font-semibold`,children:[`No price set for `,e.unpriced.join(` or `),` yet`]}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-5 gap-y-1 text-[13px] opacity-85`,children:[/* @__PURE__ */ (0,L.jsxs)(RD,{icon:_,children:[Yw(e.gramsRange),` of material`]}),/* @__PURE__ */ (0,L.jsxs)(RD,{icon:wC,children:[`About `,Xw(e.secondsRange)]}),n>1&&/* @__PURE__ */ (0,L.jsxs)(RD,{icon:IC,children:[n,` files, `,a,` pieces`]})]})]}):/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1.5 text-[15px] opacity-85`,children:n?`Your files are ready. Get the price when your choices are set.`:`Upload a model, and its price shows here.`}),p&&!c&&e&&/* @__PURE__ */ (0,L.jsxs)(JD,{children:[r?`${r} ${r===1?`file has`:`files have`} no price yet.`:`Your choices changed.`,` Update the price to include `,r+i===1?`it`:`them`,`.`]}),l&&!c&&n>0&&/* @__PURE__ */ (0,L.jsx)(JD,{children:l})]}),s&&e&&!c?/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,className:KD,onClick:d,children:`View details`}):/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,className:KD,disabled:!n||!!l||!!c,onClick:u,children:c?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(w,{className:`size-[18px] animate-spin`,"aria-hidden":!0}),` Working it out`,c.of>1?`, ${c.step} of ${c.of}`:``,` `,/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num`,children:[f,` s`]})]}):e?`Update the price`:`Get the price`})]})}var XD={SLA:`Resin is cured layer by layer with light, for fine detail and smooth surfaces: miniatures, small precise parts, moulds.`,SLS:`A laser fuses nylon powder, for tough, functional parts with no supports: clips, hinges, housings that take a beating.`};function ZD({process:e,contact:t,fileNames:n}){let r=MD.find(t=>t.id===e),i=ND(t,e,n),a=t&&t.name||`our lab`;return/* @__PURE__ */ (0,L.jsxs)(`section`,{style:{gridArea:`contact`},className:`hero flex min-w-0 flex-col justify-between gap-6 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`max-w-md`,children:[/* @__PURE__ */ (0,L.jsxs)(`h2`,{className:`font-display text-[24px] leading-tight font-semibold`,children:[r.id,` prints are quoted by our team`]}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:XD[e]}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:[`Email `,a,` your models and what they’re for, and we’ll reply with a price.`,n.length?` The email lists your files; attach them before you send it.`:``]})]}),i?/* @__PURE__ */ (0,L.jsxs)(`a`,{href:i,className:`silver-fill inline-flex h-11 items-center justify-center gap-2 self-start rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90`,children:[/* @__PURE__ */ (0,L.jsx)(WC,{className:`size-[18px]`,"aria-hidden":!0}),` Email us about `,r.id]}):/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`text-[14px] font-medium`,children:[`Ask at `,a,` for a price.`]})]})}function QD({label:e,children:t}){return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,L.jsx)(`dt`,{className:`text-[12px] text-muted`,children:e}),/* @__PURE__ */ (0,L.jsx)(`dd`,{className:`num display mt-1 text-[18px] leading-tight font-semibold`,children:t})]})}function $D({details:e,onClose:t}){let{portal:n}=i(),r=t=>Jw(t,e.currency),a=e&&e.items.length;return/* @__PURE__ */ (0,L.jsx)(Ar,{open:!!e,onOpenChange:e=>{e||t()},children:/* @__PURE__ */ (0,L.jsxs)(Pr,{container:n,children:[/* @__PURE__ */ (0,L.jsx)(Ir,{className:`fixed inset-0 z-50 bg-black/50`}),/* @__PURE__ */ (0,L.jsxs)(Br,{className:`@container fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-32px)] w-[min(640px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-rule bg-panel shadow-[0_24px_64px_-24px_rgb(0_0_0/0.5)]`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-rule px-5 py-3.5`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,L.jsx)(Wr,{className:`text-[16px] font-semibold`,children:`Estimate details`}),/* @__PURE__ */ (0,L.jsx)(Gr,{className:`text-[13px] text-muted`,children:e&&`${a} ${a===1?`file`:`files`}, ${e.pieces} ${e.pieces===1?`piece`:`pieces`}, estimated for our ${e.printer?Vw(e.printer):`printer`}`})]}),/* @__PURE__ */ (0,L.jsx)(qr,{className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted hover:bg-raise hover:text-ink`,"aria-label":`Close`,children:/* @__PURE__ */ (0,L.jsx)(mw,{className:`size-5`,"aria-hidden":!0})})]}),e&&/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(`ul`,{className:`min-h-0 flex-1 divide-y divide-rule overflow-y-auto px-5`,children:e.items.map((e,t)=>/* @__PURE__ */ (0,L.jsxs)(`li`,{className:`flex flex-col gap-2 py-4 @xl:flex-row @xl:items-start @xl:justify-between @xl:gap-6`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,L.jsx)(`p`,{className:`truncate text-[14px] font-medium`,title:e.title,children:e.title}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1 text-[12px] text-muted`,children:e.settings}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[12px] text-muted`,children:e.each})]}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`num flex shrink-0 items-baseline justify-between gap-3 @xl:flex-col-reverse @xl:items-end @xl:gap-0.5`,children:[/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`text-[12px] text-muted`,children:[e.quantity,` `,e.quantity===1?`copy`:`copies`]}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[14px] font-semibold`,children:e.range?r(e.range):`No price`})]})]},t))}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`border-t border-rule bg-raise px-5 py-4`,children:[/* @__PURE__ */ (0,L.jsxs)(`dl`,{className:`grid grid-cols-3 gap-4`,children:[/* @__PURE__ */ (0,L.jsx)(QD,{label:`Total weight`,children:Yw(e.total.gramsRange)}),/* @__PURE__ */ (0,L.jsx)(QD,{label:`Total print time`,children:Xw(e.total.secondsRange)}),/* @__PURE__ */ (0,L.jsx)(QD,{label:`Total cost`,children:e.total.range?r(e.total.range):/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`text-[13px] font-medium text-warn`,children:[`No price set for `,e.total.unpriced.join(` or `),` yet`]})})]}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-3 text-[12px] text-muted`,children:[e.quick?`Quick estimates from each model’s shape, not sliced, so the final figures can differ.`:`Each file is worked out on its own.`,` `,`Print time assumes the prints run one after another.`,e.percent>0&&` Cost, weight and time are ranges: the calculated figure up to ${e.percent}% more.`]})]})]})]})]})})}function eO(e){let[t,n]=(0,I.useState)(()=>matchMedia(e).matches);return(0,I.useEffect)(()=>{let t=matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function tO({theme:e,onTheme:t}){let n=eO(`(prefers-color-scheme: dark)`),r=e===`dark`||e===`system`&&n;return/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":`Dark theme`,title:r?`Switch to light`:`Switch to dark`,onClick:()=>t(r?`light`:`dark`),className:`relative inline-flex h-7 w-[52px] shrink-0 items-center rounded-full bg-raise p-0.5 transition-colors hover:bg-rule`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{"aria-hidden":!0,className:k(`absolute top-0.5 left-0.5 size-6 rounded-full bg-accent transition-transform duration-200`,r&&`translate-x-6`)}),/* @__PURE__ */ (0,L.jsx)(uw,{className:k(`relative z-10 m-1 size-4 transition-colors`,r?`text-muted`:`text-accent-contrast`),"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(XC,{className:k(`relative z-10 m-1 size-4 transition-colors`,r?`text-accent-contrast`:`text-muted`),"aria-hidden":!0})]})}function nO(e){let[t,n]=(0,I.useState)({}),r=(0,I.useRef)(/* @__PURE__ */ new Set),i=(0,I.useRef)(Promise.resolve()),a=e.map(e=>e.id).join();return(0,I.useEffect)(()=>{for(let{id:t,file:a}of e)r.current.has(t)||(r.current.add(t),i.current=i.current.then(async()=>{if(await new Promise(e=>setTimeout(e)),!r.current.has(t))return;let{renderThumbnail:e}=await import(`./chunks/thumbnail-21laMIqI.js`),i=await e(a).catch(()=>null);i&&(r.current.has(t)?n(e=>({...e,[t]:i})):URL.revokeObjectURL(i.url))}));let t=new Set(e.map(e=>e.id));for(let e of r.current)t.has(e)||r.current.delete(e);n(e=>{let n=Object.keys(e).filter(e=>!t.has(e));return n.length?(n.forEach(t=>URL.revokeObjectURL(e[t].url)),Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))):e})},[a]),t}var rO=e=>e.map(e=>`"${e.join(` `)}"`).join(` `),iO=(e,t)=>Array(t).fill(e);function aO(e,t){let n=t=>e.has(t),r=n(`model`)?`model`:null,i=n(`files`)?`files`:null,a=t?[`material`,`strength`].filter(n):[],o=n(t?`cost`:`contact`)?t?`cost`:`contact`:null,s=[`process`,`model`,`files`,...a,o].filter(e=>e&&n(e)),c=!t&&i&&o,l=s.filter(e=>!c||e!==i&&e!==o).map(e=>iO(e,2));c&&l.push([i,o]);let u=[...n(`process`)?[`process`]:[],...a];o&&(!i||!t&&r)&&u.push(o);let d=u.length?u.map(e=>r?[r,r,e,e]:iO(e,4)):r?[iO(r,4)]:[],f=i?o?[[i,i,o,o]]:[iO(i,4)]:[];return{one:rO(s.map(e=>[e])),two:rO(l),four:rO([...d,...f])}}function oO(e,t){let n=Qw(e.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material})),t);return{currency:n.currency,range:n.range,gramsRange:n.gramsRange,secondsRange:n.secondsRange,unpriced:n.unpriced,quick:e.some(e=>e.result.stats.estimated),files:e.map(e=>{let{range:n,gramsRange:r,secondsRange:i}=Zw(e.result.stats,e.copies,e.result.material,t);return{name:e.file.name,file:e.file,copies:e.copies,settings:e.settings,range:n,gramsRange:r,secondsRange:i}})}}function sO({currency:e,perGram:t,range:n,lines:r}){let i={currency:e,perGram:t,range:n},a=Qw(r.map(e=>({stats:e.stats,copies:e.copies,material:e.settings.material})),i);return{currency:e,percent:n||0,items:r.map(({modelName:e,settings:t,stats:n,copies:r})=>{let a=Zw(n,1,t.material,i),o=Nw.find(e=>e.id===t.quality),s=`${t.walls} ${Number(t.walls)===1?`wall`:`walls`}`;return{title:e,settings:`${t.material}, ${o.label} finish (${o.mm} mm layers), ${t.infill}% infill, ${s}, ${t.supports?`with supports`:`no supports`}`,each:`about ${Yw(a.gramsRange)} and ${Xw(a.secondsRange)} each`,quantity:r,range:Zw(n,r,t.material,i).range}}),total:{gramsRange:a.gramsRange,secondsRange:a.secondsRange,range:a.range,unpriced:a.unpriced}}}function cO(){let{config:e,emit:t,actions:n}=i(),[r,a]=wD(),o=iD(),s=aD(),c=cD(KE()),[l,u]=(0,I.useState)(`FDM`),[d,f]=(0,I.useState)(()=>({...Fw,...e.defaults})),[p,m]=(0,I.useState)(null),h=(0,I.useRef)(null),g=JSON.stringify(e.defaults);(0,I.useEffect)(()=>f(t=>({...t,...e.defaults})),[g]);let _=o.data,v=_&&_.defaultPrinter||``,y=!_||_.regularMode.supports,b=Rw(_&&_.regularMode.mode,s.data?s.data.slicer:void 0),x=_?_.pricing:null,S=xD({defaults:d,slice:c,requestFor:e=>Lw({...e.settings,printer:v,supports:y,mode:b})}),{selected:C}=S,w=C?C.settings:d,T=e=>C?S.setSettings(e):f(t=>({...t,...e})),E=nO(S.items),D=tD(e),O=!D.has(`files`),k=sD(v,w.material,KE()),A=Iw(v?k.data?k.data.materials:jw.map(e=>e.id):null),ee=A.map(e=>e.id).join();(0,I.useEffect)(()=>{A.length&&!A.some(e=>e.id===w.material)&&T({material:A[0].id})},[ee,w.material]);let te=async e=>{let{models:t,others:n}=await se(e);t.length&&(O?S.replace(t[0]):S.add(t)),n.length&&Nx.error(`${n.map(e=>e.file.name).join(`, `)}: not a 3D model. Use STL, 3MF, OBJ, STEP or IGES.`)},j=cC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:te}),M=S.items.filter(e=>e.result),ne=M.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material})),N=e=>Zw(e.result.stats,e.copies,e.result.material,x),P=S.items.length?s.isError?`The server can’t be reached.`:s.data&&!s.data.slicer&&b===`exact`?`Prices can’t be worked out right now. Please try again later.`:null:`Upload a model to get a price.`,F=()=>m({...sO({currency:x?x.currency:null,perGram:x?x.perGram:{},range:x?x.range:0,lines:S.items.map(e=>({modelName:e.file.name,settings:{...e.settings,supports:y},stats:e.result.stats,copies:e.copies}))}),printer:v,pieces:S.items.reduce((e,t)=>e+t.copies,0),quick:S.items.some(e=>e.result.stats.estimated)}),re={...S.list,onAdd:()=>h.current.click()},ie=MD.find(e=>e.id===l).priced,ae=aO(D,ie),oe=()=>S.sliceAll({verb:`priced`,success:e=>`Price ready for ${e}`}),le=ie&&M.length===S.items.length&&!S.todo.length&&!S.slicing&&S.items.length>0,ue=(0,I.useRef)(null),de=e=>{let n=oO(S.items,x),r=JSON.stringify({...n,files:n.files.map(({file:e,...t})=>t)});(e||r!==ue.current)&&t(`estimate`,n),ue.current=r};return(0,I.useEffect)(()=>{le&&de(!1)}),(0,I.useEffect)(()=>{n.getPrice=()=>{if(ie&&S.items.length&&!S.slicing&&!P)return S.todo.length?oe():de(!0)}}),/* @__PURE__ */ (0,L.jsxs)(`div`,{...j.getRootProps({className:`outline-none`}),children:[/* @__PURE__ */ (0,L.jsx)(`input`,{ref:h,type:`file`,accept:ce,multiple:!O,hidden:!0,onChange:e=>{te([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,L.jsx)(`main`,{className:`mx-auto w-full max-w-[1440px] p-3 sm:p-4`,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`bento`,style:{"--areas-one":ae.one,"--areas-two":ae.two,"--areas-four":ae.four},children:[D.has(`process`)&&/* @__PURE__ */ (0,L.jsx)(FD,{value:l,onChange:u,action:a&&/* @__PURE__ */ (0,L.jsx)(tO,{theme:r,onTheme:a})}),D.has(`model`)&&/* @__PURE__ */ (0,L.jsx)(LD,{model:C&&C.file,single:O,onChoose:()=>h.current.click()}),D.has(`files`)&&/* @__PURE__ */ (0,L.jsx)(UD,{files:re,lineCost:N,thumbs:E,priced:ie}),ie?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[D.has(`material`)&&/* @__PURE__ */ (0,L.jsx)(WD,{simple:w,onSimple:T,materials:A,printer:v}),D.has(`strength`)&&/* @__PURE__ */ (0,L.jsx)(GD,{simple:w,onSimple:T}),D.has(`cost`)&&/* @__PURE__ */ (0,L.jsx)(YD,{estimate:ne.length?Qw(ne,x):null,percent:x?x.range:0,files:S.items.length,missing:S.items.length-M.length,stale:S.rows.filter(e=>e.stale).length,pieces:S.items.reduce((e,t)=>e+t.copies,0),quick:M.some(e=>e.result.stats.estimated),ready:!S.todo.length,slicing:S.slicing,blocker:P,onDetails:F,onEstimate:oe})]}):D.has(`contact`)&&/* @__PURE__ */ (0,L.jsx)(ZD,{process:l,contact:_&&_.contact,fileNames:S.items.map(e=>e.file.name)})]})}),/* @__PURE__ */ (0,L.jsx)(Ew,{show:j.isDragActive,text:`Drop your models to get a price`}),/* @__PURE__ */ (0,L.jsx)($D,{details:p,onClose:()=>m(null)})]})}var lO=()=>new _t({defaultOptions:{queries:{staleTime:1/0,retry:!1,refetchOnWindowFocus:!1}}});function uO({mode:e,onMode:t,...n}){let[r]=(0,I.useState)(lO);return/* @__PURE__ */ (0,L.jsx)(o.Provider,{value:n,children:/* @__PURE__ */ (0,L.jsx)(z,{client:r,children:/* @__PURE__ */ (0,L.jsx)(Ay,{reducedMotion:`user`,children:/* @__PURE__ */ (0,L.jsxs)(j,{delayDuration:300,children:[e===`advanced`?/* @__PURE__ */ (0,L.jsx)(OD,{onMode:t}):/* @__PURE__ */ (0,L.jsx)(cO,{}),(0,Xt.createPortal)(/* @__PURE__ */ (0,L.jsx)(Jx,{position:`top-center`,toastOptions:{className:`!bg-panel !text-ink !border-rule`}}),n.portal)]})})})})}var dO=`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
56
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{flex-direction:column;width:100%;min-width:0;display:flex}:host([mode=advanced]){height:100dvh}.studio-theme{all:initial;color-scheme:inherit;background:var(--bench);min-height:0;color:var(--ink);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;flex-direction:column;flex:auto;font-size:14px;line-height:1.45;display:flex}.studio-layout{flex:auto;min-height:0;container:studio/inline-size}:host([mode=advanced]) .studio-layout{overflow-y:auto}:focus-visible{outline:2px solid var(--ink);outline-offset:2px}button{cursor:pointer}button:disabled{cursor:not-allowed}}@layer components{.bento{grid-template-columns:minmax(0,1fr);grid-template-areas:var(--areas-one);gap:12px;display:grid}@container studio (width>=640px){.bento{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:var(--areas-two)}}@container studio (width>=1024px){.bento{grid-template-columns:minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr);grid-template-areas:var(--areas-four)}}@container studio (width>=1280px){.bento{grid-template-columns:minmax(0,1.5fr) minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr)}}}@layer utilities{.\\@container{container-type:inline-size}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\.5{top:calc(var(--spacing) * 1.5)}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-\\[72px\\]{top:72px}.top-\\[calc\\(100\\%\\+3px\\)\\]{top:calc(100% + 3px)}.right-1\\.5{right:calc(var(--spacing) * 1.5)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[calc\\(100\\%\\+10px\\)\\]{right:calc(100% + 10px)}.bottom-0{bottom:0}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-28{bottom:calc(var(--spacing) * 28)}.bottom-\\[calc\\(100\\%\\+10px\\)\\]{bottom:calc(100% + 10px)}.left-0\\.5{left:calc(var(--spacing) * .5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.left-\\[calc\\(100\\%\\+4px\\)\\]{left:calc(100% + 4px)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}.m-1{margin:var(--spacing)}.mx-0\\.5{margin-inline:calc(var(--spacing) * .5)}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-px{margin-top:1px}.mr-1{margin-right:var(--spacing)}.mr-auto{margin-right:auto}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\\.5{margin-bottom:calc(var(--spacing) * 3.5)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[18px\\]{width:18px;height:18px}.size-\\[62px\\]{width:62px;height:62px}.size-full{width:100%;height:100%}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-\\[58vh\\]{height:58vh}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\\[calc\\(100dvh-32px\\)\\]{max-height:calc(100dvh - 32px)}.min-h-0{min-height:0}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-\\[284px\\]{min-height:284px}.min-h-\\[336px\\]{min-height:336px}.min-h-\\[340px\\]{min-height:340px}.min-h-\\[360px\\]{min-height:360px}.min-h-\\[480px\\]{min-height:480px}.min-h-full{min-height:100%}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-1\\/3{width:33.3333%}.w-5{width:calc(var(--spacing) * 5)}.w-8{width:calc(var(--spacing) * 8)}.w-16{width:calc(var(--spacing) * 16)}.w-40{width:calc(var(--spacing) * 40)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-\\[52px\\]{width:52px}.w-\\[168px\\]{width:168px}.w-\\[min\\(360px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(360px,100% - 32px)}.w-\\[min\\(560px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(560px,100% - 32px)}.w-\\[min\\(640px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(640px,100% - 32px)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-\\[var\\(--radix-select-trigger-width\\)\\]{width:var(--radix-select-trigger-width)}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[260px\\]{max-width:260px}.max-w-\\[1440px\\]{max-width:1440px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\\[240px\\]{min-width:240px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-rule>:not(:last-child)){border-color:var(--rule)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[12px\\]{border-radius:12px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[16px\\]{border-radius:16px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[28px\\]{border-radius:28px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.\\!border-rule{border-color:var(--rule)!important}.border-accent{border-color:var(--accent)}.border-ink{border-color:var(--ink)}.border-rule{border-color:var(--rule)}.\\!bg-panel{background-color:var(--panel)!important}.bg-accent{background-color:var(--accent)}.bg-bench\\/80{background-color:var(--bench)}@supports (color:color-mix(in lab, red, red)){.bg-bench\\/80{background-color:color-mix(in oklab, var(--bench) 80%, transparent)}}.bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-danger{background-color:var(--danger)}.bg-ink{background-color:var(--ink)}.bg-muted,.bg-muted\\/60{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/60{background-color:color-mix(in oklab, var(--muted) 60%, transparent)}}.bg-ok{background-color:var(--ok)}.bg-panel,.bg-panel\\/90{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/90{background-color:color-mix(in oklab, var(--panel) 90%, transparent)}}.bg-raise{background-color:var(--raise)}.bg-rule{background-color:var(--rule)}.bg-transparent{background-color:#0000}.bg-viewer{background-color:var(--viewer-bg)}.bg-warn{background-color:var(--warn)}.object-contain{object-fit:contain}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-7{padding-block:calc(var(--spacing) * 7)}.pt-1{padding-top:var(--spacing)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2\\.5{padding-right:calc(var(--spacing) * 2.5)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pl-1{padding-left:var(--spacing)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-display{font-family:Bricolage Grotesque Variable,Archivo Variable,ui-sans-serif,system-ui,sans-serif}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[17px\\]{font-size:17px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[24px\\]{font-size:24px}.text-\\[34px\\]{font-size:34px}.leading-\\[1\\.05\\]{--tw-leading:1.05;line-height:1.05}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.display{letter-spacing:-.01em;font-stretch:118%}.tracking-\\[-0\\.01em\\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.whitespace-nowrap{white-space:nowrap}.hero{background:var(--hero);color:#f4f4f5;box-shadow:inset 0 1px 0 #ffffff1a, 0 0 0 1px var(--hero-edge)}.silver-fill{background:var(--silver);color:#111114}.\\!text-ink{color:var(--ink)!important}.text-accent-contrast{color:var(--accent-contrast)}.text-danger{color:var(--danger)}.text-hero-warn{color:var(--hero-warn)}.text-ink{color:var(--ink)}.text-ink-contrast{color:var(--ink-contrast)}.text-muted,.text-muted\\/60{color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.text-muted\\/60{color:color-mix(in oklab, var(--muted) 60%, transparent)}}.text-warn{color:var(--warn)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.num{font-variant-numeric:tabular-nums;font-stretch:112%}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-85{opacity:.85}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.3\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.35\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_24px_64px_-24px_rgb\\(0_0_0\\/0\\.5\\)\\]{--tw-shadow:0 24px 64px -24px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ink{--tw-ring-color:var(--ink)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-panel{--tw-ring-offset-color:var(--panel)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-offset-2{outline-offset:2px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,border-color\\,background-color\\]{transition-property:opacity,border-color,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:-translate-y-0\\.5:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}}.placeholder\\:text-muted::placeholder{color:var(--muted)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\\:border-accent:hover{border-color:var(--accent)}.hover\\:border-ink:hover{border-color:var(--ink)}.hover\\:border-muted:hover{border-color:var(--muted)}.hover\\:bg-raise:hover{background-color:var(--raise)}.hover\\:bg-rule:hover{background-color:var(--rule)}.hover\\:text-ink:hover{color:var(--ink)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:opacity-100:hover{opacity:1}}.focus\\:border-muted:focus{border-color:var(--muted)}.disabled\\:text-muted:disabled{color:var(--muted)}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}:where([data-state=on]) .in-data-\\[state\\=on\\]\\:text-ink{color:var(--ink)}.data-\\[highlighted\\]\\:bg-raise[data-highlighted],.data-\\[selected\\=true\\]\\:bg-raise[data-selected=true]{background-color:var(--raise)}.data-\\[state\\=on\\]\\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\\[state\\=on\\]\\:bg-panel[data-state=on]{background-color:var(--panel)}.data-\\[state\\=on\\]\\:text-accent-contrast[data-state=on]{color:var(--accent-contrast)}.data-\\[state\\=on\\]\\:text-ink[data-state=on]{color:var(--ink)}.data-\\[state\\=on\\]\\:shadow-\\[0_1px_2px_rgb\\(0_0_0\\/0\\.08\\)\\][data-state=on]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-2[data-state=on]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-silver-edge[data-state=on]{--tw-ring-color:var(--silver-edge)}@container (width>=24rem){.\\@sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.\\@sm\\:text-\\[40px\\]{font-size:40px}}@container (width>=28rem){.\\@md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\\@md\\:gap-6{gap:calc(var(--spacing) * 6)}}@container (width>=36rem){.\\@xl\\:mr-1{margin-right:var(--spacing)}.\\@xl\\:min-h-\\[188px\\]{min-height:188px}.\\@xl\\:w-auto{width:auto}.\\@xl\\:basis-0{flex-basis:0}.\\@xl\\:flex-col-reverse{flex-direction:column-reverse}.\\@xl\\:flex-row{flex-direction:row}.\\@xl\\:flex-nowrap{flex-wrap:nowrap}.\\@xl\\:items-end{align-items:flex-end}.\\@xl\\:items-start{align-items:flex-start}.\\@xl\\:justify-between{justify-content:space-between}.\\@xl\\:gap-0\\.5{gap:calc(var(--spacing) * .5)}.\\@xl\\:gap-6{gap:calc(var(--spacing) * 6)}}@container studio (width>=640px){.sm\\:not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.sm\\:inline{display:inline}.sm\\:inline-flex{display:inline-flex}.sm\\:w-\\[188px\\]{width:188px}.sm\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:p-4{padding:calc(var(--spacing) * 4)}}@container studio (width>=1024px){.lg\\:absolute{position:absolute}.lg\\:bottom-3{bottom:calc(var(--spacing) * 3)}.lg\\:left-3{left:calc(var(--spacing) * 3)}.lg\\:z-10{z-index:10}.lg\\:order-1{order:1}.lg\\:order-2{order:2}.lg\\:flex{display:flex}.lg\\:h-auto{height:auto}.lg\\:h-full{height:100%}.lg\\:min-h-0{min-height:0}.lg\\:min-h-\\[456px\\]{min-height:456px}.lg\\:min-h-\\[480px\\]{min-height:480px}.lg\\:w-\\[380px\\]{width:380px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[calc\\(100\\%-110px\\)\\]{max-width:calc(100% - 110px)}.lg\\:flex-1{flex:1}.lg\\:shrink-0{flex-shrink:0}.lg\\:flex-row{flex-direction:row}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:items-center{align-items:center}.lg\\:gap-6{gap:calc(var(--spacing) * 6)}.lg\\:overflow-y-auto{overflow-y:auto}.lg\\:border-0{border-style:var(--tw-border-style);border-width:0}.lg\\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.lg\\:bg-transparent{background-color:#0000}.lg\\:p-0{padding:0}}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2\\.5 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2.5)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pt-2 [cmdk-group-heading]{padding-top:calc(var(--spacing) * 2)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pb-1 [cmdk-group-heading]{padding-bottom:var(--spacing)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-\\[12px\\] [cmdk-group-heading]{font-size:12px}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted [cmdk-group-heading]{color:var(--muted)}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}}html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{width:var(--width);--gray1:#fcfcfc;--gray2:#f8f8f8;--gray3:#f3f3f3;--gray4:#ededed;--gray5:#e8e8e8;--gray6:#e2e2e2;--gray7:#dbdbdb;--gray8:#c7c7c7;--gray9:#8f8f8f;--gray10:#858585;--gray11:#6f6f6f;--gray12:#171717;--border-radius:8px;box-sizing:border-box;z-index:999999999;outline:none;margin:0;padding:0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;list-style:none;transition:transform .4s;position:fixed}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);opacity:0;transform:var(--y);touch-action:none;box-sizing:border-box;overflow-wrap:anywhere;outline:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;position:absolute}[data-sonner-toast][data-styled=true]{background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);width:var(--width);align-items:center;gap:6px;padding:16px;font-size:13px;display:flex;box-shadow:0 4px 12px #0000001a}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap));top:0}[data-sonner-toast][data-y-position=bottom]{--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap));bottom:0}[data-sonner-toast][data-styled=true] [data-description]{color:#3f3f3f;font-weight:400;line-height:1.4}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{color:inherit;font-weight:500;line-height:1.5}[data-sonner-toast][data-styled=true] [data-icon]{width:16px;height:16px;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end);flex-shrink:0;justify-content:flex-start;align-items:center;display:flex;position:relative}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform-origin:50%;animation:.3s forwards sonner-fade-in;transform:scale(.8)}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}[data-sonner-toast][data-styled=true] [data-button]{height:24px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);cursor:pointer;border:none;border-radius:4px;outline:none;flex-shrink:0;align-items:center;padding-left:8px;padding-right:8px;font-size:12px;font-weight:500;transition:opacity .4s,box-shadow .2s;display:flex}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:#00000014}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:#ffffff4d}[data-sonner-toast][data-styled=true] [data-close-button]{left:var(--toast-close-button-start);right:var(--toast-close-button-end);width:20px;height:20px;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);cursor:pointer;z-index:1;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:opacity .1s,background .2s,border-color .2s;display:flex;position:absolute;top:0}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";z-index:-1;height:100%;position:absolute;left:-100%;right:-100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3)translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3)translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]:after{content:"";height:calc(var(--gap) + 1px);width:100%;position:absolute;bottom:100%;left:0}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * .05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0px)) translateX(var(--swipe-amount-x,0px));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (width<=600px){[data-sonner-toaster]{right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%;position:fixed}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{width:calc(100% - var(--mobile-offset-left) * 2);left:0;right:0}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:#ecfdf3;--success-border:#bffcd9;--success-text:#008a2e;--info-bg:#f0f8ff;--info-border:#dde7fd;--info-text:#0973dc;--warning-bg:#fffcf0;--warning-border:#fbeeb1;--warning-text:#dc7609;--error-bg:#fff0f0;--error-border:#ffe0e1;--error-text:#e60000}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:#333;--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:#1f1f1f;--normal-border:#333;--normal-border-hover:#404040;--normal-text:var(--gray1);--success-bg:#001f0f;--success-border:#003d1c;--success-text:#59f3a6;--info-bg:#000d1f;--info-border:#19233e;--info-text:#5896f3;--warning-bg:#1d1f00;--warning-border:#2e2e00;--warning-text:#f3cf58;--error-bg:#2d0607;--error-border:#4d0408;--error-text:#ff9ea1}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);z-index:10;position:absolute;inset:0}.sonner-loading-wrapper[data-visible=false]{transform-origin:50%;animation:.2s forwards sonner-fade-out}.sonner-spinner{height:var(--size);width:var(--size);position:relative;top:50%;left:50%}.sonner-loading-bar{background:var(--gray11);border-radius:6px;width:24%;height:8%;animation:1.2s linear infinite sonner-spin;position:absolute;top:-3.9%;left:-10%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg)translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg)translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg)translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg)translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg)translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg)translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg)translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg)translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg)translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg)translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg)translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg)translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{transform-origin:50%;transition:opacity .2s,transform .2s;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8)translate(-50%,-50%)}:host{--bench:#f2f2f3;--panel:#fff;--raise:#f5f5f6;--ink:#141416;--ink-contrast:#fff;--muted:#6b6d73;--rule:#e3e3e6;--accent:#18181b;--accent-contrast:#fff;--silver-edge:#b4b6bd;--hero:linear-gradient(145deg, #2a2b30 0%, #121215 55%, #050506 100%);--hero-edge:#26272b;--hero-warn:#e08a4f;--silver:linear-gradient(135deg, #f5f5f7 0%, #c9cbd1 45%, #9a9ca3 100%);--ok:#2f8f5b;--warn:#b4561f;--danger:#b8322a;--viewer-bg:#ecedee;--bed:#dddee1;--grid:#c9cacf;--bed-edge:#9c9da3;--travel:#2f6fdb;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-theme=dark]{--bench:#0b0b0d;--panel:#141417;--raise:#1c1c20;--ink:#ececef;--ink-contrast:#0b0b0d;--muted:#9a9ba2;--rule:#2a2a2f;--accent:#dcdde2;--accent-contrast:#111114;--silver-edge:#c9cbd1;--hero:linear-gradient(145deg, #3a3b41 0%, #1d1e22 60%, #101012 100%);--hero-edge:#3a3b41;--ok:#4cb27a;--warn:#e08a4f;--danger:#ef6b5f;--viewer-bg:#0f0f11;--bed:#1b1b1f;--grid:#2a2a2f;--bed-edge:#55565c;--travel:#6fa0ff;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}`,fO=/@(?:property\s+[^{]+|font-face\s*)\{[^}]*\}/g;function pO(e){let t=e.match(fO)||[];return{shadow:e.replace(fO,``),page:t.join(``)}}var mO=e=>e===`advanced`?`advanced`:`simple`,hO=e=>e===`advanced`?`advanced`:`quote`,gO=[`light`,`dark`,`system`],_O=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},vO=e=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},yO=null;function bO(){if(yO)return yO;let{shadow:e,page:t}=pO(dO);return yO=_O(e),vO(_O(t)),import(`./chunks/fonts-DxaZCWS1.js`).then(({default:e})=>vO(_O(e))),yO}function xO(){customElements.define(`slicer-studio`,class extends HTMLElement{static observedAttributes=[`api-url`,`mode`,`theme`,`config`];#e=null;#t=null;#n=null;#r={};#i={};get config(){return this.#r}set config(e){this.#r=eD(e),this.#t&&this.#o()}getPrice(){return this.#i.getPrice?.()}connectedCallback(){if(clearTimeout(this.#n),Object.hasOwn(this,`config`)){let e=this.config;delete this.config,this.config=e}this.#e||this.#a(),this.#t??=(0,Zt.createRoot)(this.#e.layout),this.#o()}disconnectedCallback(){this.#n=setTimeout(()=>{this.#t.unmount(),this.#t=null})}attributeChangedCallback(e,t,n){e===`config`?this.config=n:this.#t&&this.#o()}#a(){let e=this.attachShadow({mode:`open`});e.adoptedStyleSheets=[bO()];let t=(e,t)=>t.appendChild(Object.assign(document.createElement(`div`),{className:e})),n=t(`studio-theme`,e);this.#e={root:n,layout:t(`studio-layout`,n),portal:t(`studio-portals`,n)}}#o(){let e=this.getAttribute(`api-url`)||``,t=this.getAttribute(`theme`);this.#t.render((0,I.createElement)(I.StrictMode,null,(0,I.createElement)(uO,{key:e,...this.#e,apiUrl:e,config:this.#r,actions:this.#i,mode:mO(this.getAttribute(`mode`)),theme:gO.includes(t)?t:null,emit:(e,t)=>this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0})),onMode:e=>{this.setAttribute(`mode`,hO(e)),this.dispatchEvent(new CustomEvent(`modechange`,{detail:{mode:hO(e)},bubbles:!0,composed:!0}))}})))}})}typeof customElements<`u`&&!customElements.get(`slicer-studio`)&&xO();
|
|
54
|
+
function cl(e,t){return/* @__PURE__ */ sl(e)?e[Kc(0,e.length,t)]:e}var ll=/* @__NO_SIDE_EFFECTS__ */ e=>Array.isArray(e)&&typeof e[0]==`number`,ul={linear:zc,easeIn:il,easeInOut:ol,easeOut:al,circIn:tl,circInOut:rl,circOut:nl,backIn:Qc,backInOut:$c,backOut:Zc,anticipate:el},dl=e=>typeof e==`string`,fl=e=>{if(/* @__PURE__ */ ll(e)){let[t,n,r,i]=e;return/* @__PURE__ */ Jc(t,n,r,i)}return dl(e)?ul[e]:e},Y={delta:0,timestamp:0,isProcessing:!1},pl;function ml(){pl=void 0}var hl={now:()=>(pl===void 0&&hl.set(Y.isProcessing||Pc.useManualTiming?Y.timestamp:performance.now()),pl),set:e=>{pl=e,queueMicrotask(ml)}},gl=e=>Math.round(e*1e5)/1e5,_l=e=>t=>typeof t==`string`&&t.startsWith(e),vl=/*@__PURE__*/ _l(`--`),yl=/*@__PURE__*/ _l(`var(--`),bl=e=>yl(e)?xl.test(e.split(`/*`)[0].trim()):!1,xl=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Sl(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Cl={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},wl={...Cl,transform:e=>Nc(0,1,e)},Tl={...Cl,default:1},El=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Dl(e){return e==null}var Ol=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,kl=(e,t)=>n=>!!(typeof n==`string`&&Ol.test(n)&&n.startsWith(e)||t&&!Dl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Al=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(El);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},jl=e=>Nc(0,255,e),Ml={...Cl,transform:e=>Math.round(jl(e))},Nl={test:/*@__PURE__*/ kl(`rgb`,`red`),parse:/*@__PURE__*/ Al(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Ml.transform(e)+`, `+Ml.transform(t)+`, `+Ml.transform(n)+`, `+gl(wl.transform(r))+`)`},Pl=(e,t,n)=>{let r=e.substring(1+t*n,1+(t+1)*n);return n>1?r:r+r};function Fl(e){let t=e.length>5?2:1,n=Pl(e,3,t);return{red:parseInt(Pl(e,0,t),16),green:parseInt(Pl(e,1,t),16),blue:parseInt(Pl(e,2,t),16),alpha:n?parseInt(n,16)/255:1}}var Il={test:/*@__PURE__*/ kl(`#`),parse:Fl,transform:Nl.transform},Ll=/* @__NO_SIDE_EFFECTS__ */ e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Rl=/*@__PURE__*/ Ll(`deg`),zl=/*@__PURE__*/ Ll(`%`),X=/*@__PURE__*/ Ll(`px`),Bl=/*@__PURE__*/ Ll(`vh`),Vl=/*@__PURE__*/ Ll(`vw`),Hl={...zl,parse:e=>zl.parse(e)/100,transform:e=>zl.transform(e*100)},Ul={test:/*@__PURE__*/ kl(`hsl`,`hue`),parse:/*@__PURE__*/ Al(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+zl.transform(gl(t))+`, `+zl.transform(gl(n))+`, `+gl(wl.transform(r))+`)`},Wl={test:e=>Nl.test(e)||Il.test(e)||Ul.test(e),parse:e=>Nl.test(e)?Nl.parse(e):Ul.test(e)?Ul.parse(e):Il.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Nl.transform(e):Ul.transform(e),getAnimatableNone:e=>{let t=Wl.parse(e);return t.alpha=0,Wl.transform(t)}},Gl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Kl=/*@__PURE__*/ new RegExp(El.source),ql=/*@__PURE__*/ new RegExp(Gl.source,`i`);function Jl(e){return isNaN(e)&&typeof e==`string`&&(Kl.test(e)||ql.test(e))}var Yl=`number`,Xl=`color`,Zl=`var`,Ql=`var(`,$l="${}",eu=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function tu(e){let t=e.toString();return Kl.test(t)||ql.test(t)}function nu(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(eu,e=>(Wl.test(e)?(r.color.push(a),i.push(Xl),n.push(Wl.parse(e))):e.startsWith(Ql)?(r.var.push(a),i.push(Zl),n.push(e)):(r.number.push(a),i.push(Yl),n.push(parseFloat(e))),++a,$l)).split($l),indexes:r,types:i}}function ru(e){return nu(e).values}function iu({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Yl?gl(r[a]):e===Xl?Wl.transform(r[a]):r[a]}return i}}function au(e){return iu(nu(e))}var ou=e=>typeof e==`number`?0:Wl.test(e)?Wl.getAnimatableNone(e):e,su=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:ou(e);function cu(e){let t=nu(e);return iu(t)(t.values.map((e,n)=>su(e,t.split[n])))}var lu={test:Jl,parse:ru,createTransformer:au,getAnimatableNone:cu};function uu(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function du({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=uu(s,r,e+1/3),a=uu(s,r,e),o=uu(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function fu(e,t){return n=>n>0?t:e}var pu=(e,t,n)=>e+(t-e)*n,mu=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},hu=[Il,Nl,Ul],gu=e=>hu.find(t=>t.test(e));function _u(e){let t=gu(e);if(!t)return!1;let n=t.parse(e);return t===Ul&&(n=du(n)),n}var vu=(e,t)=>{let n=_u(e),r=_u(t);if(!n||!r)return fu(e,t);let i={...n};return e=>(i.red=mu(n.red,r.red,e),i.green=mu(n.green,r.green,e),i.blue=mu(n.blue,r.blue,e),i.alpha=pu(n.alpha,r.alpha,e),Nl.transform(i))},yu=/* @__PURE__ */ new Set([`none`,`hidden`]);function bu(e,t){return yu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function xu(e,t){return n=>pu(e,t,n)}function Su(e){return typeof e==`number`?xu:typeof e==`string`?bl(e)?fu:Wl.test(e)?vu:Eu:Array.isArray(e)?Cu:typeof e==`object`?Wl.test(e)?vu:wu:fu}function Cu(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Su(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function wu(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Su(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Tu(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Eu=(e,t)=>{let n=nu(e),r=nu(t);return n.indexes.var.length===r.indexes.var.length&&n.indexes.color.length===r.indexes.color.length&&n.indexes.number.length>=r.indexes.number.length?yu.has(e)&&!r.values.length||yu.has(t)&&!n.values.length?bu(e,t):Bc(Cu(Tu(n,r),r.values),iu(r)):fu(e,t)},Du=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Ou(e,t){let n=Du.exec(e);if(!n)return;let r=Du.exec(t);if(!r||n[2]!==r[2])return;let i=n[2],a=parseFloat(n[1]),o=parseFloat(r[1]);return e=>gl(pu(a,o,e))+i}function ku(e,t,n){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`)return pu(e,t,n);if(typeof e==`string`&&typeof t==`string`){let n=Ou(e,t);if(n)return n}return Su(e)(e,t)}var Au=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function ju(e){let t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set,r=!1,i=!1,a,o=/* @__PURE__ */ new Set,s={delta:0,timestamp:0,isProcessing:!1};function c(t){o.has(t)&&(n.add(t),e()),(a=t)(s)}let l={schedule:(e,i=!1,s=!1)=>{let c=s&&r,l=c?t:n;return i&&o.add(e),c&&e!==a&&l.delete(e),l.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{if(s=e,r){i=!0;return}r=!0;let o=t;t=n,n=o,t.forEach(c),t.clear(),a=void 0,r=!1,i&&(i=!1,l.process(e))}};return l}var Mu=40;function Nu(e,t,n={delta:0,timestamp:0,isProcessing:!1}){let r=!1,i=!0,a=()=>r=!0,o=Au.reduce((e,t)=>(e[t]=ju(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Pc.useManualTiming,o=a?n.timestamp:performance.now();r=!1,a||(n.delta=i?1e3/60:Math.max(Math.min(o-n.timestamp,Mu),1)),n.timestamp=o,n.isProcessing=!0,s.process(n),c.process(n),l.process(n),u.process(n),d.process(n),f.process(n),p.process(n),m.process(n),n.isProcessing=!1,r&&t&&(i=!1,e(h))},g=()=>{r=!0,i=!0,n.isProcessing||e(h)};return{schedule:Au.reduce((e,t)=>{let n=o[t];return e[t]=(e,t=!1,i=!1)=>(r||g(),n.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Au.length;t++)o[Au[t]].cancel(e)},state:n,steps:o}}var{schedule:Pu,cancel:Fu,steps:Iu}=/* @__PURE__ */ Nu(typeof requestAnimationFrame<`u`?requestAnimationFrame:zc,!0,Y),Lu=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Pu.update(t,e),stop:()=>Fu(t),now:()=>Y.isProcessing?Y.timestamp:hl.now()}},Ru=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},zu=2e4;function Bu(e,t=50,n=zu,r){let i=0,a=e.next(i);for(r?.push(a.value);!a.done&&i<n;)i+=t,a=e.next(i),r?.push(a.value);return i>=n?1/0:i}function Vu(e,t=100,n){let{keyframes:r,velocity:i}=e,a=r&&r[r.length-1]-r[0],o=n({...e,velocity:i&&a?i*t/a:i,keyframes:[0,t]}),s=Math.min(Bu(o),zu);return{type:`keyframes`,ease:e=>o.next(s*e).value/t,duration:/* @__PURE__ */ Wc(s)}}var Hu=100,Uu=10,Wu=1,Gu=800,Ku=.3,qu=.3,Ju=.01,Yu=2,Xu=.005,Z=.5,Q=.01,Zu=10,Qu=.05,$u=e=>e<0?1/Math.max(1+e,Qu):Math.max(1-e,Qu);function ed(e,t){if(!(e>1))return 1;let n=Math.sqrt(e*e-1),r=e-n,i=e+n,a=2*n*Math.exp(-t)*(1+t);return rd(e=>i*Math.exp(-r*e)-r*Math.exp(-i*e)-a,e=>Math.exp(-i*e)-Math.exp(-r*e),t)/t}function td(e,t){return e*Math.sqrt(1-t*t)}var nd=12;function rd(e,t,n){let r=n;for(let n=1;n<nd;n++)r-=e(r)/t(r);return r}var id=.001;function ad({duration:e=Gu,bounce:t=Ku}){let n,r,i=$u(t);e=Nc(Q,Zu,/* @__PURE__ */ Wc(e)),i<1?(n=t=>{let n=t*i,r=n*e,a=td(t,i),o=Math.exp(-r);return id-n/a*o},r=t=>{let r=t*i*e,a=i*i*t*t*e,o=Math.exp(-r),s=td(t*t,i);return(-n(t)+id>0?-1:1)*-a*o/s}):(n=t=>-.001+Math.exp(-t*e)*(t*e+1),r=t=>Math.exp(-t*e)*(-t*(e*e)));let a=5/e,o=rd(n,r,a),s=o*ed(i,o*e),c=s*s;return{stiffness:c,damping:i*2*Math.sqrt(c),duration:/* @__PURE__ */ Uc(e)}}var od=(e,t)=>(t?e>=0:e>0)&&e<1/0;function sd(e,t){if(od(e,t))return e}function cd(e){let t=sd(e.stiffness),n=sd(e.damping,!0),r=sd(e.mass),i={...e,stiffness:t??Hu,damping:n??Uu,mass:r??Wu,isResolvedFromDuration:!1,isTimeDefined:(t??n??r)===void 0&&(e.duration!==void 0||e.bounce!==void 0)};if(i.isTimeDefined){if(e.visualDuration){let t=$u(e.bounce||0),n=2*Math.PI/(e.visualDuration*1.2)*ed(t,2*Math.PI/1.2);i.stiffness=n*n,i.damping=2*t*Math.sqrt(i.stiffness)}else Object.assign(i,ad(i)),i.isResolvedFromDuration=!0;od(i.stiffness)&&od(i.damping,!0)||(i.stiffness=Hu,i.damping=Uu)}return i}function ld(e=qu,t=Ku){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},r=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:o,damping:s,mass:c,duration:l,isResolvedFromDuration:u,isTimeDefined:d}=cd({...n}),f=e=>d?0:-/* @__PURE__ */ Wc(e),p=s/(2*Math.sqrt(o*c)),m=/* @__PURE__ */ Wc(Math.sqrt(o/c)),h=p*m,g={target:i,delta:i-r,velocity:f(n.velocity||0)||0,restSpeed:0,restDelta:0},_=()=>{let e=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(e?Ju:Yu),g.restDelta=n.restDelta||(e?Xu:Z)};_();let v,y,b;if(p<1){let e=td(m,p),t={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};b=()=>{t.A=(g.velocity+h*g.delta)/e,t.sinC=h*t.A+g.delta*e,t.cosC=h*g.delta-t.A*e};let n=n=>{n!==t.t&&(t.t=n,t.env=Math.exp(-h*n),t.sin=Math.sin(e*n),t.cos=Math.cos(e*n))};v=e=>(n(e),g.target-t.env*(t.A*t.sin+g.delta*t.cos)),y=e=>(n(e),t.env*(t.sinC*t.sin+t.cosC*t.cos))}else if(p===1){v=e=>g.target-Math.exp(-m*e)*(g.delta+(g.velocity+m*g.delta)*e);let e={C:0};b=()=>{e.C=g.velocity+m*g.delta},y=t=>Math.exp(-m*t)*(m*e.C*t-g.velocity)}else{let e=m*Math.sqrt(p*p-1),t=h-e,n=h+e,r=e<1||d?1/0:300/e,i=(e,t)=>Math.exp(t>r?(h-e)*r-h*t:-e*t),a={S:0,F:0};b=()=>{let t=(g.velocity+h*g.delta)/e;a.S=(g.delta+t)/2,a.F=(g.delta-t)/2},v=e=>g.target-a.S*i(t,e)-a.F*i(n,e),y=e=>t*a.S*i(t,e)+n*a.F*i(n,e)}b();let x=u&&l||null,S={calculatedDuration:x,retarget:(e,t)=>{g.target=e[e.length-1],g.delta=g.target-e[0],g.velocity=f(t),n.restSpeed&&n.restDelta||_(),S.calculatedDuration=x,a.done=!1,b()},velocity:e=>/* @__PURE__ */ Uc(y(e)),next:e=>{let t=v(e);if(u)a.done=e>=l;else{let n=/* @__PURE__ */ Uc(y(e));a.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-t)<=g.restDelta}return a.value=a.done?g.target:t,a},toString:()=>{let e=Math.min(Bu(S),zu),t=Ru(t=>S.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return S}var ud=/* @__PURE__ */ Object.assign(ld,{applyToOptions:e=>{let t=Vu(e,100,ld);return e.ease=t.ease,e.duration=/* @__PURE__ */ Uc(t.duration),e.type=`keyframes`,e}});function dd({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>e<s||e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o?o(g):g;_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>{let t=v(e);f.done=Math.abs(t)<=l,f.value=f.done?_:e?_+t:d},b,x,S=e=>{p(f.value)&&(b=e,x=ud({keyframes:[f.value,m(f.value)],velocity:-v(e)/r*1e3,damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return S(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&b===void 0&&(t=!0,y(e),S(e)),b!==void 0&&e>=b?x.next(e-b):(!t&&y(e),f)}}}function fd(e,t,n){let r=[],i=n||Pc.mix||ku,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Bc(Array.isArray(t)?t[n]||zc:t,a)),r.push(a)}return r}function pd(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=fd(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=/* @__PURE__ */ Vc(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Nc(e[0],e[a-1],t)):l}function md(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=/* @__PURE__ */ Vc(0,t,r);e.push(pu(n,1,i))}}function hd(e){let t=[0];return md(t,e.length-1),t}function gd(e,t){return e.map(e=>e*t)}function _d(e,t){return e.map(()=>t||ol).splice(0,e.length-1)}function vd({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=/* @__PURE__ */ sl(r)?r.map(fl):fl(r)||ol,a={done:!1,value:t[0]};if(t.length===2&&!Array.isArray(i)&&(!n||n.length!==2||n[0]===0&&n[1]===1)){let[n,r]=t,o=n===r?void 0:(Pc.mix||ku)(n,r);return{calculatedDuration:e,next:t=>(a.value=o?o(i(e>0?Nc(0,1,t/e):1)):r,a.done=t>=e,a)}}let o=pd(gd(n&&n.length===t.length?n:hd(t),e),t,{ease:Array.isArray(i)?i:_d(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var yd=5;function bd(e,t,n){let r=Math.max(t-yd,0);return/* @__PURE__ */ Gc(n-e(r),t-r)}function xd(e,t,n=0){return t<=0?n:e.velocity?e.velocity(t):bd(t=>e.next(t).value,t,e.next(t).value)}var Sd=e=>e!==null;function Cd(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Sd),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var wd={decay:dd,inertia:dd,tween:vd,keyframes:vd,spring:ud};function Td(e){typeof e.type==`string`&&(e.type=wd[e.type])}var Ed=40,Dd=(e,t)=>t-e>Ed&&!Pc.useManualTiming?t:e;function Od(e,t){return{kind:e,animation:t,timestamp:hl.now(),frameTimestamp:Y.timestamp,frameIsProcessing:Y.isProcessing}}function kd(e,t,n){let r=globalThis.__MOTION_INSPECT__;if(r)try{r({...Od(`animation-start`,e),options:n?{...t,...n}:t})}catch{}}function Ad(e,t){let n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Od(`layout-animation-start`,e),node:t})}catch{}}var jd=class{constructor(){this.isResolved=!1}get finished(){return this._finished||=this.isResolved?Promise.resolve():new Promise(e=>{this._resolve=e}),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(e,t){return this.finished.then(e,t)}},Md=e=>e/100,Nd=e=>Math.round(e*1e4)/1e4,Pd=class extends jd{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==hl.now()&&this.tick(hl.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause(),kd(this,this.options)}initAnimation(){let{options:e}=this;Td(e);let{type:t=vd,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||vd;s!==vd&&typeof o[0]!=`number`&&(this.mixKeyframes=Bc(Md,ku(o[0],o[1])),o=[0,100]);let c=s(o===e.keyframes?e:{...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Bu(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){this.currentTime=this.holdTime??Math.round(e-this.startTime)*this.playbackSpeed}tick(e,t=!1){let{generator:n,totalDuration:r,calculatedDuration:i}=this;if(this.startTime===null)return n.next(0);let{delay:a=0,keyframes:o,type:s,onUpdate:c,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Dd(this.startTime,e)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let u=this.currentTime-a*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?u<0:u>r;this.currentTime=Math.max(u,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let f=this.generate(this.currentTime,d),{done:p}=f;d||(p=this.playbackSpeed>=0?i<1/0?this.currentTime>=r:p:this.currentTime<=0);let m=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&p);return m&&s!==dd&&(f.value=Cd(o,this.options,l,this.speed)),c&&c(f.value),m&&this.finish(),f}at(e){return this.holdTime??Nd((e-this.startTime)*this.playbackSpeed)}sampleAt(e,t){let{options:n,totalDuration:r}=this,i=this.at(e)-(n.delay||0);return i>=r&&n.type!==dd?Cd(n.keyframes,n,t?void 0:n.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(e,t){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:s,repeat:c,repeatType:l,repeatDelay:u}=this.options,d=e,f=n;if(c){let t=Math.min(e,r)/o,n=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),i===1&&n--,n=Math.min(n,c+1),n%2&&(l===`reverse`?(i=1-i,u&&(i-=u/o)):l===`mirror`&&(f=a)),d=Nc(0,1,i)*o}let p;return t?(this.delayState.value=s[0],p=this.delayState):p=f.next(d),i&&!t&&(p.value=i(p.value)),p}get duration(){return/* @__PURE__ */ Wc(this.calculatedDuration)}get iterationDuration(){return this.duration+/* @__PURE__ */ Wc(this.options.delay??0)}get time(){return/* @__PURE__ */ Wc(this.currentTime)}set time(e){e=/* @__PURE__ */ Uc(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){return xd(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(hl.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=/* @__PURE__ */ Wc(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Lu,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??(this.pendingStartTime=n):this.startTime=n-this.holdTime/(this.playbackSpeed||1),this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(hl.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}},Fd=/* @__PURE__ */ new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Id(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(El)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Fd.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var Ld=/\b([a-z-]*)\(.*?\)/gu,Rd={...lu,getAnimatableNone:e=>{let t=e.match(Ld);return t?t.map(Id).join(` `):e}},zd={...lu,getAnimatableNone:e=>{let t=lu.parse(e);return lu.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Bd={...Cl,transform:Math.round},Vd={rotate:Rl,pathRotation:Rl,rotateX:Rl,rotateY:Rl,rotateZ:Rl,scale:Tl,scaleX:Tl,scaleY:Tl,scaleZ:Tl,skew:Rl,skewX:Rl,skewY:Rl,distance:X,translateX:X,translateY:X,translateZ:X,x:X,y:X,z:X,perspective:X,transformPerspective:X,opacity:wl,originX:Hl,originY:Hl,originZ:X},Hd={borderWidth:X,borderTopWidth:X,borderRightWidth:X,borderBottomWidth:X,borderLeftWidth:X,borderRadius:X,borderTopLeftRadius:X,borderTopRightRadius:X,borderBottomRightRadius:X,borderBottomLeftRadius:X,width:X,maxWidth:X,height:X,maxHeight:X,top:X,right:X,bottom:X,left:X,inset:X,insetBlock:X,insetBlockStart:X,insetBlockEnd:X,insetInline:X,insetInlineStart:X,insetInlineEnd:X,padding:X,paddingTop:X,paddingRight:X,paddingBottom:X,paddingLeft:X,paddingBlock:X,paddingBlockStart:X,paddingBlockEnd:X,paddingInline:X,paddingInlineStart:X,paddingInlineEnd:X,margin:X,marginTop:X,marginRight:X,marginBottom:X,marginLeft:X,marginBlock:X,marginBlockStart:X,marginBlockEnd:X,marginInline:X,marginInlineStart:X,marginInlineEnd:X,fontSize:X,backgroundPositionX:X,backgroundPositionY:X,...Vd,zIndex:Bd,fillOpacity:wl,strokeOpacity:wl,numOctaves:Bd},Ud={...Hd,color:Wl,backgroundColor:Wl,outlineColor:Wl,fill:Wl,stroke:Wl,borderColor:Wl,borderTopColor:Wl,borderRightColor:Wl,borderBottomColor:Wl,borderLeftColor:Wl,filter:Rd,WebkitFilter:Rd,mask:zd,WebkitMask:zd},Wd=e=>Ud[e],Gd=/*@__PURE__*/ new Set([Rd,zd]);function Kd(e,t){let n=Wd(e);return Gd.has(n)||(n=lu),n.getAnimatableNone?n.getAnimatableNone(t):void 0}function qd(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Jd=e=>e*180/Math.PI,Yd=e=>Zd(Jd(Math.atan2(e[1],e[0]))),Xd={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Yd,rotateZ:Yd,skewX:e=>Jd(Math.atan(e[1])),skewY:e=>Jd(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Zd=e=>(e%=360,e<0&&(e+=360),e),Qd=Yd,$d=e=>Math.hypot(e[0],e[1]),ef=e=>Math.hypot(e[4],e[5]),tf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$d,scaleY:ef,scaleZ:e=>Math.hypot(e[8],e[9],e[10]),scale:e=>($d(e)+ef(e))/2,rotateX:e=>Zd(Jd(Math.atan2(e[6],e[5]))),rotateY:e=>Zd(Jd(Math.atan2(-e[2],e[0]))),rotateZ:Qd,rotate:Qd,skewX:e=>Jd(Math.atan(e[4])),skewY:e=>Jd(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function nf(e){return+!!e.includes(`scale`)}function rf(e,t){if(!e||e===`none`)return nf(t);let n=e.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return nf(t);let r=(n[1]?tf:Xd)[t],i=n[2].split(`,`).map(e=>parseFloat(e));return typeof r==`function`?r(i):i[r]}var af=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return rf(n,t)},of=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],sf=/* @__PURE__ */ new Set([...of,`pathRotation`]),cf=e=>e===Cl||e===X,lf=/* @__PURE__ */ new Set([`x`,`y`,`z`]),uf=/* @__PURE__ */ of.filter(e=>!lf.has(e));function df(e){let t=[];return uf.forEach(n=>{let r=e.getValue(n);if(r!==void 0){let e=r.get(),i=+!!n.startsWith(`scale`);if(e===i)return;t.push([n,e]),r.set(i)}}),t}var ff=/* @__PURE__ */ new Set([`bottom`,`right`]);function pf(e,t,n,r,i,a){let o=parseFloat(e);if(!isNaN(o))return o;let{min:s,max:c}=t()[n],l=c-s;return a===`border-box`?l:l-parseFloat(r)-parseFloat(i)}var mf=({transform:e})=>rf(e,`x`),hf=({transform:e})=>rf(e,`y`),gf={width:({width:e,paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r},i)=>pf(e,i,`x`,t,n,r),height:({height:e,paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r},i)=>pf(e,i,`y`,t,n,r),top:({top:e})=>parseFloat(e),left:({left:e})=>parseFloat(e),bottom:({top:e},t)=>{let{y:n}=t();return parseFloat(e)+(n.max-n.min)},right:({left:e},t)=>{let{x:n}=t();return parseFloat(e)+(n.max-n.min)},x:mf,y:hf,translateX:mf,translateY:hf},_f=/* @__PURE__ */ new Set,vf=!1,yf=!1,bf=!1;function xf(){if(yf){let e=[],t=/* @__PURE__ */ new Set,n=/* @__PURE__ */ new Set;_f.forEach(r=>{r.needsMeasurement&&(e.push(r),t.add(r.element),ff.has(r.name)&&n.add(r.element))});let r=/* @__PURE__ */ new Map;n.forEach(e=>{let t=df(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}yf=!1,vf=!1,_f.forEach(e=>e.complete(bf)),_f.clear()}function Sf(){_f.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yf=!0)})}function Cf(){bf=!0,Sf(),xf(),bf=!1}function wf(e,t,n){if(typeof e==`string`){if(Fc(e)||Lc(e))return parseFloat(e);if(!lu.test(e)&&lu.test(n))return Kd(t,n)}return e??void 0}var Tf=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(_f.add(this),vf||(vf=!0,Pu.read(Sf),Pu.resolveKeyframes(xf))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=wf(n.readValue(t,a),t,a);r!==void 0&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}qd(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),_f.delete(this)}cancel(){this.state===`scheduled`&&(_f.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Ef=e=>e.startsWith(`--`);function Df(e,t,n){Ef(t)?e.style.setProperty(t,n):e.style[t]=n}var Of={};function kf(e,t){let n=/* @__PURE__ */ Rc(e);return()=>Of[t]??n()}var Af=/* @__PURE__ */ kf(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),jf=/*@__PURE__*/ kf(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Mf=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Nf={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:/*@__PURE__*/ Mf([0,.65,.55,1]),circOut:/*@__PURE__*/ Mf([.55,0,1,.45]),backIn:/*@__PURE__*/ Mf([.31,.01,.66,-.59]),backOut:/*@__PURE__*/ Mf([.33,1.53,.69,.99])};function Pf(e,t){if(e)return typeof e==`function`?jf()?Ru(e,t):`ease-out`:/* @__PURE__ */ ll(e)?Mf(e):Array.isArray(e)?e.map(e=>Pf(e,t)||Nf.easeOut):Nf[e]}function Ff(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Pf(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function If(e){return typeof e==`function`&&`applyToOptions`in e}function Lf({type:e,...t}){return If(e)&&jf()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Rf=class extends jd{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e;let c=Lf(e);this.animation=Ff(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Cd(r,this.options,o,this.speed);this.updateMotionValue?.(e),Df(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()},kd(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){this.isStopped||(this.isStopped=!0,this.state!==`idle`&&this.finishedTime===null&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||(this.animation.onfinish=null,this.cancel())))}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return/* @__PURE__ */ Wc(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+/* @__PURE__ */ Wc(e)}get time(){return/* @__PURE__ */ Wc(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=/* @__PURE__ */ Uc(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,onAttach:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Af()?(this.animation.timeline=e,t?.(this.animation),zc):n(this)}},zf={anticipate:el,backInOut:$c,circInOut:rl};function Bf(e){return e in zf}function $(e){typeof e.ease==`string`&&Bf(e.ease)&&(e.ease=zf[e.ease])}var Vf=class extends Rf{constructor(e){$(e),Td(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}elapsed(){return this.state===`running`?(hl.now()-this.startTime)*this.speed:this.time*1e3}sample(e){if(!this.sampler){let{motionValue:e,onUpdate:t,onComplete:n,onPlay:r,onStop:i,element:a,...o}=this.options;this.sampler=new Pd({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,e)).value}liveValue(){let{state:e}=this;if(e===`running`||e===`paused`)return this.sample(this.elapsed())}updateMotionValue(e){let{motionValue:t,element:n,name:r}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let{speed:i}=this,a=this.elapsed(),o=this.state===`running`&&i?Nc(0,10,a):0,s=this.sample(a);n&&r&&Df(n,r,s),t.setWithVelocity(this.sample(a-o*Math.sign(i)),s,o/Math.abs(i||1))}},Hf=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(lu.test(e)||e===`0`)&&!e.startsWith(`url(`));function Uf(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Wf(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Hf(i,t),s=Hf(a,t);return!o||!s?!1:Uf(e)||(n===`spring`||If(n))&&r}function Gf(e){e.duration=0,e.type=`keyframes`}var Kf=/* @__PURE__ */ new Set([`opacity`,`clipPath`,`filter`,`transform`]),qf=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Jf(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&qf.test(e[t]))return!0;return!1}var Yf=/* @__PURE__ */ new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Xf=()=>!Pc.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,`animate`);function Zf(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!n||!(Kf.has(n)||Yf.has(n)))return!1;let c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Xf()&&(Kf.has(n)||Yf.has(n)&&Jf(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Qf=(e,t)=>t&&typeof e==`number`?t.transform(e):e,$f={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},ep=of.length,tp={},np=(e,t,n=Qf(t,Vd[e]))=>(tp[e]||(tp[e]=($f[e]||e)+`(`))+n+`)`,rp=(e,t)=>(typeof t==`number`?t:parseFloat(t))===+!!e.startsWith(`scale`);function ip(e,t,n){let r=``;for(let i=0;i<ep;i++){let a=of[i],o=e[a];if(o===void 0)continue;let s=n&&(t[a]=Qf(o,Hd[a]));rp(a,o)||(r+=np(a,o,s||void 0)+` `)}let i=e.pathRotation;return i&&(r+=np(`rotate`,i)),r=r.trim(),n?n(t,r):r||`none`}var ap=/* @__PURE__ */ new WeakMap,op=200,sp=.001,cp=.1,lp=.001,up=100,dp=e=>/^(linear|ease(In|Out|InOut))$/.test(e),fp=(e,t)=>e-t,pp=(e,t,n)=>{let r=[];for(let i=0;i<=n;i++)r.push(pu(e,t,i/n));return r},mp=e=>e.motionValue.owner,hp=e=>ap.get(e),gp=(e,t)=>e.latestValues?e.latestValues[t]:e.getValue(t)?.get(),_p=({name:e,motionValue:t})=>e&&of.includes(e)&&t?.owner?.current instanceof HTMLElement&&Xf()&&jf();function vp(e){let t=mp(e),{onUpdate:n,transformTemplate:r}=t.getProps();return!e.isHandoff&&!n&&!e.hasOnUpdate&&!r&&e.type!==`inertia`&&(gp(t,`transform`)||`none`)===`none`&&!gp(t,`pathRotation`)&&!t.projection?.isProjecting()}var yp=class extends Pd{constructor(e){let t=mp(e).current,{driver:n=Lu}=e,r,i=vp(e);e.driver=e=>{let i=n(e);return{js:i,now:i.now,start:(e=!0)=>{let n=hp(t);!n||n.isJS?i.start(e):n.schedule(!1,!e)},stop:()=>{i.stop();let e=hp(t);e&&!e.isFinishing&&e.release(r)}}},super(e),r=this,this.canAccelerate=i;let{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}get group(){return hp(mp(this.options).current)}get js(){return this.driver?.js}get name(){return this.options.name}timing(){let{startTime:e,speed:t,totalDuration:n}=this,{delay:r=0,repeatType:i}=this.options;return this.holdTime===null?n===1/0?[e+r/t,this.resolvedDuration*(i===`loop`?1:2)/t||1]:[e+(r+n)/t,0]:[1/0,0]}isAccelerated(){let{group:e,state:t}=this;return e?.tracks.has(this)&&!e.isJS&&this.canAccelerate&&(t===`running`||t===`paused`)}liveValue(){return this.isAccelerated()?this.sampleAt(hl.now()):void 0}tween(){let{keyframes:e,type:t,ease:n,times:r,repeat:i,delay:a=0}=this.options,o=/* @__PURE__ */ ll(n)?Mf(n):dp(n)&&Nf[n];if(o&&!i&&!r&&e.length===2&&t===vd&&this.holdTime===null){let e=this.startTime+a/this.speed;return[e,e+this.resolvedDuration/this.speed,o]}}boundaries(e,t){let{startTime:n,speed:r,resolvedDuration:i,options:a}=this,{delay:o=0,repeat:s=0,repeatDelay:c=0,repeatType:l,times:u,keyframes:d,type:f}=a,p=(f||vd)===vd?u||hd(d):[0,1],m=n+o/r,h=[];if(this.holdTime!==null||!(i>0))return h;for(let n=Math.max(0,Math.floor((e-m)*r/i));n<=s;n++){let a=m+n*i/r;if(a>t)break;for(let o of p){let s=a+(n%2&&l&&l!==`loop`?1-o:o)*(i-c)/r;s>e&&s<t&&h.push(s)}}return h}numberAt(e){return parseFloat(this.sampleAt(e,!0))}sync(){let e=hl.now();this.options.motionValue.setWithVelocity(this.sampleAt(e-10,!0),this.sampleAt(e,!0),10)}play(){this.isStopped||((this.group||bp(mp(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&(this.sync(),this.group.schedule(!1))}complete(){super.complete();let{group:e}=this;e&&!e.isJS&&this.canAccelerate&&this.tick(hl.now())}get time(){return this.isAccelerated()?/* @__PURE__ */ Wc(Nc(0,this.totalDuration,this.at(hl.now())-(this.options.delay||0))):super.time}set time(e){super.time=e,this.isAccelerated()&&this.sync()}attachTimeline(e){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(e)}};function bp(e){let t=e.current,n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Map,i={},a=[],o=/* @__PURE__ */ new Map,s=[],c=!1,l=!1,u=!1,d=!1,f=-1/0,p=e=>{for(let t of n)if(t.name===e)return!0},m=(t,n)=>{let o={};for(let s of t===void 0?of:a){let a=r.get(s),c=t===void 0?gp(e,s):a?a.sampleAt(n>t&&!a.timing()[1]?n:t):i[s];c!==void 0&&(o[s]=c)}return o},h=(e,t)=>{let n=``;for(let r in e){let i=e[r];t&&rp(r,i)||(n+=np(r,i)+` `)}return(t?n.trim():n)||`none`},g=(e,t)=>h(m(e,t)),_=(e=m())=>{t.style.transform=h(e,!0)},v=(e=!0)=>{e&&_(),s.forEach(({animation:e})=>e.cancel()),s=[]},y=(e,n)=>new Animation(new KeyframeEffect(t,e,n)),b=(e,t,n=1/0)=>{let r={animation:e,offset:t,end:n};e.startTime=hl.now()+t,n<1/0&&(e.onfinish=()=>{r.isDone=!0,s.some(e=>e.end===1/0)&&(e.cancel(),s=s.filter(e=>e!==r)),A.schedule(!1)}),e.oncancel=()=>s.includes(r)&&A.demote(),s.push(r)},x=(e,t,n)=>{let r=(t,n)=>Math.abs(e(n)-e(t)),i=r(t,n);for(;n-t>.01;){let e=(t+n)/2;r(t,e)>r(e,n)?n=e:t=e}return r(t,n)>i/2?[t,n]:[]},S=(e,t,n,r)=>{let i=Math.min(op,Math.max(2,Math.ceil((n-t)/10)));if(r.length*4>i)return;let a=pp(t,n,i).concat(r).sort(fp),o=e=>/* @__PURE__ */ Vc(t,n,e),s,c;for(let t of e){let e=a.map(e=>t.numberAt(e)),[n]=e,r=e.map(e=>e-n),i=r[r.length-1],o=r.some(e=>Math.abs(e)*sp>Math.abs(i))?0:i,l=r.map(e=>o?e/o:e);if(!o){if(l.some(e=>!(Math.abs(e)<=sp)))return}else if(!s)s=l,c=e=>(t.numberAt(e)-n)/o;else if(l.some((e,t)=>!(Math.abs(e-s[t])<=sp)))return}if(!s||s.every((e,t)=>Math.abs(e-o(a[t]))<=sp))return`linear`;let l=[],u=(e,t=c(e))=>l.push(Nd(t)+` `+Nd(o(e)*100)+`%`);return s.forEach((e,t)=>{t&&Math.abs(e-s[t-1])>.2&&x(c,a[t-1],a[t]).forEach(e=>u(e)),u(a[t],e)}),`linear(`+l+`)`},C=(e,t,n,r)=>{let i=[t],a=(t,n)=>e.every(e=>!(Math.abs(e.numberAt((t+n)/2)-(e.numberAt(t)+e.numberAt(n))/2)>(e.name.startsWith(`scale`)?lp:cp))),o=(t,n,r)=>{if(n-t<1||a(t,n))i.push(n);else if(r<4)o(t,(t+n)/2,r+1),o((t+n)/2,n,r+1);else{for(let r of e)i.push(...x(e=>r.numberAt(e),t,n));i.push(n)}},s=pp(t,n,Math.ceil((n-t)/100));for(let e of r)s.push(e,Math.min(e+.01,n));let c=t;for(let e of s.sort(fp))e>c&&o(c,e,0),c=e;return i.sort(fp)},w=e=>{let t;for(let n of e){let e=n.tween();if(!e||t?.some((t,n)=>n<2?Math.abs(e[n]-t)>1:e[n]!==t))return;t=e}return t},T=(e,t,n,r={fill:`both`},i,a)=>{let o=e.flatMap(e=>e.boundaries(t,n)),s=a||S(e,t,n,o),c=s?[t,n]:C(e,t,n,o),l=c.map(e=>g(e,i)),u={transform:l};return s||(u.offset=c.map(e=>/* @__PURE__ */ Vc(t,n,e))),l.every(e=>e===l[0])&&(_(m(t,i)),u=null),y(u,{...r,duration:n-t,easing:s||`linear`})},E=t=>{let c=t,l=0,u=0,d=[],f=[],p=/* @__PURE__ */ new Set;r.clear(),o=/* @__PURE__ */ new Map;for(let e of n){r.set(e.name,e);let[n,i]=e.timing(),a=n===1/0;if(o.set(e,[e.at(t),e.speed,a]),a)e.sync();else{if(e.speed<0)return;if(i){if(l){let e=(n-u)/i;if(Math.abs(i-l)>1||Math.abs(e-Math.round(e))*l>1)return}else l=i,u=n;f.push(e)}else p.add(n);d.push(e),c=Math.max(c,n)}}i={},a=of.filter(t=>{if(r.has(t))return!0;let n=i[t]=gp(e,t);return n!==void 0&&parseFloat(n)!==+!!t.startsWith(`scale`)}),v(!1);let m=!l&&w(d);try{if(m&&m[1]>t){let[e,n,r]=m;b(T(d,e,n,void 0,void 0,r),e-t,n-e)}else c>t&&(b(T(d,t,c),0,c-t),p.forEach(e=>e<c-1&&b(y(null,{duration:e-t}),0,e-t)));if(l){let e=u+Math.floor((c-u)/l)*l;b(T(f,e,e+l,{iterations:1/0,iterationStart:(c-e)/l,fill:`forwards`},c),c-t)}}catch{return}return s.length||v(),!0},D=e=>{let t,r=0;for(let i of n){let n=o.get(i);if(!n)return!1;let[a,s,c]=n,l=i.at(e),u=i.timing()[0]===1/0;if(c){if(u&&l===a)continue;return!1}let d=(l-a)/s,f=u?0:i.speed/s;if(t===void 0)t=d,r=f;else if(Math.abs(d-t)>1||f!==r)return!1}if(t===void 0)return!0;if(!s.length)return!1;for(let{offset:e,end:n,isDone:r}of s){let i=t-e;if(n<1/0&&(r?i<n-1:i<0||i>=n))return!1}for(let{animation:n,offset:i,isDone:a}of s){if(a)continue;let o=t-i;r&&n.updatePlaybackRate&&n.playState===`running`&&Math.abs(Number(n.currentTime)-o)<20?n.playbackRate!==r&&n.updatePlaybackRate(r):r?(n.playbackRate=r,n.startTime=e-o/r):(n.startTime=null,n.currentTime=o)}return!0},O=()=>!n.size&&(u=!0,hp(t)===A&&ap.delete(t),A.isJS||v(),!0),k=()=>{let t=hl.now();if(A.isJS||(A.isFinishing=!0,n.forEach(n=>{let[r,a]=n.timing();n.state===`running`&&n.speed>0&&!a&&r<=t+1&&(n.complete(),i[n.name]=gp(e,n.name),o.has(n)||(c=!0))}),A.isFinishing=!1),l=!1,u||(n.forEach(({state:e},t)=>{(e===`idle`||e===`finished`)&&n.delete(t)}),O()))return;for(let e of n)if(!e.canAccelerate)return A.demote(!0);A.isJS&&(A.isJS=!1,c=!0,n.forEach(e=>e.js?.stop()));let r=c,a=d;if(c=d=!1,r||!D(t)){if(a){if(t-f<up)return A.demote();f=t}if(!E(t))return A.demote()}},A={tracks:n,isJS:!1,isFinishing:!1,schedule(e,t){u||(c||=e,d||=!!t,l||(l=!0,Y.isProcessing?Pu.render(k,!1,!0):queueMicrotask(k)))},release(e){let{state:t}=e;(t===`idle`||t===`finished`)&&n.delete(e),O()||A.schedule(!0)},check(){if(!A.isJS){for(let t in i)if(gp(e,t)!==i[t]&&!p(t))return A.schedule(!0,!0)}},demote(e){if(!(A.isJS||u))return n.forEach(t=>{t.isAccelerated()&&t.sync(),e||(t.canAccelerate=!1)}),A.isJS=!0,o=/* @__PURE__ */ new Map,v(),n.forEach(e=>e.state===`running`&&e.js?.start()),!0}};return ap.set(t,A),A}var xp=class extends jd{constructor(e){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=hl.now();let{keyframes:t,name:n,motionValue:r,element:i}=e,a=e;a.autoplay??=!0,a.delay??=0,a.type??=`keyframes`,a.repeat??=0,a.repeatDelay??=0,a.repeatType??=`loop`;let o=i?.KeyframeResolver||Tf;this.keyframeResolver=new o(t,(e,t,n)=>this.onKeyframesResolved(e,t,a,!n),n,r,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=hl.now();let u=Wf(e,i,a,o);u||((Pc.instantAnimations||!s)&&l?.(Cd(e,n,t)),e[0]=e[e.length-1],Gf(n),n.repeat=0);let{onComplete:d}=n;n.finalKeyframe=t,n.keyframes=e,n.onComplete=()=>{d?.(),this.notifyFinished()};let f=u&&!c&&Zf(n),p=!f&&_p(n);r&&(f||p||this.resolvedAt!==this.createdAt)&&(n.startTime??=Dd(this.createdAt,this.resolvedAt));let m;if(f){n.element=n.motionValue?.owner?.current;try{m=new Vf(n)}catch{m=new Pd(n)}}else m=p?new yp(n):new Pd(n);this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(e,t){return this.finished.finally(e).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),Cf()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}},Sp=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return Cp(this.animations,`duration`)}get iterationDuration(){return Cp(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function Cp(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var wp=class extends Sp{then(e,t){return this.finished.finally(e).then(()=>{})}};function Tp(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Ep=30,Dp=e=>!isNaN(parseFloat(e)),Op={current:void 0},kp=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=hl.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.dirty(),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=hl.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Dp(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){var n;return e===`change`?this.onChangeSubscribe(t):((n=this.events)[e]||(n[e]=new Hc)).add(t)}onChangeSubscribe(e){let{events:t}=this;return!t.change&&!this.changeSubscriber?this.changeSubscriber=e:(t.change||(t.change=new Hc,t.change.add(this.changeSubscriber),this.changeSubscriber=void 0),t.change.add(e)),()=>{this.changeSubscriber===e?this.changeSubscriber=void 0:t.change?.remove(e),this.stopIfUnobserved()}}stopIfUnobserved(){Pu.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect?.()}dirty(){let{current:e,changeSubscriber:t}=this;t?t(e):this.events.change?.notify(e)}addDependent(e){(this.dependents||=/* @__PURE__ */ new Set).add(e)}removeDependent(e){this.dependents?.delete(e)}get(){Op.current?.push(this);let e=this.animation?.liveValue?.();return e===void 0?this.current:e}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=hl.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Ep)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Ep);return/* @__PURE__ */ Gc(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0;let n=!1,r;r=e(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===r&&(this.animation=void 0),t()}),n||(this.animation=r),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}};function Ap(e,t){return new kp(e,t)}function jp(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Mp(e,t){let n=e?.[t]??e?.default??e;return n===e?n:jp(n,e)}var Np={type:`spring`,stiffness:500,damping:25,restSpeed:10},Pp=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fp={type:`keyframes`,duration:.8},Ip={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Lp=(e,{keyframes:t})=>t.length>2?Fp:sf.has(e)?e.startsWith(`scale`)?Pp(t[1]):Np:Ip,Rp=/* @__PURE__ */ new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`,`out`]);function zp(e){for(let t in e)if(!Rp.has(t))return!0;return!1}var Bp=(e,t,n,r={},i,a)=>o=>{let s=Mp(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=/* @__PURE__ */ Uc(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i,hasOnUpdate:!!s.onUpdate};zp(s)||Object.assign(u,Lp(e,u)),u.duration&&=/* @__PURE__ */ Uc(u.duration),u.repeatDelay&&=/* @__PURE__ */ Uc(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Gf(u),u.delay===0&&(d=!0)),(Pc.instantAnimations||Pc.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Gf(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Cd(u.keyframes,s);if(e!==void 0){Pu.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Pd(u):new xp(u)},Vp=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Hp(e){let t=Vp.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Up(e,t,n=1){let[r,i]=Hp(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Fc(e)?parseFloat(e):e}return bl(i)?Up(i,t,n+1):i}function Wp(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Gp(e,t,n,r){let i=t=>typeof t==`function`?t(n===void 0?e.custom:n,...Wp(r)):t;return t=i(t),typeof t==`string`&&(t=e.variants&&e.variants[t]),i(t)}function Kp(e,t,n){return Gp(e.getProps(),t,n,e)}var qp=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Jp=/* @__PURE__ */ new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...of]),Yp=e=>Array.isArray(e);function Xp(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ap(n))}function Zp(e){return Yp(e)?e[e.length-1]||0:e}function Qp(e,t){let{transitionEnd:n={},transition:r={},...i}=Kp(e,t)||{};i={...i,...n};for(let t in i)Xp(e,t,Zp(i[t]))}var $p=e=>!!(e&&e.getVelocity);function em(e){return!!($p(e)&&e.add)}function tm(e,t){let n=e.getValue(`willChange`);if(em(n))return n.add(t);if(!n&&Pc.WillChange){let n=new Pc.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var nm=`data-framer-appear-id`;function rm(e){return e.props[nm]}var im=typeof window<`u`;function am({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function om(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?jp(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&am(f,t))continue;let o={delay:n,...Mp(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Pu.update(()=>r.set(i));continue}let p=!1;if(im&&window.MotionHandoffAnimation){let n=rm(e);if(n){let e=window.MotionHandoffAnimation(n,t,Pu);e!==null&&(o.startTime=e,p=!0)}}tm(e,t);let m=l??e.shouldReduceMotion;r.start(Bp(t,r,i,m&&Jp.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Pu.update(()=>{o&&Qp(e,o)});d.length?Promise.all(d).then(t):t()}return d}function sm(e,t,n={}){let r=Kp(e,t,qp(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?om(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(sm(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Tp(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function cm(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>sm(e,t,n))):typeof t==`string`?sm(e,t,n):Promise.all(om(e,Kp(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var lm={test:e=>e===`auto`,parse:e=>e},um=e=>t=>t.test(e),dm=[Cl,X,zl,Rl,Vl,Bl,lm],fm=e=>dm.find(um(e));function pm(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Lc(e)}var mm=/* @__PURE__ */ new Set([`auto`,`none`,`0`]);function hm(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!mm.has(t)&&tu(t)&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]!==i&&(e[r]=Kd(n,i))}var gm=class extends Tf{constructor(){super(...arguments),this.isAsync=!0}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){let{unresolvedKeyframes:e,element:t,motionValue:n}=this,r=e[0]??n?.get();if(!t?.current||r===void 0)return!1;for(let t=0;t<e.length;t++)if(Sl(t?e[t]:r))return!1;return!0}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t?.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),bl(r))){let i=Up(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Jp.has(n)||e.length!==2)return;let[r,i]=e;if(typeof r==`number`&&typeof i==`number`)return;let a=fm(r),o=fm(i);if(Sl(r)!==Sl(i)&&gf[n])this.needsMeasurement=!0;else if(a!==o){if(cf(a)&&cf(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else gf[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||pm(e[t]))&&n.push(t);n.length&&hm(e,n,t)}measure(){let{element:e,name:t}=this;return gf[t](window.getComputedStyle(e.current),()=>e.measureViewportBox())}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e?.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&this.motionValue?.jump(r,!1)}measureEndState(){let{element:e,unresolvedKeyframes:t}=this;if(!e?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);let n=t.length-1,r=t[n];t[n]=this.measure(),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.resolveNoneKeyframes()}},_m=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],vm=[];function ym(e){bm(e),vm.unshift(e)}function bm(e){Mc(vm,e)}function xm(e){return vm.find(t=>t.test(e))}function Sm(e,t,n={},r){let i=[],{velocity:a,path:o}=n,s=n.reduceMotion??r?.shouldReduceMotion;o?.animateValues&&r&&(t={...t},o.animateValues(e,t,n,0,i));for(let o in t){if(o===`transition`||o===`transitionEnd`)continue;let c=t[o];if(c===void 0)continue;let l=e(o),u=l.get();u!==void 0&&!l.isAnimating()&&!Array.isArray(c)&&c===u&&!a?Pu.update(()=>l.set(c)):(l.start(Bp(o,l,c,s&&Jp.has(o)?{type:!1}:n,r)),l.animation&&i.push(l.animation))}let{transitionEnd:c}=t;if(c){let t=()=>Pu.update(()=>{for(let t in c)e(t).set(c[t])});i.length?Promise.all(i).then(t):t()}return i}function Cm(e,t,n,r,i){return Sm(r=>{let a=e.get(t,r);if(!a){let o;if(!i){let i=n[r];o=wm(i)??e.read(t,r,i)}a=Ap(o,{owner:i}),e(t,{[r]:a})}return a},n,r,i)}function wm(e){let t=Array.isArray(e)?e[0]:void 0;return t===null?void 0:t}function Tm(e){return Ic(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}function Em(e){return Ic(e)&&`ownerSVGElement`in e}var Dm={};function Om(e){return Dm.current?.add(e),e}var km=e=>Dm.current?Dm.current.bind(e):e;function Am(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=t?t.current:Dm.current?.root||document,i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var jm=class{constructor(e=Pu.render){this.step=e,this.values=/* @__PURE__ */ new Map,this.pending=[],this.numPending=0,this.flush=()=>{let{pending:e,numPending:t}=this;this.numPending=0;for(let n=0;n<t;n++)e[n]()}}set(e,t,n,r){if(this.values.get(e)?.onRemove(),r)for(let e of this.values.values())e.value===r&&(n=e.render);let i=()=>n&&this.schedule(n);t.get()!==void 0&&i();let a=t.on(`change`,i),o=()=>{a(),n&&!r&&this.cancel(n),this.values.get(e)?.onRemove===o&&this.values.delete(e)};return this.values.set(e,{value:t,render:r?void 0:n,onRemove:o}),o}get(e){return this.values.get(e)?.value}release(){let e=/* @__PURE__ */ new Map;return this.values.forEach((t,n)=>{e.set(n,t.value),t.onRemove()}),this.transformKeys=this.transformValues=void 0,e}schedule(e){let{pending:t,numPending:n}=this;for(let r=0;r<n;r++)if(t[r]===e)return;n||this.step(this.flush),t[this.numPending++]=e}cancel(e){let{pending:t}=this;for(let n=0;n<this.numPending;n++)if(t[n]===e){t[n]=t[--this.numPending];return}}};function Mm(e,{step:t,...n}={}){let r=/* @__PURE__ */ new WeakMap;return Object.assign((n,i)=>{let a=r.get(n)??new jm(t);r.set(n,a);let o=[];for(let t in i){let r=i[t],s=e(n,a,t,r);o.push(s)}return()=>{for(let e of o)e()}},n,{get:(e,t)=>r.get(e)?.get(t),flush:e=>r.get(e)?.flush(),state:e=>r.get(e)})}function Nm(e){let t=``,{transformKeys:n=[],transformValues:r={}}=e;for(let e=0;e<n.length;e++){let i=n[e],a=r[i].getCurrent();a!==void 0&&(rp(i,a)||(t+=(t&&` `)+np(i,a)))}let i=e.get(`pathRotation`)?.get();return i&&(t+=(t&&` `)+np(`rotate`,i)),t||`none`}var Pm=/* @__PURE__ */ new Set([`originX`,`originY`,`originZ`]),Fm=(e,t)=>Qf(e.get(t)?.get(),Hd[t]),Im=(e,t,n,r)=>{let i,a;if(sf.has(n)){if(n!==`pathRotation`){let e=t.transformKeys??=[];(t.transformValues??={})[n]=r,e.includes(n)||(e.push(n),e.sort((e,t)=>of.indexOf(e)-of.indexOf(t)))}t.get(`transform`)||(!Tm(e)&&!t.get(`transformBox`)&&Im(e,t,`transformBox`,new kp(`fill-box`)),t.set(`transform`,new kp(`none`),()=>{ap.get(e)?.check(),e.style.transform=Nm(t)})),a=t.get(`transform`)}else Pm.has(n)?(t.get(`transformOrigin`)||t.set(`transformOrigin`,new kp(``),()=>{let n=Fm(t,`originX`)??`50%`,r=Fm(t,`originY`)??`50%`,i=Fm(t,`originZ`)??0;e.style.transformOrigin=`${n} ${r} ${i}`}),a=t.get(`transformOrigin`)):i=Ef(n)?()=>{e.style.setProperty(n,r.getCurrent())}:()=>{e.style[n]=Qf(r.getCurrent(),Hd[n])};return t.set(n,r,i,a)},Lm=e=>Tm(e)||Em(e),Rm=(e,t)=>{if(sf.has(t))return af(e,t);let n=getComputedStyle(e),r=Ef(t)?n.getPropertyValue(t):n[t];return typeof r==`string`&&r.trim()||0},zm=/*@__PURE__*/ Mm(Im,{test:Lm,read:Rm});function Bm(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}function Vm(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(sf.has(e))o=!0;else if(vl(e))i[e]=n;else{let t=Qf(n,Hd[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=ip(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var Hm={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Um={offset:`strokeDashoffset`,array:`strokeDasharray`};function Wm(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Hm:Um;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var Gm=[`transform`,`opacity`,`clipPath`,`filter`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Km(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Vm(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of Gm)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Wm(d,i,a,o,!1)}function qm(e,t){if(!(t in e))return!1;let n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),t)||Object.getOwnPropertyDescriptor(e,t);return n&&typeof n.set==`function`}var Jm=(e,t,n,r,i=n)=>{let a=qm(e,i);!a&&(i.startsWith(`data`)||i.startsWith(`aria`))&&(i=Bm(i));let o=Hd[n]||Hd[i],s=a?()=>{e[i]=Qf(r.get(),Hd[n])}:()=>{let t=Qf(r.get(),o);t==null?e.removeAttribute(i):e.setAttribute(i,String(t))};return t.set(n,r,s)};function Ym(e,t,n,r){return Pu.render(()=>e.setAttribute(`pathLength`,`1`)),n===`pathOffset`?t.set(n,r,()=>{let t=r.get();e.setAttribute(`stroke-dashoffset`,`${-t}`)}):(t.get(`stroke-dasharray`)||t.set(`stroke-dasharray`,new kp(`1 1`),()=>{let n=t.get(`pathLength`)?.get()??1,r=t.get(`pathSpacing`)?.get();e.setAttribute(`stroke-dasharray`,`${n} ${r??1-Number(n)}`)}),t.set(n,r,void 0,t.get(`stroke-dasharray`)))}var Xm=/*@__PURE__*/ Mm((e,t,n,r)=>n.startsWith(`path`)&&!sf.has(n)?Ym(e,t,n,r):n.startsWith(`attr`)?Jm(e,t,n,r,Zm(n)):(sf.has(n)||Pm.has(n)||Ef(n)||n in e.style?Im:Jm)(e,t,n,r),{test:Em,read:(e,t)=>sf.has(t)?Hd[t]?.default||0:Ef(t)||Gm.includes(t)?Rm(e,t)||e.getAttribute(Bm(t))||0:(t=Zm(t),e.getAttribute(Bm(t))??e.getAttribute(t)??void 0)});function Zm(e){return e.replace(/^attr([A-Z])/,(e,t)=>t.toLowerCase())}function Qm({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $m({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function eh(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function th(e){return e===void 0||e===1}function nh({scale:e,scaleX:t,scaleY:n}){return!th(e)||!th(t)||!th(n)}var rh=[`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skewX`,`skewY`];function ih(e){return nh(e)||oh(e)||ah(e)}function ah(e){return e.z||e.rotate||e.rotateX||e.rotateY||e.rotateZ||e.skewX||e.skewY}function oh(e){return sh(e.x)||sh(e.y)}function sh(e){return e&&e!==`0%`}function ch(e,t,n){return n+t*(e-n)}function lh(e,t,n,r,i){return i!==void 0&&(e=ch(e,i,r)),ch(e,n,r)+t}function uh(e,t=0,n=1,r,i){e.min=lh(e.min,t,n,r,i),e.max=lh(e.max,t,n,r,i)}function dh(e,{x:t,y:n}){uh(e.x,t.translate,t.scale,t.originPoint),uh(e.y,n.translate,n.scale,n.originPoint)}var fh=.999999999999,ph=1.0000000000001;function mh(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++)a=n[s],o=a.projectionDelta,a.options.visualElement?.props.style?.display!==`contents`&&(r===!0&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(hh(e.x,-a.scroll.offset.x),hh(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,dh(e,o)),r&&(r.path?.[s]||r)!==a&&ih(a.latestValues)&&vh(e,a.latestValues,a.layout?.layoutBox));t.x<ph&&t.x>fh&&(t.x=1),t.y<ph&&t.y>fh&&(t.y=1)}function hh(e,t){e.min+=t,e.max+=t}function gh(e,t,n,r,i=.5){uh(e,t,n,pu(e.min,e.max,i),r)}function _h(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function vh(e,t,n){let r=n??e;gh(e.x,_h(t.x,r.x),t.scaleX,t.scale,t.originX),gh(e.y,_h(t.y,r.y),t.scaleY,t.scale,t.originY)}function yh(e,t){return Qm(eh(e.getBoundingClientRect(),t))}function bh(e,t,n){let r=yh(e,n),{scroll:i}=t;return i&&(hh(r.x,i.offset.x),hh(r.y,i.offset.y)),r}var xh={},Sh=e=>Em(e)?Xm:zm,Ch=class{constructor(e,t){this.effect=e,this.current=t,this.KeyframeResolver=gm}getValue(e){return this.effect.get(this.current,e)}readValue(e,t){return this.effect.read(this.current,e,t)}render(){this.effect.flush(this.current)}measureViewportBox(){return yh(this.current)}getProps(){return xh}};function wh(e,t,n,r){if(Dm.current?.track(e),r)return Sm(e=>r.getValue(e,null),t,n,r);let i=Sh(e);return Cm(i,e,t,n,new Ch(i,e))}var Th=/*@__PURE__*/ Mm((e,t,n,r)=>t.set(n,r,()=>{e[n]=r.get()}),{test:e=>Ic(e),read:(e,t)=>{let n=e[t];return typeof n==`string`||typeof n==`number`?n:void 0}}),{schedule:Eh,cancel:Dh}=/* @__PURE__ */ Nu(queueMicrotask,!1);function Oh(e,t,n){let r=$p(e)?e:Ap(e);return r.start(Bp(``,r,t,n)),r.animation}var kh={},Ah={value:null,addProjectionMetrics:null};function jh(e,t){let n=hl.now();e=km(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(Fu(r),e(a-t))};return Pu.setup(r,!0),Om(()=>Fu(r))}function Mh(e){return Em(e)&&e.tagName===`svg`}function Nh(e){return $p(e)?e.get():e}var Ph=e=>typeof e==`number`?e:parseFloat(e),Fh=_m.length,Ih=e=>typeof e==`number`||X.test(e);function Lh(e,t,n,r,i,a){i?(e.opacity=pu(0,n.opacity??1,zh(r)),e.opacityExit=pu(t.opacity??1,0,Bh(r))):a&&(e.opacity=pu(t.opacity??1,n.opacity??1,r));for(let i=0;i<Fh;i++){let a=_m[i],o=Rh(t,a),s=Rh(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Ih(o)===Ih(s)?(e[a]=Math.max(pu(Ph(o),Ph(s),r),0),(zl.test(s)||zl.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<rh.length;i++){let a=rh[i];(t[a]||n[a])&&(e[a]=pu(t[a]||0,n[a]||0,r))}}function Rh(e,t){return e[t]===void 0?e.borderRadius:e[t]}var zh=/*@__PURE__*/ Vh(0,.5,nl),Bh=/*@__PURE__*/ Vh(.5,.95,zc);function Vh(e,t,n){return r=>r<e?0:r>t?1:n(/* @__PURE__ */ Vc(e,t,r))}function Hh(e,t){e.min=t.min,e.max=t.max}function Uh(e,t){Hh(e.x,t.x),Hh(e.y,t.y)}function Wh(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Gh=.9999,Kh=1.0001,qh=-.01,Jh=.01;function Yh(e){return e.max-e.min}function Xh(e,t,n){return Math.abs(e-t)<=n}function Zh(e,t,n,r=.5){e.origin=r,e.originPoint=pu(t.min,t.max,e.origin),e.scale=Yh(n)/Yh(t),e.translate=pu(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Gh&&e.scale<=Kh||isNaN(e.scale))&&(e.scale=1),(e.translate>=qh&&e.translate<=Jh||isNaN(e.translate))&&(e.translate=0)}function Qh(e,t,n,r){Zh(e.x,t.x,n.x,r?.originX),Zh(e.y,t.y,n.y,r?.originY)}function $h(e,t,n,r=0){e.min=(r?pu(n.min,n.max,r):n.min)+t.min,e.max=e.min+Yh(t)}function eg(e,t,n,r){$h(e.x,t.x,n.x,r?.x),$h(e.y,t.y,n.y,r?.y)}function tg(e,t,n,r=0){let i=r?pu(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Yh(t)}function ng(e,t,n,r){tg(e.x,t.x,n.x,r?.x),tg(e.y,t.y,n.y,r?.y)}function rg(e,t,n,r,i){return e-=t,e=ch(e,1/n,r),i!==void 0&&(e=ch(e,1/i,r)),e}function ig(e,t=0,n=1,r=.5,i,a=e,o=e){if(zl.test(t)&&(t=parseFloat(t),t=pu(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=pu(a.min,a.max,r);e===a&&(s-=t),e.min=rg(e.min,t,n,s,i),e.max=rg(e.max,t,n,s,i)}function ag(e,t,[n,r,i],a,o){ig(e,t[n],t[r],t[i],t.scale,a,o)}var og=[`x`,`scaleX`,`originX`],sg=[`y`,`scaleY`,`originY`];function cg(e,t,n,r){ag(e.x,t,og,n?.x,r?.x),ag(e.y,t,sg,n?.y,r?.y)}var lg=()=>({translate:0,scale:1,origin:0,originPoint:0}),ug=()=>({x:lg(),y:lg()}),dg=()=>({min:0,max:0}),fg=()=>({x:dg(),y:dg()});function pg(e){return e.translate===0&&e.scale===1}function mg(e){return pg(e.x)&&pg(e.y)}function hg(e,t){return e.min===t.min&&e.max===t.max}function gg(e,t){return hg(e.x,t.x)&&hg(e.y,t.y)}function _g(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vg(e,t){return _g(e.x,t.x)&&_g(e.y,t.y)}function yg(e){return Yh(e.x)/Yh(e.y)}function bg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var xg=class{constructor(){this.members=[]}add(e){jc(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(Mc(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Mc(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function Sg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Cg={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(X.test(e))e=parseFloat(e);else return e}return`${Sg(e,t.target.x)}% ${Sg(e,t.target.y)}%`}},wg={borderRadius:/* @__PURE__ */ Object.assign({},Cg,{applyTo:/* @__PURE__ */ _m.slice()}),borderTopLeftRadius:Cg,borderTopRightRadius:Cg,borderBottomLeftRadius:Cg,borderBottomRightRadius:Cg,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=lu.parse(e);if(i.length>5)return r;let a=lu.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=pu(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function Tg(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<rh.length;e++){let t=rh[e],i=n[t];i&&(r+=`${t}(${i}deg) `),!e&&n.pathRotation&&(r+=`rotate(${n.pathRotation}deg) `)}}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}function Eg(e){return[e(`x`),e(`y`)]}var Dg=(e,t)=>e.depth-t.depth,Og=class{constructor(){this.children=[],this.isDirty=!1}add(e){jc(this.children,e),this.isDirty=!0}remove(e){Mc(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Dg),this.isDirty=!1,this.children.forEach(e)}},kg={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ag={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},jg=[`z`,`skew`,`skewZ`],Mg=1e3,Ng=0;function Pg(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var Fg=e=>e.instance&&ap.get(e.instance)?.demote()&&e.resetSkewAndRotation();function Ig(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=rm(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Pu,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ig(r)}function Lg({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(kh,{...wg,...kh}),class{constructor(e={},n=t?.()){this.id=Ng++,this.animationId=0,this.animationCommitId=0,this.children=/* @__PURE__ */ new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=/* @__PURE__ */ new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ah.value&&(Ag.nodes=Ag.calculatedTargetDeltas=Ag.calculatedProjections=0),this.nodes.forEach(Bg),this.nodes.forEach(Zg),this.nodes.forEach(Qg),this.nodes.forEach(Vg),Ah.addProjectionMetrics&&Ah.addProjectionMetrics(Ag)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=/* @__PURE__ */ new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Og)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Hc),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Em(t)&&!Mh(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Pu.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=jh(i,250),kg.hasAnimatedSinceResize&&(kg.hasAnimatedSinceResize=!1,this.nodes.forEach(Xg)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||i_,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!vg(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Mp(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Xg(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,Fu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach($g),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ig(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Fg(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,Fg(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Wg),this.nodes.forEach(Ug);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Gg);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qg),this.nodes.forEach(Jg),this.nodes.forEach(Yg),this.nodes.forEach(Rg),this.nodes.forEach(zg)):this.nodes.forEach(Gg),this.clearAllSnapshots();let e=hl.now();Y.delta=Nc(0,1e3/60,e-Y.timestamp),Y.timestamp=e,Y.isProcessing=!0,Iu.update.process(Y),Iu.preRender.process(Y),Iu.render.process(Y),Y.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Eh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Hg),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Pu.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Pu.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!Yh(this.snapshot.measuredBox.x)&&!Yh(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=fg(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&Fg(this);let t=this.projectionDelta&&!mg(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ih(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),c_(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return fg();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(d_))){let{scroll:e}=this.root;e&&(hh(t.x,e.offset.x),hh(t.y,e.offset.y))}return t}removeElementScroll(e){let t=fg();if(Uh(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Uh(t,e),hh(t.x,i.offset.x),hh(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||fg();Uh(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(hh(a.x,-n.scroll.offset.x),hh(a.y,-n.scroll.offset.y)),ih(n.latestValues)&&vh(a,n.latestValues,n.layout?.layoutBox)}return!r&&ih(this.latestValues)&&vh(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=fg();Uh(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!ih(n.latestValues))continue;let r;n.instance&&(nh(n.latestValues)&&n.updateSnapshot(),r=fg(),Uh(r,n.measurePageBox())),cg(t,n.latestValues,n.snapshot?.layoutBox,r)}return ih(this.latestValues)&&cg(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Y.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Y.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=fg(),this.targetWithTransforms=fg()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),eg(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):Uh(this.target,this.layout.layoutBox),dh(this.target,this.targetDelta)):Uh(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Ah.value&&Ag.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||nh(this.parent.latestValues)||oh(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fg(),this.relativeTargetOrigin=fg(),ng(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Uh(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Y.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Uh(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;mh(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=fg());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Wh(this.prevProjectionDelta.x,this.projectionDelta.x),Wh(this.prevProjectionDelta.y,this.projectionDelta.y)),Qh(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&bg(this.projectionDelta.x,this.prevProjectionDelta.x)&&bg(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Ah.value&&Ag.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ug(),this.projectionDelta=ug(),this.projectionDeltaWithTransform=ug()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=ug();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=fg(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(r_));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);e_(o.x,e.x,n),e_(o.y,e.y,n),r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ng(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),n_(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&gg(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=fg(),Uh(f,this.relativeTarget)),c&&(this.animationValues=a,Lh(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Fu(this.pendingAnimation),void 0),this.pendingAnimation=Pu.update(()=>{kg.hasAnimatedSinceResize=!0,this.motionValue||=Ap(0),this.motionValue.jump(0,!1),this.currentAnimation=Oh(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),Ad(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta?.(Mg),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&u_(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||fg(),l_(i.x,t.x,e.x),l_(i.y,t.y,e.y)}Uh(t,i),vh(t,r),Qh(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new xg),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!ah(t))return;let n={};for(let t=0;t<jg.length;t++)Pg(jg[t],e,n,this.animationValues);for(let t=0;t<rh.length;t++)Pg(rh[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Nh(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Nh(t?.pointerEvents)||``),this.hasProjected&&!ih(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=Tg(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in kh){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=kh[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?Nh(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(Ug),this.root.sharedNodes.clear()}}}function Rg(e){e.updateLayout(),Kg(e)}function zg(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)Eg(e=>{let t=Yh(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Hh(r[e],a[e])}else u_(i,t.layoutBox,n)&&Eg(t=>{let n=Yh(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=ug();Qh(c,n,t.layoutBox);let l=ug();Qh(l,a?e.applyTransform(r,!0):n,s);let u=!mg(c),d=!1,f=e.getClosestProjectingParent();if((!e.resumeFrom||f?.options.layoutRoot&&e.resumeFrom.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=fg();ng(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=fg();ng(l,n,i.layoutBox,s),a&&o(c,l),vg(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function Bg(e){Ah.value&&Ag.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Vg(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hg(e){e.clearSnapshot()}function Ug(e){e.clearMeasurements()}function Wg(e){e.isLayoutDirty=!0,e.updateLayout()}function Gg(e){e.isLayoutDirty=!1}function Kg(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;Eg(e=>hh(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function qg(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Jg(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Yg(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Xg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Zg(e){e.resolveTargetDelta()}function Qg(e){e.calcProjection()}function $g(e){e.resetSkewAndRotation()}function e_(e,t,n){e.translate=pu(t.translate,0,n),e.scale=pu(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function t_(e,t,n,r){e.min=pu(t.min,n.min,r),e.max=pu(t.max,n.max,r)}function n_(e,t,n,r){t_(e.x,t.x,n.x,r),t_(e.y,t.y,n.y,r)}function r_(e){return e.animationValues?.opacityExit!==void 0}var i_={duration:.45,ease:[.4,0,.1,1]},a_=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),o_=a_(`applewebkit/`)&&!a_(`chrome/`)?Math.round:zc;function s_(e){e.min=o_(e.min),e.max=o_(e.max)}function c_(e){s_(e.x),s_(e.y)}function l_(e,t,n){e.max=Yh(n)+(e.min=t.min)}function u_(e,t,n){return e===`position`||e===`preserve-aspect`&&!Xh(yg(t),yg(n),.2)}function d_(e){return e!==e.root&&e.scroll?.wasRoot}function f_(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var p_=/* @__PURE__ */ Lg({attachResizeListener:(e,t)=>f_(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),m_={current:void 0},h_=/* @__PURE__ */ Lg({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!m_.current){let e=new p_({});e.mount(window),e.setOptions({layoutScroll:!0}),m_.current=e}return m_.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),g_=/* @__PURE__ */ new WeakMap;function __(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function v_(e){return typeof e==`string`||Array.isArray(e)}var y_=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],b_=/* @__PURE__ */ [`initial`].concat(y_);function x_(e){if(__(e.animate))return!0;for(let t=0;t<b_.length;t++)if(v_(e[b_[t]]))return!0;return!1}function S_(e){return!!(x_(e)||e.variants)}function C_(e,t,n){for(let r in t){let i=t[r],a=n[r];if($p(i))e.addValue(r,i);else if($p(a))e.addValue(r,Ap(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Ap(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var w_={current:null},T_={current:!1},E_=typeof window<`u`;function D_(){if(T_.current=!0,E_){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>w_.current=e.matches;e.addEventListener(`change`,t),t()}else w_.current=!1}}var O_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],k_={};function A_(e){k_=e}function j_(){return k_}var M_=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=/* @__PURE__ */ new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=/* @__PURE__ */ new Map,this.KeyframeResolver=Tf,this.features={},this.valueSubscriptions=/* @__PURE__ */ new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=hl.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Pu.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=x_(t),this.isVariantNode=S_(t),this.isVariantNode&&(this.variantChildren=/* @__PURE__ */ new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&$p(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];if(this.current=e,g_.set(e,this),this.projection?.instance||this.projection?.mount(e),this.isVariantNode&&!this.isControllingVariants){let e=this;do e=e.props.inherit!==!1&&e.parent;while(e&&!e.isVariantNode);if(e){let{variantChildren:t}=e;t.add(this),this.removeFromVariantTree=()=>t.delete(this)}}this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(T_.current||D_(),this.shouldReduceMotion=w_.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),Fu(this.notifyUpdate),Fu(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),(this.enteringChildren||=/* @__PURE__ */ new Set).add(e)}removeChild(e){this.children.delete(e),this.enteringChildren?.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.get(e)?.(),t.accelerate&&Kf.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Rf({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:/* @__PURE__ */ Uc(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=sf.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Pu.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),ap.get(this.current)?.check()),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i?.()})}sortNodePosition(e){return!this.current||!e.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in k_){let t=k_[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fg()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){let{transformTemplate:n,onUpdate:r}=this.props;(e.transformTemplate||n)&&this.scheduleRender(),(e.transformTemplate&&!n||e.onUpdate&&!r)&&ap.get(this.current)?.demote(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<O_.length;t++){let n=O_[t];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=C_(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(e){return this.props.variants?.[e]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(e,t){let n=this.values.get(e);if(t!==n){n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t);let r=t.get();r!==void 0&&(this.latestValues[e]=r)}}removeValue(e){this.values.delete(e),this.valueSubscriptions.get(e)?.(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){let n=this.props.values?.[e];return n||(n=this.values.get(e),n===void 0&&t!==void 0&&(n=Ap(t??this.getDefaultValue?.(e),{owner:this}),this.addValue(e,n)),n)}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Fc(n)||Lc(n))?n=parseFloat(n):typeof n!=`number`&&!lu.test(n)&&lu.test(t)&&(n=Kd(e,t)),this.setBaseTarget(e,$p(n)?n.get():n)),$p(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}on(e,t){return(this.events[e]||(this.events[e]=new Hc)).add(t)}notify(e,...t){this.events[e]?.notify(...t)}scheduleRenderMicrotask(){Eh.render(this.render)}},N_=class extends M_{constructor(){super(...arguments),this.KeyframeResolver=gm}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;$p(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function P_(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function F_(e,{layout:t,layoutId:n}){return sf.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!kh[e]||e===`opacity`)}function I_(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)($p(r[t])||i&&$p(i[t])||F_(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function L_(e){return window.getComputedStyle(e)}var R_=class extends N_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=P_}mount(e){super.mount(e)}readValueFromInstance(e,t){if(sf.has(t))return this.projection?.isProjecting?nf(t):af(e,t);{let n=L_(e),r=(vl(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return yh(e,t)}build(e,t,n){Vm(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return I_(e,t,n)}},z_=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function B_(e){return{point:{x:e.pageX,y:e.pageY}}}var V_=e=>t=>z_(t)&&e(t,B_(t));function H_(e,t,n,r){return f_(e,t,V_(n),r)}var U_=/* @__PURE__ */ new WeakMap,W_,G_=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Em(r)&&`getBBox`in r?r.getBBox()[t]:r[n],K_=/*@__PURE__*/ G_(`inline`,`width`,`offsetWidth`),q_=/*@__PURE__*/ G_(`block`,`height`,`offsetHeight`);function J_({target:e,borderBoxSize:t}){U_.get(e)?.forEach(n=>{n(e,{get width(){return K_(e,t)},get height(){return q_(e,t)}})})}function Y_(e){e.forEach(J_)}function X_(){typeof ResizeObserver<`u`&&(W_=new ResizeObserver(Y_))}function Z_(e,t){W_||X_();let n=Am(e);return n.forEach(e=>{let n=U_.get(e);n||(n=/* @__PURE__ */ new Set,U_.set(e,n)),n.add(t),W_?.observe(e)}),()=>{n.forEach(e=>{let n=U_.get(e);n?.delete(t),n?.size||W_?.unobserve(e)})}}var Q_=/* @__PURE__ */ new Set,$_;function ev(){$_=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Q_.forEach(t=>t(e))},window.addEventListener(`resize`,$_)}function tv(e){return Q_.add(e),$_||ev(),()=>{Q_.delete(e),!Q_.size&&typeof $_==`function`&&(window.removeEventListener(`resize`,$_),$_=void 0)}}function nv(e,t){return Om(typeof e==`function`?tv(e):Z_(e,t))}var rv=(e,t)=>Math.abs(e-t);function iv(e,t){let n=rv(e.x,t.x),r=rv(e.y,t.y);return Math.sqrt(n**2+r**2)}var av=/*#__PURE__*/ new Set([`auto`,`scroll`]),ov=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=/* @__PURE__ */ new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=cv(this.lastRawMoveEventInfo,this.transformPagePoint));let e=uv(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=iv(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:hl.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=cv(t,this.transformPagePoint),this.hasPendingMove=!0,Pu.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=uv(e.type===`pointercancel`?this.lastMoveEventInfo:cv(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!z_(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=cv(B_(e),this.transformPagePoint),{point:c}=s;this.history=[{...c,timestamp:hl.now()}];let{onSessionStart:l}=t;l&&l(e,uv(s,this.history));let u={passive:!0,capture:!0};this.removeListeners=Bc(H_(this.contextWindow,`pointermove`,this.handlePointerMove,u),H_(this.contextWindow,`pointerup`,this.handlePointerUp,u),H_(this.contextWindow,`pointercancel`,this.handlePointerUp,u)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(av.has(e.overflowX)||av.has(e.overflowY))&&this.scrollPositions.set(t,sv(t)),t=t.parentElement}this.scrollPositions.set(window,sv(window)),this.removeScrollListeners=Bc(f_(window,`scroll`,this.onElementScroll,{capture:!0}),f_(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=sv(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Pu.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),Fu(this.updatePoint)}},sv=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function cv(e,t){return t?{point:t(e.point)}:e}function lv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uv({point:e},t){return{point:e,delta:lv(e,fv(t)),offset:lv(e,dv(t)),velocity:pv(t,.1)}}function dv(e){return e[0]}function fv(e){return e[e.length-1]}function pv(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=fv(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>/* @__PURE__ */ Uc(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>/* @__PURE__ */ Uc(t)*2&&(r=e[1]);let a=/* @__PURE__ */ Wc(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var mv=/* @__PURE__ */ new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function hv(e){return mv.has(e.tagName)||e.isContentEditable===!0}var gv=/* @__PURE__ */ new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function _v(e){return gv.has(e.tagName)||e.isContentEditable===!0}var vv={x:!1,y:!1};function yv(){return vv.x||vv.y}function bv(e){return e===`x`||e===`y`?vv[e]?null:(vv[e]=!0,()=>{vv[e]=!1}):vv.x||vv.y?null:(vv.x=vv.y=!0,()=>{vv.x=vv.y=!1})}function xv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?pu(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?pu(n,e,r.max):Math.min(e,n)),e}function Sv(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Cv(e,{top:t,left:n,bottom:r,right:i}){return{x:Sv(e.x,n,i),y:Sv(e.y,t,r)}}function wv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Tv(e,t){return{x:wv(e.x,t.x),y:wv(e.y,t.y)}}function Ev(e,t){let n=.5,r=Yh(e),i=Yh(t);return i>r?n=/* @__PURE__ */ Vc(t.min,t.max-r,e.min):r>i&&(n=/* @__PURE__ */ Vc(e.min,e.max-i,t.min)),Nc(0,1,n)}function Dv(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Ov=.35;function kv(e=Ov){return e===!1?e=0:e===!0&&(e=Ov),{x:Av(e,`left`,`right`),y:Av(e,`top`,`bottom`)}}function Av(e,t,n){return{min:jv(e,t),max:jv(e,n)}}function jv(e,t){return typeof e==`number`?e:e[t]||0}function Mv(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var Nv=/* @__PURE__ */ new WeakMap,Pv=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fg(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let r=e=>{t&&this.snapToCursor(e),this.stopAnimation()},i=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock?.(),this.openDragLock=bv(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:a}=this.visualElement;a&&(a.isAnimationBlocked=!0,a.target=void 0),Eg(e=>{let t=this.getAxisMotionValue(e).get()||0;if(bl(t)&&(t=Up(t,this.visualElement.current)||0),X.test(t))t=parseFloat(t);else if(zl.test(t)){let n=a?.layout?.layoutBox[e];n&&(t=Yh(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),i&&Pu.update(()=>i(e,t),!1,!0),tm(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=Bv(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.visualElement.render(),a&&Pu.update(()=>a(e,t),!1,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},s=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:c}=this.getProps();this.panSession=new ov(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:o,resumeAnimation:s},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&Pu.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!zv(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=xv(i,a,this.elastic[e])),r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;Fv(e)?this.constraints&&this.scroll===Mv(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r?Cv(r.layoutBox,e):!1,this.elastic=kv(t),i!==this.constraints&&!Fv(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Eg(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Dv(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!Fv(e))return!1;let n=Iv(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Mv(r);let i=bh(n,r.root,this.visualElement.getTransformPagePoint()),a=Tv(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t($m(a));this.hasMutatedConstraints=!!e,e&&(a=Qm(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},l=Eg(s=>{if(!zv(s,t||n,this.currentDirection))return;let l=c[s]||{};(o===!0||o===s)&&(l={min:0,max:0});let u=i?200:1e6,d=i?40:1e7,f={type:`inertia`,velocity:r?e[s]:0,bounceStiffness:u,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(s,f)});return Promise.all(l).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return tm(this.visualElement,e),n.start(Bp(e,n,0,t,this.visualElement,!1))}stopAnimation(){Eg(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Eg(e=>{if(!zv(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-pu(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Fv(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Eg(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Ev({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Eg(t=>{let n=this.getAxisMotionValue(t);if(!zv(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(pu(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Nv.set(this.visualElement,this);let e=this.visualElement.current,t=H_(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&_v(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=Fv(t)&&Iv(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Rv(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),Pu.read(r);let o=f_(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Eg(t=>{if(!zv(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Ov,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function Fv(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Iv=e=>`current`in e?e.current:e;function Lv(e){let t=!0;return()=>{t?t=!1:e()}}function Rv(e,t,n){let r=nv(e,Lv(n)),i=nv(t,Lv(n));return()=>{r(),i()}}function zv(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Bv(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Vv(e,t){let n=Am(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Om(()=>r.abort())]}function Hv(e){return!(e.pointerType===`touch`||yv())}function Uv(e,t,n={}){t=km(t);let[r,i,a]=Vv(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Hv(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Wv=(e,t)=>t?e===t||Wv(e,t.parentElement):!1,Gv=/* @__PURE__ */ new WeakSet;function Kv(e){return t=>{t.key===`Enter`&&e(t)}}function qv(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var Jv=(e,t)=>{let n=!1,r=Kv(()=>{Gv.has(e)||(n=!0,qv(e,`down`))}),i=Kv(()=>{n&&(n=!1,qv(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&qv(e,`cancel`)},{...t,once:!0})};function Yv(e){return z_(e)&&!yv()}var Xv=/* @__PURE__ */ new WeakSet;function Zv(e,t,n={}){t=km(t);let[r,i,a]=Vv(e,n),o=e=>{let r=e.currentTarget;if(!Yv(e)||Xv.has(e))return;Gv.add(r),n.stopPropagation&&Xv.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Gv.has(r)&&Gv.delete(r),Yv(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Wv(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Tm(e)&&(e.addEventListener(`focus`,()=>Jv(e,i),i),!hv(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var Qv=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},$v=/* @__PURE__ */ new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),ey=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function ty(e,t,n,r){P_(e,t,void 0,r);for(let n in t.attrs)e.setAttribute($v.has(n)?n:Bm(n),t.attrs[n])}function ny(e,t,n){let r=I_(e,t,n);for(let n in e)if(n!==`children`&&($p(e[n])||$p(t[n]))){let t=of.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var ry=class extends N_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=fg}getBaseTargetFromProps(e,t){return sf.has(t)?super.getBaseTargetFromProps(e,t)??nf(t):e[t]}getDefaultValue(e){return sf.has(e)?this.latestValues[e]??nf(e):void 0}readValueFromInstance(e,t){if(sf.has(t)){let e=Wd(t);return e&&e.default||0}if(Gm.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=$v.has(t)?t:Bm(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return ny(e,t,n)}build(e,t,n){Km(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){ty(e,t,n,r)}mount(e){this.isSVGTag=ey(e.tagName),super.mount(e)}};function iy(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ay=[...y_].reverse(),oy=e=>e?.out===!0?e:e?.out;function sy(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>cm(e,t,n))),n=ly(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&Kp(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=/* @__PURE__ */ new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&oy(f(l??(g&&g.props.initial))?.transition);if(ay.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?v_(f)||f===!1?f:void 0:l,y=v_(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||__(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=cy(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=Kp(e,n,qp(e,t))||{};E={...E,...a,...i},D=oy(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!iy(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=Kp(s,n)?.transition?.delayChildren;r.delay=Tp(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!$p(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=ly(),i=!0}}}function cy(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!iy(t,e):!1}function ly(){let e={};for(let t of y_)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var uy=/* @__PURE__ */ (0,I.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function dy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function fy(...e){return t=>{let n=!1,r=e.map(e=>{let r=dy(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():dy(e[t],null)}}}}function py(...e){return I.useCallback(fy(...e),e)}var my=e=>{let{width:t,height:n}=e?.getBoundingClientRect()||{};return[t/e?.offsetWidth||1,n/e?.offsetHeight||1]},hy=e=>{let{left:t,top:n}=e.getBoundingClientRect(),r=e;for(;r=r.parentElement||r.parentNode?.host;){let{scrollLeft:e,scrollTop:i}=r;if(e||i){let[a,o]=my(r);t+=e*a,n+=i*o}if(getComputedStyle(r).position===`fixed`)break}let[i,a]=my(e.offsetParent);return[t/i,n/a]},gy=class extends I.Component{getSnapshotBeforeUpdate(e){let t=this.props.getElement();if(Tm(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Tm(e)&&e.offsetWidth||0,r=Tm(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction,a.point=hy(t)}return null}componentDidUpdate(){}render(){return this.props.children}};function _y({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a,popNode:o}){let s=(0,I.useId)(),c=(0,I.useRef)(null),l=(0,I.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:u}=(0,I.useContext)(uy),d=py(c,a===!1?void 0:e.props?.ref??e?.ref),f=()=>c.current||o?.current?.current,p=e=>{let{width:t,height:i,top:a,left:o,right:c,bottom:u,direction:d}=l.current,f=d===`rtl`,p=n===`left`?f?`right:${c}`:`left:${o}`:f?`left:${o}`:`right:${c}`,m=r===`bottom`?`bottom:${u}`:`top:${a}`;e?.insertRule(`[data-motion-pop-id="${s}"]{position:absolute!important;width:${t}px!important;height:${i}px!important;${p}px!important;${m}px!important}`)};return(0,I.useInsertionEffect)(()=>{let{width:e,height:n}=l.current,r=f();if(t||a===!1||!r||!e||!n)return;r.dataset.motionPopId=s;let o=r.ownerDocument,c=o.createElement(`style`);u&&(c.nonce=u);let d=i??o.head;d.appendChild(c),p(c.sheet);let m=0,h=0;return Eh.setup(()=>{let[e,t]=hy(r);m=l.current.point[0]-e,h=l.current.point[1]-t}),Eh.read(()=>{let{sheet:e}=c;if(!e||!m&&!h)return;let t=l.current;t.left+=m,t.right-=m,t.top+=h,t.bottom-=h,e.deleteRule(0),p(e)}),()=>{r.removeAttribute(`data-motion-pop-id`),d.contains(c)&&d.removeChild(c)}},[t]),(0,L.jsx)(gy,{isPresent:t,getElement:f,sizeRef:l,pop:a,children:a===!1?e:I.cloneElement(e,{ref:d})})}var vy=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Oc(yy),d=(0,I.useId)(),f=(0,I.useRef)(),p=(0,I.useRef)(n),m=(0,I.useRef)(r);kc(()=>{p.current=n,m.current=r});let h=!0,g=(0,I.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:(e,t)=>(u.set(e,!1),t&&t.parent?.presenceContext?.id!==d&&(f.current=t),()=>{u.delete(e),!p.current&&!u.size&&m.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,I.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),I.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,L.jsx)(_y,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,popNode:f,children:e}),(0,L.jsx)(Ac.Provider,{value:g,children:e})};function yy(){return/* @__PURE__ */ new Map}function by(e=!0){let t=(0,I.useContext)(Ac);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,I.useId)();(0,I.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,I.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var xy=e=>e.key||``;function Sy(e){let t=[];return I.Children.forEach(e,e=>{(0,I.isValidElement)(e)&&t.push(e)}),t}var Cy=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=by(o),f=(0,I.useMemo)(()=>Sy(e),[e]),p=o&&!u?[]:f.map(xy),m=(0,I.useRef)(!0),h=Oc(()=>/* @__PURE__ */ new Map),g=(0,I.useRef)(/* @__PURE__ */ new Set),[_,v]=(0,I.useState)(f),[y,b]=(0,I.useState)(f);kc(()=>{o&&!u&&!y.length&&d?.()},[u,o,y.length,d]);let x=(0,I.useRef)();(0,I.useEffect)(()=>()=>{let e=x.current;x.current=void 0,e?.()},[y]),kc(()=>{m.current=!1;for(let e=0;e<y.length;e++){let t=xy(y[e]);p.includes(t)?(h.delete(t),g.current.delete(t)):h.get(t)!==!0&&h.set(t,!1)}},[y,p.length,p.join(`-`)]);let S=[];if(f!==_){let e=[...f],t=0;for(let n of y){let r=p.indexOf(xy(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>h.get(xy(e)))?e=f:a===`wait`&&(e=S),b(Sy(e)),v(f),null}let{forceRender:C}=(0,I.useContext)(Dc);return(0,L.jsx)(L.Fragment,{children:y.map(e=>{let _=xy(e),b=o&&!u?!1:f===y||p.includes(_);return(0,L.jsx)(vy,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(g.current.has(_))return;if(h.has(_))g.current.add(_),h.set(_,!0);else return;let e=!0;h.forEach(t=>{t||(e=!1)}),e&&(C?.(),v([]),o&&d?.(),x.current=r)},anchorX:s,anchorY:c,children:e},_)})})},wy=/* @__PURE__ */ (0,I.createContext)({strict:!1}),Ty={animation:[`variants`,...y_],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},Ey=!1;function Dy(){if(Ey)return;let e={};for(let t in Ty)e[t]={isEnabled:e=>Ty[t].some(t=>!!e[t])};A_(e),Ey=!0}function Oy(){return Dy(),j_()}function ky(e){let t=Oy();for(let n in e)t[n]={...t[n],...e[n]};A_(t)}function Ay({children:e,...t}){let n=(0,I.useContext)(uy);t={...n,...t},t.transition=jp(t.transition,n.transition),t.isStatic=Oc(()=>t.isStatic);let r=(0,I.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,L.jsx)(uy.Provider,{value:r,children:e})}var jy=/* @__PURE__ */ (0,I.createContext)({});function My(e,t){if(x_(e)){let{initial:t,animate:n}=e;return{initial:t===!1||v_(t)?t:void 0,animate:v_(n)?n:void 0}}return e.inherit===!1?{}:t}function Ny(e){let{initial:t,animate:n}=My(e,(0,I.useContext)(jy));return(0,I.useMemo)(()=>({initial:t,animate:n}),[Py(t),Py(n)])}function Py(e){return Array.isArray(e)?e.join(` `):e}var Fy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Iy(e,t,n){for(let r in t)!$p(t[r])&&!F_(r,n)&&(e[r]=t[r])}function Ly({transformTemplate:e},t){return(0,I.useMemo)(()=>{let n=Fy();return Vm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ry(e,t){let n=e.style||{},r={};return Iy(r,n,e),Object.assign(r,Ly(e,t)),r}function zy(e,t){let n={},r=Ry(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var By=()=>({...Fy(),attrs:{}});function Vy(e,t,n,r){let i=(0,I.useMemo)(()=>{let n=By();return Km(n,t,ey(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};return Iy(t,e.style,e),{...i,style:{...t,...i.style}}}return i}var Hy=/* @__PURE__ */ new Set(/* @__PURE__ */ `animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Uy(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Hy.has(e)}function Wy(e,t){return e.startsWith(`on`)?!Uy(e):t?.(e)??!Uy(e)}function Gy(e,t,n,r){let i={};for(let a in e)a===`values`&&typeof e.values==`object`||$p(e[a])||(Wy(a,r)||n===!0&&Uy(a)||!t&&!Uy(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]);return i}var Ky=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function qy(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(Ky.indexOf(e)>-1||/[A-Z]/u.test(e))}function Jy(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??qy(e)?Vy:zy)(t,r,i,e),l=Gy(t,typeof e==`string`,a,s),u=e===I.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,I.useMemo)(()=>$p(d)?d.get():d,[d]);return(0,I.createElement)(e,{...u,children:f})}function Yy({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Xy(n,r,i,e),renderState:t()}}function Xy(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Nh(a[e]);let{initial:o,animate:s}=e,c=x_(e),l=S_(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!__(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Gp(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var Zy=e=>(t,n)=>{let r=(0,I.useContext)(jy),i=(0,I.useContext)(Ac),a=()=>Yy(e,t,r,i);return n?a():Oc(a)},Qy=/*@__PURE__*/ Zy({scrapeMotionValuesFromProps:I_,createRenderState:Fy}),$y=/*@__PURE__*/ Zy({scrapeMotionValuesFromProps:ny,createRenderState:By}),eb=/* @__PURE__ */ Symbol.for(`motionComponentSymbol`);function tb(e,t,n){let r=(0,I.useRef)(n);(0,I.useInsertionEffect)(()=>{r.current=n});let i=(0,I.useRef)(null);return(0,I.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var nb=/* @__PURE__ */ (0,I.createContext)({});function rb(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function ib(e,t,n,r,i,a){let{visualElement:o}=(0,I.useContext)(jy),s=(0,I.useContext)(wy),c=(0,I.useContext)(Ac),l=(0,I.useContext)(uy),u=l.reducedMotion,d=l.skipAnimations,f=(0,I.useRef)(null),p=(0,I.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,I.useContext)(nb);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&ab(f.current,n,i,h),(0,I.useInsertionEffect)(()=>{m&&m.props!==n&&m.update(n,c)});let g=n[nm],_=(0,I.useRef)(!!g&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return kc(()=>{p.current&&m&&(m.animationState?.animateChanges(),m.enteringChildren=void 0)},[]),kc(()=>{p.current=!0,m&&(window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),_.current&&m.animationState&&m.animationState.animateChanges())}),(0,I.useEffect)(()=>{m&&(!_.current&&m.animationState&&m.animationState.animateChanges(),_.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),m.enteringChildren=void 0)}),m}function ab(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t,f=e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:ob(e.parent));f.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&rb(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u});let p=f.getStack()?.lead;p&&!f.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}function ob(e){if(e)return e.options.allowProjection===!1?ob(e.parent):e.projection}function sb(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&ky(r);let a=n?n===`svg`:qy(e),o=a?$y:Qy;function s(n,s){let c,l=cb(n);Oc(()=>!!m_.current?.sharedNodes.get(l)?.lead&&n.initial)&&(n={...n,initial:!1});let u={...(0,I.useContext)(uy),...n,layoutId:l},{isStatic:d,isValidProp:f}=u,p=Ny(n),m=o(n,d);if(!d&&typeof window<`u`){lb(u,r);let t=ub(u);p.visualElement=ib(e,m,u,i,t.ProjectionNode,a),(t.isEnabled||p.visualElement?.projection?.options.layoutId)&&(c=t.MeasureLayout)}return(0,L.jsxs)(jy.Provider,{value:p,children:[c&&p.visualElement?(0,L.jsx)(c,{visualElement:p.visualElement,...u}):null,Jy(e,n,tb(m,p.visualElement,s),m,d,t,a,f)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,I.forwardRef)(s);return c[eb]=e,c}function cb({layoutId:e}){let t=(0,I.useContext)(Dc).id;return t&&e!==void 0?t+`-`+e:e}function lb(e,t){(0,I.useContext)(wy).strict}function ub(e){let{drag:t,layout:n}=Oy();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:r.MeasureLayout,isEnabled:t?.isEnabled(e)||n?.isEnabled(e),ProjectionNode:r.ProjectionNode}}function db(e,t){if(typeof Proxy>`u`)return sb;let n=/* @__PURE__ */ new Map,r=(n,r)=>sb(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,sb(a,void 0,e,t)),n.get(a))})}var fb=(e,t)=>t.isSVG??qy(e)?new ry(t):new R_(t,{allowProjection:e!==I.Fragment}),pb=class extends Qv{constructor(e){super(e),e.animationState||=sy(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();__(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},mb=0,hb={animation:{Feature:pb},exit:{Feature:class extends Qv{constructor(){super(...arguments),this.id=mb++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Kp(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id,this.node))}unmount(){}}}},gb=class extends Qv{constructor(e){super(e),this.removeGroupControls=zc,this.removeListeners=zc,this.controls=new Pv(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||zc}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},_b=e=>(t,n)=>{e&&Pu.update(()=>e(t,n),!1,!0)},vb=class extends Qv{constructor(){super(...arguments),this.removePointerDownListener=zc}onPointerDown(e){this.session=new ov(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:_b(e),onStart:_b(t),onMove:_b(n),onEnd:(e,t)=>{delete this.session,r&&Pu.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=H_(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},yb=!1,bb=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),xb=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},Sb=class extends I.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),yb&&i.root.didUpdate(),i.options.layoutId!==r&&xb(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...bb(this.props),onExitComplete:()=>this.safeToRemove()})),kg.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),xb(o,n)),o.setOptions({...o.options,...bb(this.props)}),yb=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Pu.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),Eh.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;yb=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Cb(e){let[t,n]=by(),r=(0,I.useContext)(Dc);return(0,L.jsx)(Sb,{...e,layoutGroup:r,switchLayoutGroup:(0,I.useContext)(nb),isPresent:t,safeToRemove:n})}var wb={pan:{Feature:vb},drag:{Feature:gb,ProjectionNode:h_,MeasureLayout:Cb}};function Tb(e,t,n,r){let{props:i}=e,a=`while`+n;e.animationState&&i[a]&&e.animationState.setActive(a,r===`Start`);let o=i[`on`+n+r];o&&Pu.postRender(()=>o(t,B_(t)))}var Eb=class extends Qv{mount(){let{current:e}=this.node;e&&(this.unmount=Uv(e,(e,t)=>(Tb(this.node,t,`Hover`,`Start`),e=>Tb(this.node,e,`Hover`,`End`))))}unmount(){}},Db=class extends Qv{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Bc(f_(this.node.current,`focus`,()=>this.onFocus()),f_(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Ob(e,t,n){e.current instanceof HTMLButtonElement&&e.current.disabled||Tb(e,t,`Tap`,n)}var kb=class extends Qv{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Zv(e,(e,t)=>(Ob(this.node,t,`Start`),(e,{success:t})=>Ob(this.node,e,t?``:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Ab=/* @__PURE__ */ new WeakMap,jb=/* @__PURE__ */ new WeakMap,Mb=e=>{let t=Ab.get(e.target);t&&t(e)},Nb=e=>{e.forEach(Mb)};function Pb({root:e,...t}){let n=e||document;jb.has(n)||jb.set(n,{});let r=jb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Nb,{root:e,...t})),r[i]}function Fb(e,t,n){let r=Pb(t);return Ab.set(e,n),r.observe(e),()=>{Ab.delete(e),r.unobserve(e)}}var Ib={some:0,all:1},Lb=class extends Qv{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Ib[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Fb(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Rb(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Rb({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var zb=/*@__PURE__*/ db(/* @__PURE__ */ Object.assign({},hb,{inView:{Feature:Lb},tap:{Feature:kb},focus:{Feature:Db},hover:{Feature:Eb}},wb,{layout:{ProjectionNode:h_,MeasureLayout:Cb}}),fb);function Bb(){!T_.current&&D_();let[e]=(0,I.useState)(w_.current);return e}function Vb(e){return typeof e==`object`&&!Array.isArray(e)}function Hb(e,t,n,r){return e==null?[]:typeof e==`string`&&Vb(t)?Am(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Ub(e,t,n){return e*(t+1)+n*t}function Wb(e,t){if(t.has(e))return t.get(e);let[,n,r]=e.match(/^(.+?)([+-][\d.]+)$/)||[];return t.has(n)?Math.max(0,t.get(n)+parseFloat(r)):void 0}function Gb(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):Wb(t,r)??e}function Kb(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(Mc(e,i),r--)}}function qb(e,t,n,r,i,a){Kb(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:pu(i,a,r[o]),easing:/* @__PURE__ */ cl(n,o)})}function Jb(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Yb(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Xb=`easeInOut`,Zb=20;function Qb(e,{defaultTransition:t={},...n}={},r,i,a){let o=t.duration||.3,s=/* @__PURE__ */ new Map,c=/* @__PURE__ */ new Map,l={},u=/* @__PURE__ */ new Map,d=0,f=0,p=0,m=(e,n)=>{let a=n,s=e=>typeof e==`number`?n+e:Gb(f,e,d,u);for(let n=0;n<e.length;n++){let h=e[n];if(typeof h==`string`){u.set(h,f);continue}if(!Array.isArray(h)){let e=h.at===void 0?f:s(h.at);`sequence`in h?(d=f=e,f=m(h.sequence,e),d=e,a=Math.max(a,f)):u.set(h.name,e);continue}let[g,_,v={}]=h;v.at!==void 0&&(f=s(v.at));let y=0,b=(e,n,r,a=0,s=0)=>{let c=tx(e),{delay:l=0,times:u=hd(c),type:d=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:g=0,..._}=n,{ease:v=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(a,s):l,S=c.length,C=If(d)?d:i?.[d||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&ix(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,..._};b!==void 0&&(n.duration=/* @__PURE__ */ Uc(b));let r=Vu(n,e,C);v=r.ease,b=r.duration}b??=o;let w=f+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&md(u,T),c.length===1&&c.unshift(null),m&&m<Zb){let e=b>0?g/b:0;b=Ub(b,m,g);let t=[...c],n=[...u];v=Array.isArray(v)?[...v]:[v];let r=[...v],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?/* @__PURE__ */ Xc(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),v.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),v.push(e===0?`linear`:/* @__PURE__ */ cl(f,e-1))}Jb(u,m,e)}let E=w+b;qb(r,c,v,u,w,E),y=Math.max(x+b,y),p=Math.max(E,p)};if($p(g)){let e=$b(g,c);b(_,v,ex(`default`,e))}else{let e=Hb(g,_,r,l),t=e.length;for(let n=0;n<t;n++){_=_,v=v;let r=e[n],i=$b(r,c);for(let e in _)b(_[e],nx(v,e),ex(e,i),n,t)}}d=f,f+=y,a=Math.max(a,f)}return a};return m(e,0),a&&(a.duration=p,a.labels=u),c.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Yb);let o=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];o.push(n),c.push(/* @__PURE__ */ Vc(0,p,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),o.unshift(o[0]),l.unshift(Xb)),c[c.length-1]!==1&&(c.push(1),o.push(null)),s.has(r)||s.set(r,{keyframes:{},transition:{}});let u=s.get(r);u.keyframes[i]=o;let{type:d,...f}=t;u.transition[i]={...f,duration:p,ease:l,times:c,...n}}}),s}function $b(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function ex(e,t){return t[e]||(t[e]=[]),t[e]}function tx(e){return Array.isArray(e)?e:[e]}function nx(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var rx=e=>typeof e==`number`,ix=e=>e.every(rx);function ax(e,t){return $p(e)||typeof e==`number`||typeof e==`string`&&!Vb(t)}function ox(e,t,n,r){let i=[];if(ax(e,t))i.push(Oh(e,Vb(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Hb(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...wh(r,t,s,g_.get(r))):i.push(...Cm(xm(r)??Th,r,t,s))}}return i}function sx(e,t,n,r){let i=[];return Qb(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Ap(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:ud},r).forEach(({keyframes:e,transition:t},n)=>{i.push(...ox(n,e,t))}),i}var cx=0;function lx(e,t){let n=[...e],r=typeof n[0]==`function`?Math.max(1,n.length-1):2;return n[r]={...n[r],at:t},n}var ux=(e,t)=>t===void 0?e:{name:e,at:t};function dx(e){e.pause(),e.time=0,e.stop()}var fx=class e{constructor(e=[],t={},n){this.options=t,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=/* @__PURE__ */ new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=t.autoplay===!1,this.newFinished(),e.forEach(e=>this.add(e)),n?(this.isDirty=!1,this.isWrapped=!0,this.group=new wp(n),this.watch()):(this.invalidate(),this.flush());let{scope:r}=t;r&&(r.animations.push(this),this.finished.then(()=>Mc(r.animations,this)))}add(t,n){return t instanceof e&&t.adopt(this),this.push({item:t,at:n})}call(e,t){return this.push({item:e,at:t,marker:{name:`_m`+cx++,time:0,callback:e}})}addPause(e,t){return this.push({item:t||{},at:e,marker:{name:`_m`+cx++,time:0,callback:t,pause:!0}})}move(e,t){return this.entries.forEach(n=>{n.item===e&&(n.at=t)}),this.invalidate()}remove(t){return t instanceof e&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(e){return this.flush(),this.labels.get(e)}seek(e){return this.time=this.resolve(e),this}playTo(e){let t=this.resolve(e),n=Math.abs(this.speed);return this.speed=t<this.time?-n:n,this.stopAt=t,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(e){this.time=e*this.duration}get time(){return this.active()?.time??0}set time(e){this.flush(),this.prevTime=e,this.group&&(this.group.time=e),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(e){this.playbackSpeed=e,this.group&&(this.group.speed=e)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??`idle`}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(e){return this.flush(),this.scrollTimeline=e,this.detachScroll=this.group?.attachTimeline(e),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(e,t){return this.finished.then(e,t)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(e){return this.entries.push(e),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&this.build()}adopt(e){this.group&&=(dx(this.group),void 0),this.isDirty=!1,this.parent=e}build(){this.isDirty=!1,this.isWrapped=!1;let e=this.group,t=0;e&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),e.cancel()):(t=e.animations.length?e.time:0,dx(e)),this.isRebuilding=!1);let{defaultTransition:n,onComplete:r,onUpdate:i,onRepeat:a,onReverseComplete:o,autoplay:s,scope:c,...l}=this.options,u={};c?.reduceMotion!==void 0&&(u.reduceMotion=c.reduceMotion),c?.skipAnimations!==void 0&&(u.skipAnimations=c.skipAnimations),Object.assign(u,l);let d=/* @__PURE__ */ new Map,f={},p=sx(this.toSequence(d),{defaultTransition:n,...u},c,f),m=f.labels,h=u.duration??f.duration,g=f.duration?h/f.duration:1;if(m.forEach((e,t)=>m.set(t,e*g)),this.markers=[],d.forEach((e,t)=>{e.time=m.get(t),m.delete(t),h=Math.max(h,e.time),this.markers.push(e)}),this.markers.sort((e,t)=>e.time-t.time),this.labels=m,this.totalDuration=h,this.clock=this.clockAnimation=void 0,this.markers.length||this.stopAt!==void 0||i||a){let e=this.clock=Ap(0);e.on(`change`,t=>e===this.clock&&this.onClock(t)),p.unshift(this.clockAnimation=Oh(e,[0,h],{...u,duration:h,ease:`linear`}))}let _=this.group=new wp(p);t=Math.min(t,h),this.isDone&&t<h&&this.newFinished(),this.scrollTimeline?this.detachScroll=_.attachTimeline(this.scrollTimeline):(_.speed=this.playbackSpeed,this.isPaused&&_.pause(),t&&(_.time=t)),this.repeatIndex=this.currentRepeat(),this.prevTime=t||-1,this.watch()}toSequence(t){return this.entries.map(({item:n,at:r,marker:i})=>i?(t.set(i.name,i),ux(i.name,r)):n instanceof e?{sequence:n.toSequence(t),at:r}:typeof n==`string`?ux(n,r):r===void 0?n:Array.isArray(n)?lx(n,r):{...n,at:r})}resolve(e){return this.flush(),typeof e==`number`?e:Wb(e,this.labels)??this.time}currentRepeat(){let{repeat:e=0,repeatDelay:t=0,delay:n=0}=this.options,r=this.totalDuration+t,i=(this.clockAnimation?.time??0)-n;return r&&i>0?Math.min(e,Math.floor(i/r)):0}onClock(e){let t=this.prevTime;if(this.prevTime=e,this.isRebuilding)return;let{onUpdate:n,onRepeat:r,repeatType:i=`loop`}=this.options;n?.(e);let a=this.currentRepeat();if(a!==this.repeatIndex&&(this.repeatIndex=a,r?.(),i===`loop`)){let e=this.speed>0;if(this.cross(t,e?this.totalDuration:0))return;t=e?-1:1/0}this.cross(t,e)}cross(e,t){if(e===t)return;let n=t>e,r=r=>n?r>e&&r<=t:r<e&&r>=t,i=n?this.markers:[...this.markers].reverse();for(let e of i)if(r(e.time)&&(e.callback?.(n?1:-1),e.pause))return this.pauseAt(e.time);if(this.stopAt!==void 0&&r(this.stopAt))return this.pauseAt(this.stopAt),this.stopAt=void 0,!0}pauseAt(e){return this.pause(),this.time=e,!0}watch(){let e=this.group;e.finished.then(()=>{if(e!==this.group||this.isDone)return;this.isDone=!0;let{onComplete:t,onReverseComplete:n}=this.options;(this.speed<0&&n||t)?.(),this.resolveFinished()})}newFinished(){this.isDone=!1,this.finished=new Promise(e=>{this.resolveFinished=e})}};function px(e){return Array.isArray(e)&&e.some(Array.isArray)}function mx(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=Dm.current,s=o?.transition,c={};n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r);let l;if(px(e)){let n={...c,...i,scope:t};s&&(n.defaultTransition={...s,...n.defaultTransition}),l=new fx(e,n)}else{let{onComplete:n,...r}=a||{},o={...c,...s,...r},{onUpdate:u}=r;l=new fx([typeof e==`number`||typeof e==`string`&&(typeof i==`string`||Array.isArray(i))?[u||(()=>{}),Array.isArray(i)?i:[e,i],{...o,onUpdate:void 0}]:[e,i,o]],{...c,onComplete:n,scope:t},ox(e,i,o,t))}return o&&l.finished.then(o.add(()=>l.stop())),l}return i}var hx=/* @__PURE__ */ Object.assign(/* @__PURE__ */ mx(),{addEffect:ym,removeEffect:bm}),gx=zb;function _x(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var vx=e=>{switch(e){case`success`:return xx;case`info`:return Cx;case`warning`:return Sx;case`error`:return wx;default:return null}},yx=Array(12).fill(0),bx=({visible:e,className:t})=>/*#__PURE__*/ I.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},/*#__PURE__*/ I.createElement(`div`,{className:`sonner-spinner`},yx.map((e,t)=>/*#__PURE__*/ I.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),xx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Sx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Cx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),wx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Tx=/*#__PURE__*/ I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},/*#__PURE__*/ I.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),/*#__PURE__*/ I.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Ex=()=>{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Dx=1,Ox=100,kx=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Dx++,Ax=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Ox;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=kx(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],I.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Mx(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=kx(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=/* @__PURE__ */ new Set,this.pendingDismissals=/* @__PURE__ */ new Map}},jx=(e,t)=>Ax.message(e,t),Mx=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Nx=Object.assign(jx,{success:Ax.success,info:Ax.info,warning:Ax.warning,error:Ax.error,custom:Ax.custom,message:Ax.message,promise:Ax.promise,dismiss:Ax.dismiss,loading:Ax.loading},{getHistory:()=>Ax.toasts,getToasts:()=>Ax.getActiveToasts()});_x(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Px(e){return e.label!==void 0}var Fx=3,Ix=`24px`,Lx=`16px`,Rx=4e3,zx=356,Bx=14,Vx=45,Hx=200;function Ux(...e){return e.filter(Boolean).join(` `)}function Wx(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Gx=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=I.useState(null),[O,k]=I.useState(null),[A,ee]=I.useState(!1),[te,j]=I.useState(!1),[M,ne]=I.useState(!1),[N,P]=I.useState(!1),[F,re]=I.useState(!1),[ie,ae]=I.useState(0),[oe,se]=I.useState(0),ce=I.useRef(n.duration||y||Rx),le=I.useRef(null),ue=I.useRef(null),de=c===0,L=c+1<=o,fe=n.type,R=fe??`default`,z=n.dismissible!==!1,pe=n.className||``,me=n.descriptionClassName||``,he=I.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ge=I.useMemo(()=>n.closeButton??p,[n.closeButton,p]),B=I.useMemo(()=>n.duration||y||Rx,[n.duration,y]),_e=I.useRef(0),ve=I.useRef(0),ye=I.useRef(0),V=I.useRef(null),[be,xe]=b.split(`-`),Se=I.useMemo(()=>s.reduce((e,t,n)=>n>=he?e:e+t.height,0),[s,he]),Ce=Ex(),we=I.useMemo(()=>e.swipeDirections??Wx(b),[e.swipeDirections,b]),Te=n.invert||t,Ee=fe===`loading`;ve.current=I.useMemo(()=>he*x+Se,[he,Se]),I.useEffect(()=>{ce.current=B},[B]),I.useEffect(()=>{ee(!0)},[]),I.useEffect(()=>{let e=ue.current;if(e){let t=e.getBoundingClientRect().height;return se(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),I.useLayoutEffect(()=>{if(!A)return;let e=ue.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,se(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=I.useCallback(()=>{j(!0),ae(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Hx)},[n,d,a,ve]);I.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ce?(()=>{if(ye.current<_e.current){let e=(/* @__PURE__ */ new Date()).getTime()-_e.current;ce.current-=e}ye.current=(/* @__PURE__ */ new Date()).getTime()})():ce.current!==1/0&&(_e.current=(/* @__PURE__ */ new Date()).getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},ce.current)),()=>clearTimeout(e)},[u,i,n,fe,Ce,De]),I.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?/*#__PURE__*/ I.createElement(`div`,{className:Ux(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":fe===`loading`},w.loading):/*#__PURE__*/ I.createElement(bx,{className:Ux(C?.loader,n?.classNames?.loader),visible:fe===`loading`})}let ke=n.icon||w?.[fe]||vx(fe);return/*#__PURE__*/ I.createElement(`li`,{tabIndex:0,ref:ue,className:Ux(_,pe,C?.toast,n?.classNames?.toast,C?.[R],n?.classNames?.[R]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":F,"data-removed":te,"data-visible":L,"data-y-position":be,"data-x-position":xe,"data-index":c,"data-front":de,"data-swiping":M,"data-dismissible":z,"data-type":fe,"data-invert":Te,"data-swipe-out":N,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${te?ie:ve.current}px`,"--initial-height":S?`auto`:`${oe}px`,...m,...n.style},onDragEnd:()=>{ne(!1),D(null),V.current=null},onPointerDown:e=>{e.button!==2&&!Ee&&z&&(le.current=/* @__PURE__ */ new Date,ae(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(ne(!0),V.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(N||!z)return;V.current=null;let e=Number(ue.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ue.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=(/* @__PURE__ */ new Date()).getTime()-le.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?we.includes(e>0?`right`:`left`):we.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Vx||a>.11))ae(ve.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),P(!0);else{var o,s;(o=ue.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ue.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),re(!1),ne(!1),D(null)}},onPointerMove:e=>{var t,n;if(!V.current||!z||window.getSelection()?.toString().length>0)return;let r=e.clientY-V.current.y,i=e.clientX-V.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(we.includes(`top`)||we.includes(`bottom`)){if(we.includes(`top`)&&r<0||we.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(we.includes(`left`)||we.includes(`right`))){if(we.includes(`left`)&&i<0||we.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&re(!0),(t=ue.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=ue.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ge&&!n.jsx&&fe!==`loading`?/*#__PURE__*/ I.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!z?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Ux(C?.closeButton,n?.classNames?.closeButton)},w?.close??Tx):null,(fe||n.icon||n.promise)&&n.icon!==null&&(w?.[fe]!==null||n.icon)?/*#__PURE__*/ I.createElement(`div`,{"data-icon":``,className:Ux(C?.icon,n?.classNames?.icon)},fe===`loading`?n.icon||Oe():n.promise?Oe():null,fe===`loading`?null:ke):null,/*#__PURE__*/ I.createElement(`div`,{"data-content":``,className:Ux(C?.content,n?.classNames?.content)},/*#__PURE__*/ I.createElement(`div`,{"data-title":``,className:Ux(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?/*#__PURE__*/ I.createElement(`div`,{"data-description":``,className:Ux(v,me,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),/*#__PURE__*/ I.isValidElement(n.cancel)?n.cancel:n.cancel&&Px(n.cancel)?/*#__PURE__*/ I.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Px(n.cancel)&&z&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:Ux(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,/*#__PURE__*/ I.isValidElement(n.action)?n.action:n.action&&Px(n.action)?/*#__PURE__*/ I.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Px(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:Ux(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Kx(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function qx(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Lx:Ix;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Jx=/*#__PURE__*/ I.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Fx,toastOptions:g,dir:_=Kx(),gap:v=Bx,icons:y,customAriaLabel:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=I.useState([]),w=I.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=I.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=I.useState([]),[O,k]=I.useState(!1),[A,ee]=I.useState(!1),[te,j]=I.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),M=I.useRef(null),ne=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),N=I.useRef(null),P=I.useRef(!1),F=I.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Ax.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return I.useEffect(()=>Ax.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Xt.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),I.useEffect(()=>{if(d!==`system`){j(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?j(`dark`):j(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{j(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{j(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),I.useEffect(()=>{S.length<=1&&k(!1)},[S]),I.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;k(!0),(t=M.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===M.current||M.current?.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),I.useEffect(()=>{if(M.current)return()=>{N.current&&(N.current.focus({preventScroll:!0}),N.current=null,P.current=!1)}},[M.current]),/*#__PURE__*/ I.createElement(`section`,{ref:t,"aria-label":b??`${x} ${ne}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?/*#__PURE__*/ I.createElement(`ol`,{key:t,dir:_===`auto`?Kx():_,tabIndex:-1,ref:M,className:c,"data-sonner-toaster":!0,"data-sonner-theme":te,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${zx}px`,"--gap":`${v}px`,...m,...qx(l,u)},onBlur:e=>{P.current&&!e.currentTarget.contains(e.relatedTarget)&&(P.current=!1,N.current&&=(N.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||P.current||(P.current=!0,N.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{A||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ee(!0)},onPointerUp:()=>ee(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>/*#__PURE__*/ I.createElement(Gx,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:A,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:F,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),Yx=/* @__PURE__ */ new Map([[`avif`,`image/avif`],[`bmp`,`image/bmp`],[`css`,`text/css`],[`csv`,`text/csv`],[`doc`,`application/msword`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`gif`,`image/gif`],[`gz`,`application/gzip`],[`htm`,`text/html`],[`html`,`text/html`],[`ico`,`image/x-icon`],[`jpeg`,`image/jpeg`],[`jpg`,`image/jpeg`],[`js`,`application/javascript`],[`json`,`application/json`],[`md`,`text/markdown`],[`mjs`,`application/javascript`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`ogg`,`audio/ogg`],[`pdf`,`application/pdf`],[`png`,`image/png`],[`ppt`,`application/powerpoint`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`svg`,`image/svg+xml`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`txt`,`text/plain`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`weba`,`audio/webm`],[`webm`,`video/webm`],[`webp`,`image/webp`],[`xls`,`application/vnd.ms-excel`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xml`,`application/xml`],[`zip`,`application/zip`]]),Xx=class extends Error{constructor(e){super(`DataTransferItem is not a file`),this.item=e,this.name=`UnexpectedObjectError`}};function Zx(e,t,n){let r=e,{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&$x(r,`path`,a),n!==void 0&&Object.defineProperty(r,"handle",{value:n,writable:!1,configurable:!1,enumerable:!0}),$x(r,`relativePath`,a),r}function Qx(e,t=Yx){let{name:n}=e;if(n&&n.lastIndexOf(`.`)!==-1&&!e.type){let r=n.split(`.`).pop().toLowerCase(),i=t.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function $x(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var eS=[`.DS_Store`,`Thumbs.db`];async function tS(e,{mimeTypes:t=Yx}={}){return(await nS(e)).map(e=>e instanceof File?Qx(e,t):e)}async function nS(e){return oS(e)&&rS(e.dataTransfer)?lS(e.dataTransfer,e.type):iS(e)?uS(e.clipboardData):aS(e)?sS(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?cS(e):[]}function rS(e){return oS(e)}function iS(e){return oS(e)&&rS(e.clipboardData)}function aS(e){return oS(e)&&oS(e.target)}function oS(e){return typeof e==`object`&&!!e}function sS(e){return fS(e.target.files).map(e=>Zx(e))}async function cS(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>Zx(e))}async function lS(e,t){let n=fS(e.items).filter(e=>e.kind===`file`);return t===`drop`?dS(mS(await Promise.all(n.map(pS)))):n}function uS(e){let t=fS(e.items).filter(e=>e.kind===`file`).map(e=>e.getAsFile()).filter(e=>e!==null);return dS((t.length>0?t:fS(e.files)).map(e=>Zx(e)))}function dS(e){return e.filter(e=>eS.indexOf(e.name)===-1)}function fS(e){return e===null?[]:Array.from(e)}async function pS(e){if(typeof e.webkitGetAsEntry!=`function`)return hS(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let n=await gS(e);return n?.kind===`directory`?_S(n,`/${n.name}`):yS(t)}return hS(e,t)}function mS(e){let t=[];for(let n of e)Array.isArray(n)?t.push(...mS(n)):t.push(n);return t}async function hS(e,t){let n=e.getAsFile(),r=await gS(e);if(r!=null){let e=n??await r.getFile();return e.handle=r,Zx(e)}if(!n)throw new Xx(e);return Zx(n,t?.fullPath??void 0)}async function gS(e){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`)return e.getAsFileSystemHandle()}async function _S(e,t){let n=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if(r.kind===`directory`)n.push(...await _S(r,e));else{let t=await r.getFile();n.push(Zx(t,e,r))}}return n}async function vS(e){return e.isDirectory?yS(e):bS(e)}function yS(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(vS));r.push(e),i()}else try{e(await Promise.all(r))}catch(e){n(e)}},e=>{n(e)})}i()})}async function bS(e){return new Promise((t,n)=>{e.file(n=>{t(Zx(n,e.fullPath))},e=>{n(e)})})}function xS(e,t){if(e&&t){let n=(Array.isArray(t)?t:t.split(`,`)).filter(e=>e.trim()!==``);if(n.length===0)return!0;let r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(e=>{let t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}var SS=typeof xS==`function`?xS:xS.default,CS=`file-invalid-type`,wS=`file-too-large`,TS=`file-too-small`,ES=`too-many-files`;function DS(e=``){let t=e.split(`,`);return{code:CS,message:`File type must be ${t.length>1?`one of ${t.join(`, `)}`:t[0]}`}}var OS=[`KB`,`MB`,`GB`,`TB`,`PB`];function kS(e){if(e<1024)return`${e} ${e===1?`byte`:`bytes`}`;let t=e/1024,n=0;for(;t>=1024&&n<OS.length-1;)t/=1024,n++;return`${Number(t.toFixed(2))} ${OS[n]}`}function AS(e){return{code:wS,message:`File is larger than ${kS(e)}`}}function jS(e){return{code:TS,message:`File is smaller than ${kS(e)}`}}var MS={code:ES,message:`Too many files`};function NS(e){return e.type===``&&typeof e.getAsFile==`function`}function PS(e,t){let n=e.type===`application/x-moz-file`||SS(e,t??``)||NS(e);return[n,n?null:DS(t)]}function FS(e,t,n){if(IS(e.size)){if(IS(t)&&IS(n)){if(e.size>n)return[!1,AS(n)];if(e.size<t)return[!1,jS(t)]}else if(IS(t)&&e.size<t)return[!1,jS(t)];else if(IS(n)&&e.size>n)return[!1,AS(n)]}return[!0,null]}function IS(e){return e!=null}function LS(e){return e!=null&&typeof e.then==`function`}function RS({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:a=0,validator:o,getErrorMessage:s}){let c=[],l=[],u=(e,t)=>s&&typeof File<`u`&&t instanceof File?{...e,message:s(e,t)}:e;e.forEach(e=>{let[i,a]=PS(e,t),[o,s]=FS(e,n,r);i&&o?c.push(e):l.push({file:e,errors:[a,s].filter(e=>e!=null).map(t=>u(t,e))})});let d=i?a>=1?a:1/0:1;return c.length>d&&c.slice(d).forEach(e=>{l.push({file:e,errors:[u(MS,e)]})}),l.length>0?{verdict:`reject`,rejections:l}:{verdict:o?`unknown`:`accept`,rejections:l}}function zS(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble!==void 0&&e.cancelBubble}function BS(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>e===`Files`||e===`application/x-moz-file`)||Array.prototype.some.call(t.items??[],VS):!!e.target&&!!e.target.files}function VS(e){return typeof e==`object`&&!!e&&e.kind===`file`}function HS(e){e.preventDefault()}function US(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function WS(e){return e.indexOf(`Edge/`)!==-1}function GS(e=window.navigator.userAgent){return US(e)||WS(e)}function KS(...e){return(t,...n)=>e.some(e=>(!zS(t)&&e&&e(t,...n),zS(t)))}function qS(){return`showOpenFilePicker`in window}function JS(e){return Array.isArray(e)?e:typeof e==`string`?[e]:[]}function YS(e){if(IS(e))return Array.isArray(e)?e.filter(e=>IS(e)&&IS(e.accept)):[{accept:e}]}function XS(e){let t=[],n=Object.keys(e);for(let n of Object.values(e))for(let e of JS(n))t.includes(e)||t.push(e);return t.length>0?t.join(`, `):n.length>0?n.join(`, `):`Files`}function ZS(e){let t=YS(e);if(!IS(t))return;let n={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=n[t]??(n[t]=[]);for(let t of JS(r))e.includes(t)||e.push(t)}return n}function QS(e){let t=YS(e);if(!IS(t))return;let n=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let n=!0;return rC(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),n=!1),(Array.isArray(t)||typeof t==`string`)&&JS(t).every(aC)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),n=!1),n}).reduce((e,[t,n])=>(e[t]=JS(n),e),{});return{description:IS(e.description)&&e.description!==``?e.description:XS(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return n.length>0?n:void 0}function $S(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(IS(e))return Object.entries(e).reduce((e,[n,r])=>{let i=JS(r);return t&&iC(n)&&i.some(aC)?e.push(...i):e.push(n,...i),e},[]).filter(e=>rC(e)||aC(e)).join(`,`)}function eC(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function tC(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function nC(e){return e instanceof DOMException&&e.name===`NotAllowedError`}function rC(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function iC(e){return e.endsWith(`/*`)}function aC(e){return/^.*\.[\w]+$/.test(e)}var oC=(0,I.forwardRef)(({children:e,...t},n)=>{let{open:r,...i}=cC(t);return(0,I.useImperativeHandle)(n,()=>({open:r}),[r]),/* @__PURE__ */ (0,L.jsx)(L.Fragment,{children:e?.({...i,open:r})})});oC.displayName=`Dropzone`;var sC={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function cC(e={}){let{accept:t,disabled:n=!1,getFilesFromEvent:r=tS,maxSize:i=1/0,minSize:a=0,multiple:o=!0,maxFiles:s=0,onDragEnter:c,onDragLeave:l,onDragOver:u,onDrop:d,onDropAccepted:f,onDropRejected:p,onFileDialogCancel:m,onFileDialogOpen:h,useFsAccessApi:g=!1,autoFocus:_=!1,preventDropOnDocument:v=!0,noClick:y=!1,noKeyboard:b=!1,noDrag:x=!1,noDragEventsBubbling:S=!1,noPaste:C=!1,onError:w,validator:T,getErrorMessage:E}=e,D=(0,I.useMemo)(()=>ZS(t),[t]),O=(0,I.useMemo)(()=>$S(D),[D]),k=(0,I.useMemo)(()=>$S(D,{omitWildcardMimeTypesWithExtensions:!0}),[D]),A=(0,I.useMemo)(()=>QS(t),[t]),ee=(0,I.useMemo)(()=>typeof h==`function`?h:uC,[h]),te=(0,I.useMemo)(()=>typeof m==`function`?m:uC,[m]),j=(0,I.useRef)(null),M=(0,I.useRef)(null),[ne,N]=(0,I.useReducer)(lC,sC),{isFocused:P,isFileDialogActive:F}=ne,re=(0,I.useRef)(F);re.current=F;let ie=(0,I.useRef)(null),ae=(0,I.useCallback)(()=>{ie.current?.abort();let e=new AbortController;return ie.current=e,N({type:`setProcessing`,isProcessing:!0}),e.signal},[]),oe=(0,I.useCallback)(e=>{e.aborted||N({type:`setProcessing`,isProcessing:!1})},[]);(0,I.useEffect)(()=>()=>ie.current?.abort(),[]);let se=(0,I.useRef)(typeof window<`u`&&window.isSecureContext&&g&&qS()),ce=()=>{!se.current&&F&&setTimeout(()=>{if(M.current){let{files:e}=M.current;e?.length||(N({type:`closeDialog`}),te())}},300)};(0,I.useEffect)(()=>(window.addEventListener(`focus`,ce,!1),()=>{window.removeEventListener(`focus`,ce,!1)}),[M,F,te,se]);let le=(0,I.useRef)([]),ue=(0,I.useRef)([]),de=e=>{j.current&&e.target&&j.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),le.current=[])};(0,I.useEffect)(()=>(v&&(document.addEventListener(`dragover`,HS,!1),document.addEventListener(`drop`,de,!1)),()=>{v&&(document.removeEventListener(`dragover`,HS),document.removeEventListener(`drop`,de))}),[j,v]),(0,I.useEffect)(()=>{let e=e=>{e.target&&(ue.current=[...ue.current,e.target]),BS(e)&&N({isDragGlobal:!0,type:`setDragGlobal`})},t=e=>{ue.current=ue.current.filter(t=>t!==e.target&&t!==null),!(ue.current.length>0)&&N({isDragGlobal:!1,type:`setDragGlobal`})},n=()=>{ue.current=[],N({isDragGlobal:!1,type:`setDragGlobal`})},r=()=>{ue.current=[],N({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),()=>{document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[j]),(0,I.useEffect)(()=>(!n&&_&&j.current&&j.current.focus(),()=>{}),[j,_,n]);let L=(0,I.useCallback)(e=>{w?w(e):console.error(e)},[w]),fe=(0,I.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e),!re.current&&(le.current=[...le.current,e.target],BS(e)&&Promise.resolve(r(e)).then(t=>{if(zS(e)&&!S)return;let n=t.length>0?RS({files:t,accept:O,minSize:a,maxSize:i,multiple:o,maxFiles:s,validator:T,getErrorMessage:E}):null;N({isDragAccept:n?.verdict===`accept`,isDragReject:n?.verdict===`reject`,isDragUnknown:n?.verdict===`unknown`,isDragActive:!0,dragFileRejections:n?.rejections??[],type:`setDraggedFiles`}),c&&c(e)}).catch(e=>L(e)))},[r,c,L,S,O,a,i,o,s,T,E]),R=(0,I.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),re.current)return!1;let t=BS(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&u&&u(e),!1},[u,S]),z=(0,I.useCallback)(e=>{e.preventDefault(),e.persist?.(),Ce(e);let t=le.current.filter(e=>j.current?.contains(e)),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),le.current=t,!(t.length>0)&&(N({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),BS(e)&&l&&l(e))},[j,l,S]),pe=(0,I.useCallback)(async(e,t,n)=>{let r=(e,t)=>E?{...e,message:E(e,t)}:e,c=e=>{let n=[],i=[];e.forEach(({file:e,accepted:t,acceptError:a,sizeMatch:o,sizeError:s,customErrors:c})=>{let l=!c||Array.isArray(c)&&c.length===0;if(t&&o&&l)n.push(e);else{let t=[a,s];c&&(t=t.concat(c)),i.push({file:e,errors:t.filter(e=>e!=null).map(t=>r(t,e))})}});let a=o?s>=1?s:1/0:1;n.length>a&&n.splice(a).forEach(e=>{i.push({file:e,errors:[r(MS,e)]})}),N({acceptedFiles:n,fileRejections:i,type:`setFiles`}),d&&d(n,i,t),i.length>0&&p&&p(i,t),n.length>0&&f&&f(n,t)},l=e.map(e=>{let[t,n]=PS(e,k),[r,o]=FS(e,a,i);return{file:e,accepted:t,acceptError:n,sizeMatch:r,sizeError:o,customErrors:T?T(e):null}});if(!l.some(({customErrors:e})=>LS(e))){c(l);return}let u;try{u=await Promise.all(l.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){n.aborted||(oe(n),L(e));return}n.aborted||c(u)},[N,o,k,a,i,s,d,f,p,T,E,L,oe]),me=(0,I.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),Ce(e),le.current=[],!(re.current&&e.dataTransfer)&&(N({type:`reset`}),BS(e))){let t=ae();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(zS(e)&&!S)oe(t);else return pe(n,e,t)}}).catch(e=>{t.aborted||(oe(t),L(e))})}},[r,pe,L,S,ae,oe]),he=(0,I.useCallback)(e=>{if(!BS(e))return;e.preventDefault(),e.persist?.(),Ce(e);let t=ae();Promise.resolve(r(e)).then(n=>{if(!t.aborted){if(zS(e)&&!S)oe(t);else return pe(n,e,t)}}).catch(e=>{t.aborted||(oe(t),L(e))})},[r,pe,L,S,ae,oe]),ge=(0,I.useCallback)(()=>{if(se.current){N({type:`openDialog`}),ee();let e={multiple:o,types:A},t;window.showOpenFilePicker(e).then(e=>(t=ae(),r(e))).then(e=>{if(N({type:`closeDialog`}),!t.aborted)return pe(e,null,t)}).catch(e=>{t&&oe(t),eC(e)?(te(e),N({type:`closeDialog`})):tC(e)||nC(e)?(se.current=!1,M.current?(M.current.value=``,M.current.click()):L(/* @__PURE__ */ Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):L(e)})}else M.current&&(N({type:`openDialog`}),ee(),M.current.value=``,M.current.click())},[N,ee,te,g,pe,L,A,o,ae,oe]),B=(0,I.useCallback)(e=>{j.current?.isEqualNode(e.target)&&(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),ge())},[j,ge]),_e=(0,I.useCallback)(()=>{N({type:`focus`})},[]),ve=(0,I.useCallback)(()=>{N({type:`blur`})},[]),ye=(0,I.useCallback)(()=>{y||(GS()?setTimeout(ge,0):ge())},[y,ge]),V=e=>n?null:e,be=e=>b?null:V(e),xe=e=>x?null:V(e),Se=e=>C?null:V(e),Ce=e=>{S&&e.stopPropagation()},we=(0,I.useMemo)(()=>({refKey:e=`ref`,role:t,onKeyDown:r,onFocus:i,onBlur:a,onClick:o,onDragEnter:s,onDragOver:c,onDragLeave:l,onDrop:u,onPaste:d,...f}={})=>({onKeyDown:be(KS(r,B)),onFocus:be(KS(i,_e)),onBlur:be(KS(a,ve)),onClick:V(KS(o,ye)),onDragEnter:xe(KS(s,fe)),onDragOver:xe(KS(c,R)),onDragLeave:xe(KS(l,z)),onDrop:xe(KS(u,me)),onPaste:Se(KS(d,he)),role:typeof t==`string`&&t!==``?t:`presentation`,[e]:j,...!n&&!b?{tabIndex:0}:{},...n?{"aria-disabled":!0}:{},...f}),[j,B,_e,ve,ye,fe,R,z,me,he,b,x,C,n]),Te=(0,I.useCallback)(e=>{e.stopPropagation()},[]),Ee=(0,I.useMemo)(()=>({refKey:e=`ref`,onChange:t,onClick:n,...r}={})=>({accept:k,multiple:o,type:`file`,"aria-label":`file upload`,style:{border:0,display:`block`,height:0,margin:0,maxWidth:0,opacity:0,overflow:`hidden`,padding:0,width:0},onChange:V(KS(t,me)),onClick:V(KS(n,Te)),tabIndex:-1,[e]:M,...r}),[M,t,o,me,n]);return{...ne,isFocused:P&&!n,getRootProps:we,getInputProps:Ee,rootRef:j,inputRef:M,open:V(ge)}}function lC(e,t){switch(t.type){case`focus`:return{...e,isFocused:!0};case`blur`:return{...e,isFocused:!1};case`openDialog`:return{...sC,isFileDialogActive:!0};case`closeDialog`:return{...e,isFileDialogActive:!1};case`setDraggedFiles`:return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case`setProcessing`:return{...e,isProcessing:t.isProcessing};case`setFiles`:return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case`setDragGlobal`:return{...e,isDragGlobal:t.isDragGlobal};case`reset`:return{...sC};default:return e}}function uC(){}var dC={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};dC.node;var fC=A(dC),pC={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};pC.node;var mC=A(pC),hC={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};hC.node;var gC=A(hC),_C={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};_C.node;var vC=A(_C),yC={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};yC.node;var bC=A(yC),xC={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};xC.node;var SC=A(xC),CC={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};CC.node;var wC=A(CC),TC={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};TC.node;var EC=A(TC),DC={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};DC.node;var OC=A(DC),kC={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};kC.node;var AC=A(kC),jC={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};jC.node;var MC=A(jC),NC={name:`file-code-corner`,size:24,node:[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]],aliases:[`file-code-2`]};NC.node;var PC=A(NC),FC={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};FC.node;var IC=A(FC),LC={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};LC.node;var RC=A(LC),zC={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};zC.node;var BC=A(zC),VC={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};VC.node;var HC=A(VC),UC={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};UC.node;var WC=A(UC),GC={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};GC.node;var KC=A(GC),qC={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};qC.node;var JC=A(qC),YC={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};YC.node;var XC=A(YC),ZC={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};ZC.node;var QC=A(ZC),$C={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};$C.node;var ew=A($C),tw={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};tw.node;var nw=A(tw),rw={name:`ruler`,size:24,node:[[`path`,{d:`M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z`,key:`icamh8`}],[`path`,{d:`m14.5 12.5 2-2`,key:`inckbg`}],[`path`,{d:`m11.5 9.5 2-2`,key:`fmmyf7`}],[`path`,{d:`m8.5 6.5 2-2`,key:`vc6u1g`}],[`path`,{d:`m17.5 15.5 2-2`,key:`wo5hmg`}]]};rw.node;var iw=A(rw),aw={name:`scan`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]};aw.node;var ow=A(aw),sw={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};sw.node;var cw=A(sw),lw={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};lw.node;var uw=A(lw),dw={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};dw.node;var fw=A(dw),pw={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};pw.node;var mw=A(pw),hw={primary:`bg-ink text-ink-contrast hover:opacity-90 disabled:opacity-40`,secondary:`bg-panel text-ink border border-rule hover:border-muted disabled:opacity-50`,ghost:`text-ink hover:bg-raise disabled:opacity-40`},gw={md:`h-9 px-3.5 gap-2 text-[14px]`,lg:`h-11 px-5 gap-2.5 text-[15px]`,icon:`size-9 justify-center`};function _w({variant:e=`secondary`,size:t=`md`,className:n,...r}){return/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,className:k(`inline-flex shrink-0 items-center rounded-lg font-medium transition-[opacity,border-color,background-color]`,hw[e],gw[t],n),...r})}var vw=`__empty`;function yw({value:e,onChange:t,options:n,label:r,className:i}){return/* @__PURE__ */ (0,L.jsx)(gc,{type:`single`,"aria-label":r,value:e===``?vw:String(e),onValueChange:e=>{e&&t(e===vw?``:e)},className:k(`grid auto-cols-fr grid-flow-col rounded-lg bg-raise p-0.5`,i),children:n.map(e=>/* @__PURE__ */ (0,L.jsx)(Tc,{value:e.value===``?vw:String(e.value),className:`num h-8 rounded-md px-2 text-[13px] text-muted transition-colors hover:text-ink data-[state=on]:bg-panel data-[state=on]:text-ink data-[state=on]:shadow-[0_1px_2px_rgb(0_0_0/0.08)]`,children:e.label},e.value))})}function bw({health:e}){let{data:t,isLoading:n,isError:r}=e,[i,a]=n?[`bg-muted`,`Checking server`]:r?[`bg-danger`,`Server unreachable`]:t.slicer?[`bg-ok`,`Slicer ready`]:[`bg-warn`,`Slicing is off on this server`];return/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`hidden items-center gap-2 rounded-full border border-rule px-3 py-1 text-[13px] text-muted sm:inline-flex`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`size-2 rounded-full`,i),"aria-hidden":!0}),a]})}function xw({apiKey:e,onSave:t,needed:n}){let[r,a]=(0,I.useState)(!1),[o,s]=(0,I.useState)(e),{portal:c}=i();return/* @__PURE__ */ (0,L.jsxs)(Xa,{open:r,onOpenChange:t=>{a(t),t&&s(e)},children:[/* @__PURE__ */ (0,L.jsx)(M,{label:`API key`,children:/* @__PURE__ */ (0,L.jsx)(Qa,{asChild:!0,children:/* @__PURE__ */ (0,L.jsxs)(_w,{variant:`ghost`,size:`icon`,"aria-label":`API key`,className:`relative`,children:[/* @__PURE__ */ (0,L.jsx)(BC,{className:`size-[18px]`,"aria-hidden":!0}),n&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`absolute top-1.5 right-1.5 size-2 rounded-full bg-danger`,"aria-hidden":!0})]})})}),/* @__PURE__ */ (0,L.jsx)(no,{container:c,children:/* @__PURE__ */ (0,L.jsx)(io,{align:`end`,sideOffset:8,className:`z-50 w-72 rounded-xl border border-rule bg-panel p-4 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,L.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),t(o.trim()),a(!1)},children:[/* @__PURE__ */ (0,L.jsx)(`label`,{className:`block text-[14px] font-medium`,htmlFor:`api-key`,children:`API key`}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1 mb-3 text-[13px] text-muted`,children:n?`This server needs a key before it lists printers or slices.`:`Only needed when the server asks for one. Kept in this browser.`}),/* @__PURE__ */ (0,L.jsx)(`input`,{id:`api-key`,type:`password`,autoComplete:`off`,value:o,onChange:e=>s(e.target.value),className:`h-10 w-full rounded-lg border border-rule bg-raise px-3 text-[14px] outline-none focus:border-muted`}),/* @__PURE__ */ (0,L.jsx)(_w,{type:`submit`,variant:`primary`,className:`mt-3 w-full justify-center`,children:`Save key`})]})})})]})}var Sw={system:[JC,`Theme: system`],light:[uw,`Theme: light`],dark:[XC,`Theme: dark`]},Cw={system:`light`,light:`dark`,dark:`system`};function ww({mode:e,onMode:t,health:n,onOpenGcode:r,apiKey:i,onSaveKey:a,keyNeeded:o,theme:s,onTheme:c}){let l=e===`advanced`,[u,d]=Sw[s];return/* @__PURE__ */ (0,L.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-3 border-b border-rule bg-panel px-4`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[/* @__PURE__ */ (0,L.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:`size-6`,"aria-hidden":!0,children:[/* @__PURE__ */ (0,L.jsx)(`rect`,{x:`3`,y:`15`,width:`18`,height:`4`,rx:`1.2`,fill:`currentColor`}),/* @__PURE__ */ (0,L.jsx)(`rect`,{x:`5`,y:`10`,width:`14`,height:`4`,rx:`1.2`,fill:`currentColor`,opacity:`0.65`}),/* @__PURE__ */ (0,L.jsx)(`rect`,{x:`7`,y:`5`,width:`10`,height:`4`,rx:`1.2`,fill:`currentColor`,opacity:`0.35`})]}),/* @__PURE__ */ (0,L.jsx)(`h1`,{className:`display sr-only text-[17px] font-semibold whitespace-nowrap sm:not-sr-only`,children:`Print Preview`})]}),l&&/* @__PURE__ */ (0,L.jsx)(bw,{health:n}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[/* @__PURE__ */ (0,L.jsx)(yw,{label:`Mode`,value:e,onChange:t,className:`mr-1 w-[168px] sm:w-[188px]`,options:[{value:`simple`,label:`Simple`},{value:`advanced`,label:`Advanced`}]}),l&&/* @__PURE__ */ (0,L.jsxs)(_w,{variant:`ghost`,onClick:r,children:[/* @__PURE__ */ (0,L.jsx)(PC,{className:`size-[18px]`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`hidden sm:inline`,children:`Open G-code`})]}),(l||o)&&/* @__PURE__ */ (0,L.jsx)(xw,{apiKey:i,onSave:a,needed:o}),c&&/* @__PURE__ */ (0,L.jsx)(M,{label:d,children:/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,size:`icon`,"aria-label":d,onClick:()=>c(Cw[s]),children:/* @__PURE__ */ (0,L.jsx)(u,{className:`size-[18px]`,"aria-hidden":!0})})})]})]})}function Tw({pick:e,onPick:t,onClose:n}){let{portal:r}=i(),a=(0,I.useMemo)(()=>e?e.plates.map(e=>e.thumbnail?URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`})):null):[],[e]);return(0,I.useEffect)(()=>()=>a.forEach(e=>e&&URL.revokeObjectURL(e)),[a]),/* @__PURE__ */ (0,L.jsx)(Ar,{open:!!e,onOpenChange:e=>{e||n()},children:/* @__PURE__ */ (0,L.jsxs)(Pr,{container:r,children:[/* @__PURE__ */ (0,L.jsx)(Ir,{className:`fixed inset-0 z-50 bg-black/40`}),/* @__PURE__ */ (0,L.jsxs)(Br,{className:`fixed top-1/2 left-1/2 z-50 w-[min(560px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-5 shadow-[0_24px_64px_-24px_rgb(0_0_0/0.5)]`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{children:[/* @__PURE__ */ (0,L.jsx)(Wr,{className:`text-[16px] font-semibold`,children:`Which plate?`}),/* @__PURE__ */ (0,L.jsx)(Gr,{className:`mt-1 text-[13px] text-muted`,children:e&&`${e.file.name} has ${e.plates.length} sliced plates. Open one; you can come back for the others.`})]}),/* @__PURE__ */ (0,L.jsx)(qr,{className:`grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,"aria-label":`Close`,children:/* @__PURE__ */ (0,L.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,L.jsx)(`div`,{className:`mt-4 grid grid-cols-2 gap-3 @sm:grid-cols-3`,children:e&&e.plates.map((e,n)=>/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e.plate),className:`overflow-hidden rounded-xl border border-rule bg-raise text-left transition-colors hover:border-ink`,children:[a[n]?/* @__PURE__ */ (0,L.jsx)(`img`,{src:a[n],alt:``,className:`aspect-square w-full bg-viewer object-contain`}):/* @__PURE__ */ (0,L.jsx)(`div`,{className:`aspect-square w-full bg-viewer`}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num block px-3 py-2 text-[13px] font-medium`,children:[`Plate `,e.plate]})]},e.plate))})})]})]})})}function Ew({show:e,text:t}){return/* @__PURE__ */ (0,L.jsx)(Cy,{children:e&&/* @__PURE__ */ (0,L.jsx)(gx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`pointer-events-none fixed inset-0 z-50 grid place-items-center bg-bench/80 backdrop-blur-sm`,children:/* @__PURE__ */ (0,L.jsx)(`p`,{className:`rounded-2xl border-2 border-dashed border-ink px-8 py-6 font-display text-[18px] font-semibold`,children:t})})})}function Dw({n:e,title:t,done:n,aside:r,children:i}){return/* @__PURE__ */ (0,L.jsxs)(`section`,{className:`border-b border-rule px-5 py-5 last:border-b-0`,children:[/* @__PURE__ */ (0,L.jsxs)(`header`,{className:`mb-3.5 flex items-center gap-2.5`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`num grid size-6 shrink-0 place-items-center rounded-full text-[12px] font-semibold transition-colors`,n?`bg-ink text-ink-contrast`:`border border-rule text-muted`),"aria-hidden":!0,children:n?/* @__PURE__ */ (0,L.jsx)(fC,{className:`size-3.5`,strokeWidth:3}):e}),/* @__PURE__ */ (0,L.jsx)(`h2`,{className:`text-[15px] font-semibold`,children:t}),r&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`ml-auto truncate text-[13px] text-muted`,children:r})]}),i]})}function Ow({label:e,hint:t,children:n}){return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`text-[13px] font-medium`,children:e}),t&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num text-[13px] text-muted`,children:t})]}),n]})}var kw=e=>e>1e6?`${(e/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1e3))} kB`;function Aw({rows:e,selected:t,onSelect:n,onRemove:r,onAdd:i,max:a}){let o=e.length>=a;return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-2`,children:[/* @__PURE__ */ (0,L.jsx)(`ul`,{className:`space-y-1.5`,children:e.map(({item:e,status:i,aside:a,warn:o})=>{let s=e.id===t;return/* @__PURE__ */ (0,L.jsxs)(`li`,{className:k(`flex items-center gap-1 rounded-xl border bg-raise pr-1.5 transition-colors`,s?`border-ink`:`border-rule`),children:[/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,"aria-current":s||void 0,onClick:()=>n(e.id),className:`flex min-w-0 flex-1 items-center gap-3 rounded-xl py-2.5 pl-3 text-left`,children:[/* @__PURE__ */ (0,L.jsx)(_,{className:k(`size-5 shrink-0`,s?`text-ink`:`text-muted`),"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:e.file.name,children:e.file.name}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`block truncate text-[12px]`,o?`text-warn`:`text-muted`),title:i,children:i})]}),a&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num shrink-0 pl-1 text-[13px] font-semibold`,children:a})]}),/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,size:`icon`,className:`size-8`,"aria-label":`Remove ${e.file.name}`,onClick:()=>r(e.id),children:/* @__PURE__ */ (0,L.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})]},e.id)})}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[/* @__PURE__ */ (0,L.jsxs)(_w,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,disabled:o,onClick:i,children:[/* @__PURE__ */ (0,L.jsx)(QC,{className:`size-4`,"aria-hidden":!0}),` Add files`]}),o&&/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`text-[12px] text-muted`,children:[`Up to `,a,` files in one estimate`]})]})]})}var jw=[{id:`PLA`,hint:`Everyday parts, easiest to print`},{id:`PETG`,hint:`Tougher, handles water and some heat`},{id:`ABS`,hint:`Heat-resistant, best in an enclosed printer`},{id:`TPU`,hint:`Flexible, rubber-like`}],Mw=[`PLA`,`PETG`,`ABS`],Nw=[{id:`standard`,label:`Standard`,mm:.2},{id:`medium`,label:`Fine`,mm:.15},{id:`high`,label:`Extra fine`,mm:.1}],Pw=[1,2,3,4,5,6],Fw={printer:``,material:`PLA`,quality:`standard`,infill:15,walls:3};function Iw(e){let t=e||Mw;return jw.filter(e=>t.includes(e.id))}function Lw(e){return{printer:e.printer,material:e.material,process:``,filament:``,quality:e.quality,infill:e.infill,walls:e.walls,supports:e.supports?`true`:`false`,mode:e.mode,gcode:!1}}var Rw=(e,t)=>e===`exact`||e===`estimate`?e:t===!1?`estimate`:`exact`;function zw(e){return/\b(P1S|X1|X1 Carbon|X1E|H2D|H2S|P2S)\b/.test(e)?!0:!/\b(A1|A1 mini|P1P)\b/.test(e)&&null}function Bw(e,t){return e===`ABS`&&zw(t)===!1?`ABS can warp on an open-frame printer like ours; PETG is often a better choice.`:null}var Vw=e=>e.replace(/\s+[\d.]+\s*nozzle$/i,``);function Hw(e){return e?e.printers.map(t=>({value:`printer:`+t,label:t,...t===e.defaultPrinter?{hint:`default`}:{}})):[]}function Uw(e){let t=Math.round(e/60),n=Math.floor(t/60),r=t%60;return n?r?`${n} h ${r} min`:`${n} h`:r?`${r} min`:`under a minute`}var Ww=e=>Math.round(e*100)/100,Gw=(e,t)=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t,maximumFractionDigits:2}).format(e);function Kw(e,t){return e==null?null:t?{low:Math.floor(Ww(e)),high:Math.ceil(Ww(e*(100+t)/100))}:{low:e,high:e}}function qw(e,t){if(!t)return{low:e,high:e};let n=Kw(e/60,t);return{low:n.low*60,high:n.high*60}}function Jw(e,t){if(e.low===e.high)return Gw(e.low,t);let n=e=>new Intl.NumberFormat(void 0,{style:`currency`,currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e);return`${n(e.low)} – ${n(e.high)}`}var Yw=e=>e.low===e.high?`${e.low} g`:`${e.low} – ${e.high} g`;function Xw(e){return e.low===e.high?Uw(e.low):e.high<3600?`${e.low/60} – ${e.high/60} min`:`${Uw(e.low)} – ${Uw(e.high)}`}function Zw(e,t,n,r){let i=Ww(e.weightG*t),a=e.seconds*t,o=r&&r.perGram[n],s=o==null?null:Ww(i*o),c=r&&r.range;return{grams:i,seconds:a,cost:s,currency:r?r.currency:null,range:Kw(s,c),gramsRange:Kw(i,c),secondsRange:qw(a,c)}}function Qw(e,t){let n=e.map(e=>Zw(e.stats,e.copies,e.material,t)),r=[...new Set(e.filter((e,t)=>n[t].cost==null).map(e=>e.material))],i=e=>Ww(n.reduce((t,n)=>t+e(n),0)),a=e=>({low:i(t=>t[e].low),high:i(t=>t[e].high)});return{grams:i(e=>e.grams),seconds:n.reduce((e,t)=>e+t.seconds,0),currency:t?t.currency:null,unpriced:r,cost:r.length?null:i(e=>e.cost),range:r.length?null:a(`range`),gramsRange:a(`gramsRange`),secondsRange:a(`secondsRange`)}}var $w={"model/stl":[`.stl`],"model/3mf":[`.3mf`],"model/obj":[`.obj`],"model/step":[`.step`,`.stp`],"model/iges":[`.iges`,`.igs`]},eT=[{axis:0,label:`Tip forward`,tip:`Tip it toward you, a quarter turn`},{axis:1,label:`Tip sideways`,tip:`Tip it onto its side, a quarter turn`},{axis:2,label:`Spin`,tip:`Spin it on the plate, a quarter turn`}];function tT({rot:e,onRotate:t}){let n=n=>t(e.map((e,t)=>t===n?(e+90)%360:e)),r=e.some(Boolean);return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-2.5 flex flex-wrap items-center gap-1.5`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`mr-1 text-[13px] text-muted`,children:`Turn`}),eT.map(e=>/* @__PURE__ */ (0,L.jsx)(M,{label:e.tip,children:/* @__PURE__ */ (0,L.jsx)(_w,{className:`h-8 px-2.5 text-[13px]`,onClick:()=>n(e.axis),children:e.label})},e.axis)),r&&/* @__PURE__ */ (0,L.jsx)(M,{label:`Back to how the file has it`,children:/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,size:`icon`,className:`size-8`,"aria-label":`Undo turns`,onClick:()=>t([0,0,0]),children:/* @__PURE__ */ (0,L.jsx)(ew,{className:`size-4`,"aria-hidden":!0})})})]})}function nT({item:e,stale:t}){return e.error?{item:e,status:e.error,warn:!0}:e.result?t?{item:e,status:`Settings changed, slice again`,warn:!0}:{item:e,status:`${e.result.stats.weightG} g, ${Uw(e.result.stats.seconds)}`}:{item:e,status:`${kw(e.file.size)}, not sliced yet`}}function rT({files:e,onFiles:t,model:n,rot:r,onRotate:i}){let{getRootProps:a,getInputProps:o,isDragActive:s,open:c}=cC({accept:$w,multiple:!0,maxSize:52428800,noDragEventsBubbling:!0,noClick:!!n,onDrop:e=>{e.length&&t(e)}}),l=e.rows.length>1,u=e.rows.filter(e=>e.item.result&&!e.stale),d=u.length>1&&Qw(u.map(e=>({stats:e.item.result.stats,copies:1,material:e.item.result.material})),null);return/* @__PURE__ */ (0,L.jsxs)(Dw,{n:1,title:l?`Models`:`Model`,done:!!n,aside:l?`${e.rows.length} files`:void 0,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{...a(),className:k(`rounded-xl outline-none`,!n&&`cursor-pointer`,s&&n&&`ring-2 ring-ink ring-offset-2 ring-offset-panel`),children:[/* @__PURE__ */ (0,L.jsx)(`input`,{...o()}),n?/* @__PURE__ */ (0,L.jsx)(Aw,{rows:e.rows.map(nT),selected:e.selected,max:e.max,onSelect:e.onSelect,onRemove:e.onRemove,onAdd:c}):/* @__PURE__ */ (0,L.jsxs)(`div`,{className:k(`flex flex-col items-center gap-2 rounded-xl border-2 border-dashed border-rule px-4 py-7 text-center transition-colors hover:border-muted`,s&&`border-ink bg-raise`),children:[/* @__PURE__ */ (0,L.jsx)(fw,{className:`size-6 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[14px] font-medium`,children:s?`Drop the files to use them`:`Drop models here, or choose them`}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`text-[12px] text-muted`,children:[`STL, 3MF, OBJ, STEP or IGES, up to `,e.max,` files of 50 MB each`]})]})]}),d&&/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`num mt-2 text-[13px] text-muted`,children:[`Total for `,u.length,` sliced models: `,d.grams,` g, `,Uw(d.seconds)]}),n&&/* @__PURE__ */ (0,L.jsx)(tT,{rot:r,onRotate:i}),l&&/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2 rounded-lg bg-raise py-1 pr-1 pl-3`,children:[/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`min-w-0 truncate text-[13px] text-muted`,children:[`Steps 2 to 4 are for `,/* @__PURE__ */ (0,L.jsx)(`span`,{className:`font-medium text-ink`,children:n.name})]}),/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,className:`h-8 px-2.5 text-[13px]`,onClick:()=>e.onApplyAll(e.selected),children:`Use for all`})]})]})}var iT=1,aT=.9,oT=.8,sT=.17,cT=.1,lT=.999,uT=.9999,dT=.99,fT=/[\\\/_+.#"@\[\(\{&]/,pT=/[\\\/_+.#"@\[\(\{&]/g,mT=/[\s-]/,hT=/[\s-]/g;function gT(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?iT:dT;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=gT(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=iT:fT.test(e.charAt(l-1))?(d*=oT,p=e.slice(i,l-1).match(pT),p&&i>0&&(d*=lT**+p.length)):mT.test(e.charAt(l-1))?(d*=aT,m=e.slice(i,l-1).match(hT),m&&i>0&&(d*=lT**+m.length)):(d*=sT,i>0&&(d*=lT**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=uT)),(d<cT&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=gT(e,t,n,r,l+1,a+2,o),f*cT>d&&(d=f*cT)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function _T(e){return e.toLowerCase().replace(hT,` `)}function vT(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,gT(e,t,_T(e),_T(t),0,0,{})}var yT=`[cmdk-group=""]`,bT=`[cmdk-group-items=""]`,xT=`[cmdk-group-heading=""]`,ST=`[cmdk-item=""]`,CT=`${ST}:not([aria-disabled="true"])`,wT=`cmdk-item-select`,TT=`data-value`,ET=(e,t,n)=>vT(e,t,n),DT=I.createContext(void 0),OT=()=>I.useContext(DT),kT=I.createContext(void 0),AT=()=>I.useContext(kT),jT=I.createContext(void 0),MT=I.forwardRef((e,t)=>{let n=KT(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:/* @__PURE__ */ new Map,groups:/* @__PURE__ */ new Set}})),r=KT(()=>/* @__PURE__ */ new Set),i=KT(()=>/* @__PURE__ */ new Map),a=KT(()=>/* @__PURE__ */ new Map),o=KT(()=>/* @__PURE__ */ new Set),s=WT(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=F(),b=F(),x=F(),S=I.useRef(null),C=YT();GT(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),GT(()=>{C(6,A)},[]);let w=I.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=ee()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=I.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,/* @__PURE__ */ new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=ee();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,/* @__PURE__ */ new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??ET;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;te().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(bT);t?t.appendChild(e.parentElement===t?e:e.closest(`${bT} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${bT} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${yT}[${TT}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=te().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(TT);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=/* @__PURE__ */ new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=ee();t&&(t.parentElement?.firstChild===t&&((e=t.closest(yT)?.querySelector(xT))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function ee(){return S.current?.querySelector(`${ST}[aria-selected="true"]`)}function te(){return Array.from(S.current?.querySelectorAll(CT)||[])}function j(e){let t=te()[e];t&&w.setState(`value`,t.getAttribute(TT))}function M(e){var t;let n=ee(),r=te(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(TT))}function ne(e){let t=ee()?.closest(yT),n;for(;t&&!n;)t=e>0?HT(t,yT):UT(t,yT),n=t?.querySelector(CT);n?w.setState(`value`,n.getAttribute(TT)):M(e)}let N=()=>j(te().length-1),P=e=>{e.preventDefault(),e.metaKey?N():e.altKey?ne(1):M(1)},re=e=>{e.preventDefault(),e.metaKey?j(0):e.altKey?ne(-1):M(-1)};return I.createElement(p.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&P(e);break;case`ArrowDown`:P(e);break;case`p`:case`k`:_&&e.ctrlKey&&re(e);break;case`ArrowUp`:re(e);break;case`Home`:e.preventDefault(),j(0);break;case`End`:e.preventDefault(),N();break;case`Enter`:{e.preventDefault();let t=ee();if(t){let e=new Event(wT);t.dispatchEvent(e)}}}}},I.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:QT},c),ZT(e,e=>I.createElement(kT.Provider,{value:w},I.createElement(DT.Provider,{value:T},e))))}),NT=I.forwardRef((e,t)=>{let n=F(),r=I.useRef(null),i=I.useContext(jT),a=OT(),o=WT(e),s=o.current?.forceMount??i?.forceMount;GT(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=JT(n,r,[e.value,e.children,r],e.keywords),l=AT(),u=qT(e=>e.value&&e.value===c.current),d=qT(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);I.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(wT,f),()=>t.removeEventListener(wT,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return I.createElement(p.div,{ref:T(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:f},e.children)}),PT=I.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=F(),s=I.useRef(null),c=I.useRef(null),l=F(),u=OT(),d=qT(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));GT(()=>u.group(o),[]),JT(o,s,[e.value,e.heading,c]);let f=I.useMemo(()=>({id:o,forceMount:i}),[i]);return I.createElement(p.div,{ref:T(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&I.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),ZT(e,e=>I.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},I.createElement(jT.Provider,{value:f},e))))}),FT=I.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=I.useRef(null),a=qT(e=>!e.search);return!n&&!a?null:I.createElement(p.div,{ref:T(i,t),...r,"cmdk-separator":``,role:`separator`})}),IT=I.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=AT(),o=qT(e=>e.search),s=qT(e=>e.selectedItemId),c=OT();return I.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),I.createElement(p.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),LT=I.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=I.useRef(null),o=I.useRef(null),s=qT(e=>e.selectedItemId),c=OT();return I.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),I.createElement(p.div,{ref:T(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},ZT(e,e=>I.createElement(`div`,{ref:T(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),RT=I.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return I.createElement(Ar,{open:n,onOpenChange:r},I.createElement(Pr,{container:o},I.createElement(Ir,{"cmdk-overlay":``,className:i}),I.createElement(Br,{"aria-label":e.label,"cmdk-dialog":``,className:a},I.createElement(MT,{ref:t,...s}))))}),zT=I.forwardRef((e,t)=>qT(e=>e.filtered.count===0)?I.createElement(p.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),BT=I.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return I.createElement(p.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},ZT(e,e=>I.createElement(`div`,{"aria-hidden":!0},e)))}),VT=Object.assign(MT,{List:LT,Item:NT,Input:IT,Group:PT,Separator:FT,Dialog:RT,Empty:zT,Loading:BT});function HT(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function UT(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function WT(e){let t=I.useRef(e);return GT(()=>{t.current=e}),t}var GT=typeof window>`u`?I.useEffect:I.useLayoutEffect;function KT(e){let t=I.useRef();return t.current===void 0&&(t.current=e()),t}function qT(e){let t=AT(),n=()=>e(t.snapshot());return I.useSyncExternalStore(t.subscribe,n,n)}function JT(e,t,n,r=[]){let i=I.useRef(),a=OT();return GT(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(TT,s),i.current=s}),i}var YT=()=>{let[e,t]=I.useState(),n=KT(()=>/* @__PURE__ */ new Map);return GT(()=>{n.current.forEach(e=>e()),n.current=/* @__PURE__ */ new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function XT(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function ZT({asChild:e,children:t},n){return e&&I.isValidElement(t)?I.cloneElement(XT(t),{ref:t.ref},n(t.props.children)):n(t)}var QT={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function $T(e){let t=/* @__PURE__ */ new Map;for(let n of e)t.has(n.group||``)||t.set(n.group||``,[]),t.get(n.group||``).push(n);return[...t]}function eE({value:e,onChange:t,items:n,placeholder:r=`Choose…`,searchPlaceholder:a=`Search`,emptyText:o=`Nothing matches`,disabled:s,label:c,className:l}){let[u,d]=(0,I.useState)(!1),{portal:f}=i(),p=n.find(t=>t.value===e);return/* @__PURE__ */ (0,L.jsxs)(Xa,{open:u,onOpenChange:d,children:[/* @__PURE__ */ (0,L.jsx)(Qa,{asChild:!0,disabled:s,children:/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,role:`combobox`,"aria-expanded":u,"aria-label":c,className:k(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted disabled:opacity-50`,l),children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`truncate`,!p&&`text-muted`),children:p?p.label:r}),/* @__PURE__ */ (0,L.jsx)(bC,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0})]})}),/* @__PURE__ */ (0,L.jsx)(no,{container:f,children:/* @__PURE__ */ (0,L.jsx)(io,{align:`start`,sideOffset:6,className:`z-50 w-[var(--radix-popover-trigger-width)] min-w-56 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,L.jsxs)(VT,{loop:!0,filter:(e,t)=>+!!e.toLowerCase().includes(t.toLowerCase()),children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-rule px-3`,children:[/* @__PURE__ */ (0,L.jsx)(cw,{className:`size-4 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(VT.Input,{placeholder:a,className:`h-10 w-full bg-transparent text-[14px] outline-none placeholder:text-muted`})]}),/* @__PURE__ */ (0,L.jsxs)(VT.List,{className:`max-h-72 overflow-y-auto p-1`,children:[/* @__PURE__ */ (0,L.jsx)(VT.Empty,{className:`px-3 py-6 text-center text-[13px] text-muted`,children:o}),$T(n).map(([n,r])=>{let i=r.map(n=>/* @__PURE__ */ (0,L.jsxs)(VT.Item,{value:`${n.label} ${n.hint||``} ${n.value}`,onSelect:()=>{t(n.value),d(!1)},className:`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-2 text-[14px] data-[selected=true]:bg-raise`,children:[/* @__PURE__ */ (0,L.jsx)(fC,{className:k(`size-4 shrink-0`,n.value===e?`opacity-100`:`opacity-0`),"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`truncate`,children:n.label}),n.hint&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num ml-auto shrink-0 text-[12px] text-muted`,children:n.hint})]},n.value));return n?/* @__PURE__ */ (0,L.jsx)(VT.Group,{heading:n,className:`[&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[12px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted`,children:i},n):i})]})]})})})]})}var tE={BBL:`Bambu Lab`},nE=e=>tE[e]||e,rE=(e,t)=>e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`});function iE(e){let t=/* @__PURE__ */ new Map;for(let n of e){t.has(n.vendor)||t.set(n.vendor,{id:n.vendor,label:nE(n.vendor),models:/* @__PURE__ */ new Map});let e=t.get(n.vendor);if(!e.models.has(n.model)){let t=e.label.toLowerCase()+` `,r=n.model.toLowerCase().startsWith(t)?n.model.slice(t.length):n.model;e.models.set(n.model,{id:n.model,label:r,nozzles:[]})}e.models.get(n.model).nozzles.push({size:n.nozzleMm,name:n.name})}return[...t.values()].map(e=>({...e,models:[...e.models.values()].map(e=>({...e,nozzles:aE(e)})).sort(rE)})).sort(rE)}function aE(e){let t=/* @__PURE__ */ new Map;for(let n of e.nozzles)t.set(n.size,(t.get(n.size)||0)+1);let n=t=>(t.toLowerCase().startsWith(e.id.toLowerCase()+` `)?t.slice(e.id.length+1):t).replace(/\bnozzle\b/gi,``).replace(/\s+-\s+/g,` `).replace(/\s+/g,` `).trim();return e.nozzles.map(e=>({...e,label:t.get(e.size)>1?n(e.name):String(e.size)})).sort((e,t)=>e.size-t.size||rE(e,t))}function oE(e,t){for(let n of e)for(let e of n.models){let r=e.nozzles.find(e=>e.name===t);if(r)return{brand:n,model:e,nozzle:r}}return null}var sE=`__mine`,cE=e=>e.nozzles.find(e=>e.label===`0.4`)||e.nozzles[0];function lE(e){return e.isLoading?`Loading printers…`:e.error?.status===401?`Add the API key (key icon, top right) to list printers.`:e.error?`This server has no OrcaSlicer printer list, so only your own printer is available.`:null}function uE({printers:e,ourPrinters:t=[],printer:n,onChange:r}){let i=e.data,a=(0,I.useMemo)(()=>i&&n?oE(i,n):null,[i,n]),[o,s]=(0,I.useState)(sE),[c,l]=(0,I.useState)(``);(0,I.useEffect)(()=>{a?(s(a.brand.id),l(a.model.id)):n===``&&(s(sE),l(``))},[a,n]);let u=i&&i.find(e=>e.id===o),d=u&&u.models.find(e=>e.id===c),f=(e,t=u)=>{let n=t.models.find(t=>t.id===e);l(e),r(cE(n).name)},p=e=>{if(e.startsWith(`printer:`))return r(e.slice(8));if(s(e),l(``),e===sE)return r(``);let t=i.find(t=>t.id===e);t.models.length===1?f(t.models[0].id,t):r(null)},m=[...t.map(e=>({...e,group:`Our printers`})),{value:sE,label:`My printer`,hint:`house profiles`,group:t.length?`All printers`:void 0},...(i||[]).map(e=>({value:e.id,label:e.label,hint:`${e.models.length} ${e.models.length===1?`model`:`models`}`,group:t.length?`All printers`:void 0}))],h=lE(e),g=o===sE?`My printer`:d?`${u.label} ${d.label}`:u?.label;return/* @__PURE__ */ (0,L.jsx)(Dw,{n:2,title:`Printer`,done:n!==null,aside:g,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Brand`,children:/* @__PURE__ */ (0,L.jsx)(eE,{label:`Printer brand`,value:o,onChange:p,items:m,searchPlaceholder:`Search brands`,emptyText:`No brand by that name`,disabled:!i})}),h&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[13px] text-muted`,children:h}),o===sE&&!h&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Slices with the PLA, PETG and ABS profiles set up on this server.`}),/* @__PURE__ */ (0,L.jsx)(Cy,{initial:!1,children:u&&/* @__PURE__ */ (0,L.jsxs)(gx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`space-y-3 overflow-hidden`,children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Model`,children:/* @__PURE__ */ (0,L.jsx)(eE,{label:`Printer model`,value:c,onChange:e=>f(e),placeholder:`Choose a ${u.label} model`,items:u.models.map(e=>({value:e.id,label:e.label})),searchPlaceholder:`Search models`,emptyText:`No model by that name`})}),d&&/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Nozzle`,hint:`mm`,children:/* @__PURE__ */ (0,L.jsx)(yw,{label:`Nozzle size`,value:n||``,onChange:r,className:d.nozzles.every(e=>e.label.length<=4)?void 0:`flex flex-wrap gap-1`,options:d.nozzles.map(e=>({value:e.name,label:e.label}))})})]},u.id)})]})})}var dE=`__empty`;function fE({value:e,onChange:t,options:n,label:r,className:a}){let{portal:o}=i();return/* @__PURE__ */ (0,L.jsxs)(Ao,{value:e===``?dE:e,onValueChange:e=>t(e===dE?``:e),children:[/* @__PURE__ */ (0,L.jsxs)(Mo,{"aria-label":r,className:k(`flex h-10 w-full items-center justify-between gap-2 rounded-lg border border-rule bg-panel px-3 text-left text-[14px] transition-colors hover:border-muted`,a),children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`truncate`,children:/* @__PURE__ */ (0,L.jsx)(Po,{})}),/* @__PURE__ */ (0,L.jsx)(Fo,{children:/* @__PURE__ */ (0,L.jsx)(mC,{className:`size-4 text-muted`,"aria-hidden":!0})})]}),/* @__PURE__ */ (0,L.jsx)(K,{container:o,children:/* @__PURE__ */ (0,L.jsx)(Ro,{position:`popper`,sideOffset:6,className:`z-50 max-h-80 w-[var(--radix-select-trigger-width)] min-w-48 overflow-hidden rounded-xl border border-rule bg-panel shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:/* @__PURE__ */ (0,L.jsx)(Xo,{className:`p-1`,children:n.map(e=>/* @__PURE__ */ (0,L.jsxs)(ns,{value:e.value===``?dE:e.value,className:`relative flex cursor-pointer items-center rounded-md py-2 pr-2.5 pl-8 text-[14px] outline-none data-[highlighted]:bg-raise`,children:[/* @__PURE__ */ (0,L.jsx)(os,{className:`absolute left-2.5`,children:/* @__PURE__ */ (0,L.jsx)(fC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(is,{children:e.label})]},e.value))})})})]})}var pE=[`PLA`,`PETG`,`ABS`];function mE({settings:e,onChange:t,options:n}){let[r,i]=(0,I.useState)(!1),a=!!e.printer,o=a?n.data:null,s=o?o.materials:pE,c=s.map(e=>({value:e,label:e})),l=e.process||e.filament;return/* @__PURE__ */ (0,L.jsx)(Dw,{n:3,title:`Material`,done:!0,aside:e.filament||null,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-3`,children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Material`,children:s.length>8?/* @__PURE__ */ (0,L.jsx)(eE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),items:c,searchPlaceholder:`Search materials`}):/* @__PURE__ */ (0,L.jsx)(fE,{label:`Material`,value:e.material,onChange:e=>t({material:e,filament:``}),options:c})}),a&&/* @__PURE__ */ (0,L.jsxs)(`div`,{children:[/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),"aria-expanded":r,className:`flex items-center gap-1 text-[13px] font-medium text-muted hover:text-ink`,children:[/* @__PURE__ */ (0,L.jsx)(gC,{className:k(`size-4 transition-transform`,r&&`rotate-90`),"aria-hidden":!0}),`Process and filament presets`,l&&!r?`, changed`:``]}),/* @__PURE__ */ (0,L.jsx)(Cy,{initial:!1,children:r&&/* @__PURE__ */ (0,L.jsx)(gx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2,ease:`easeOut`},className:`overflow-hidden`,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-3 pt-3`,children:[n.isLoading&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[13px] text-muted`,children:`Loading presets…`}),o&&/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Process`,children:/* @__PURE__ */ (0,L.jsx)(fE,{label:`Process preset`,value:e.process,onChange:e=>t({process:e}),options:[{value:``,label:`Printer default${o.defaultProcess?` (${o.defaultProcess})`:``}`},...o.processes.map(e=>({value:e,label:e}))]})}),/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Filament`,hint:`${o.filaments.length} for ${e.material}`,children:/* @__PURE__ */ (0,L.jsx)(eE,{label:`Filament preset`,value:e.filament,onChange:e=>t({filament:e}),searchPlaceholder:`Search filaments`,items:[{value:``,label:`Generic ${e.material}`},...o.filaments.map(e=>({value:e.name,label:e.name}))]})})]})]})})})]})]})})}function hE({label:e,values:t,value:n,onChange:r,format:i,valueText:a=i,defaultValue:o,defaultLabel:s,captions:c,bare:l}){let u=s!==void 0,d=n!==``,f=Math.max(0,t.indexOf(d?Number(n):o));return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[!l&&/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:d?`num text-[13px] font-semibold`:`text-[13px] text-muted`,children:d?i(Number(n)):s}),u&&d&&/* @__PURE__ */ (0,L.jsx)(M,{label:`Back to default`,children:/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,onClick:()=>r(``),"aria-label":`${e} back to default`,className:`grid size-6 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(ew,{className:`size-3.5`,"aria-hidden":!0})})})]})]}),/* @__PURE__ */ (0,L.jsxs)(Os,{min:0,max:t.length-1,step:1,value:[f],onValueChange:([e])=>r(t[e]),className:`relative flex h-6 touch-none items-center select-none`,"aria-label":e,children:[/* @__PURE__ */ (0,L.jsx)(Fs,{className:`relative h-2 flex-1 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,L.jsx)(Ls,{className:d?`absolute h-full bg-accent`:`absolute h-full bg-rule`})}),/* @__PURE__ */ (0,L.jsx)(Ws,{"aria-valuetext":d?a(Number(n)):s,className:d?`block size-5 rounded-full border-2 border-accent bg-panel shadow-sm`:`block size-5 rounded-full border-2 border-rule bg-panel`})]}),c&&/* @__PURE__ */ (0,L.jsx)(`div`,{className:`grid text-[11px] text-muted`,style:{gridTemplateColumns:`repeat(${c.length}, minmax(0, 1fr))`},children:c.map((e,i)=>{let a=i===0?`text-left`:i===c.length-1?`text-right`:`text-center`;return c.length===t.length?/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,onClick:()=>r(t[i]),tabIndex:-1,className:`${a} hover:text-ink ${t[i]===Number(n)?`font-semibold text-ink`:``}`,children:e},i):/* @__PURE__ */ (0,L.jsx)(`span`,{className:a,children:e},i)})})]})}var gE={printer:``,material:`PLA`,process:``,filament:``,quality:``,infill:``,walls:``,supports:``},_E=[10,15,20,30,40,50,60,70,80,90];function vE(e,t,n=[0,0,0]){let r=new FormData;r.append(`model`,e),[`rotX`,`rotY`,`rotZ`].forEach((e,t)=>{n[t]&&r.append(e,String(n[t]))});let i={printer:t.printer,material:t.material,quality:t.quality,infill:t.infill,walls:t.walls,supports:t.supports};t.printer&&Object.assign(i,{process:t.process,filament:t.filament});for(let e of[`printer`,`material`,`process`,`filament`,`quality`,`infill`,`walls`,`supports`])i[e]!==void 0&&String(i[e])!==``&&r.append(e,String(i[e]));return t.mode&&r.append(`mode`,t.mode),t.mode!==`estimate`&&t.gcode!==!1&&r.append(`gcode`,`true`),r}var yE=[{value:``,label:`Default`},{value:`standard`,label:`0.2`},{value:`medium`,label:`0.15`},{value:`high`,label:`0.1`}],bE=[{value:``,label:`Default`},{value:`false`,label:`Off`},{value:`true`,label:`On`}],xE=e=>`${e} ${e===1?`wall`:`walls`}`;function SE({settings:e,onChange:t}){let n=!!e.printer;return/* @__PURE__ */ (0,L.jsx)(Dw,{n:4,title:`Print settings`,done:!0,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`space-y-4`,children:[/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Layer height`,hint:`mm`,children:/* @__PURE__ */ (0,L.jsx)(yw,{label:`Layer height`,value:e.quality,onChange:e=>t({quality:e}),options:yE})}),/* @__PURE__ */ (0,L.jsx)(hE,{label:`Infill`,values:_E,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,defaultValue:15,defaultLabel:n?`Printer default`:`Default, 15%`}),/* @__PURE__ */ (0,L.jsx)(hE,{label:`Walls`,values:Pw,value:e.walls,onChange:e=>t({walls:e}),format:xE,defaultValue:3,defaultLabel:n?`Printer default`:`Default, 3 walls`}),/* @__PURE__ */ (0,L.jsx)(Ow,{label:`Supports`,children:/* @__PURE__ */ (0,L.jsx)(yw,{label:`Supports`,value:e.supports,onChange:e=>t({supports:e}),options:bE})}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[13px] text-muted`,children:n?`Default keeps what the printer’s own process uses.`:`Default on your printer: 0.2 mm layers, 15% infill, 3 walls, no supports.`})]})})}function CE(e){let[t,n]=(0,I.useState)(Date.now);return(0,I.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),e?Math.max(0,Math.round((t-e)/1e3)):0}function wE({files:e,onFiles:t,model:n,rot:r,onRotate:i,settings:a,onSettings:o,printers:s,ourPrinters:c=[],options:l,toSlice:u,slicingSince:d,blocker:f,onSlice:p}){let m=CE(d);return/* @__PURE__ */ (0,L.jsxs)(`aside`,{className:`flex flex-col border-rule bg-panel lg:min-h-0 lg:w-[380px] lg:shrink-0 lg:border-r`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`lg:min-h-0 lg:flex-1 lg:overflow-y-auto`,children:[/* @__PURE__ */ (0,L.jsx)(rT,{files:e,onFiles:t,model:n,rot:r,onRotate:i}),/* @__PURE__ */ (0,L.jsx)(uE,{printers:s,ourPrinters:c,printer:a.printer,onChange:e=>o({printer:e,process:``,filament:``})}),/* @__PURE__ */ (0,L.jsx)(mE,{settings:a,onChange:o,options:l}),/* @__PURE__ */ (0,L.jsx)(SE,{settings:a,onChange:o})]}),/* @__PURE__ */ (0,L.jsxs)(`footer`,{className:`sticky bottom-0 border-t border-rule bg-panel px-5 py-4`,children:[f&&!d&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mb-2.5 text-[13px] text-muted`,children:f}),/* @__PURE__ */ (0,L.jsx)(_w,{variant:`primary`,size:`lg`,className:`w-full justify-center`,disabled:!!f||!!d,onClick:p,children:d?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(w,{className:`size-[18px] animate-spin`,"aria-hidden":!0}),` Slicing `,/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num`,children:[m,` s`]})]}):/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(HC,{className:`size-[18px]`,"aria-hidden":!0}),` `,u>1?`Slice ${u} models`:`Slice model`]})})]})]})}var TE=e=>{let t=oe.indexOf(e);return t<0?oe.length-1:t};function EE({features:e,hidden:t,onHidden:n,open:r,onOpen:i}){let a=e.reduce((e,t)=>e+t.e,0)||1,o=e.map((e,t)=>({...e,i:t})).sort((e,t)=>TE(e.name)-TE(t.name)),s=e.map((e,t)=>t),c=(e,r)=>{if(e.altKey){let e=t.size===s.length-1&&!t.has(r);n(new Set(e?[]:s.filter(e=>e!==r)))}else{let e=new Set(t);e.has(r)?e.delete(r):e.add(r),n(e)}};return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:k(`overflow-hidden rounded-xl border border-rule bg-panel/90 backdrop-blur`,r?`w-64`:`w-auto`),children:[/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!r),"aria-expanded":r,className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-[14px] font-semibold`,children:[`Features`,t.size>0&&/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num text-[12px] font-normal text-muted`,children:[e.length-t.size,` of `,e.length,` shown`]}),/* @__PURE__ */ (0,L.jsx)(mC,{className:k(`ml-auto size-4 text-muted transition-transform`,r&&`rotate-180`),"aria-hidden":!0})]}),/* @__PURE__ */ (0,L.jsx)(Cy,{initial:!1,children:r&&/* @__PURE__ */ (0,L.jsxs)(gx.div,{initial:{height:0},animate:{height:`auto`},exit:{height:0},transition:{duration:.2,ease:`easeOut`},children:[/* @__PURE__ */ (0,L.jsx)(`ul`,{className:`px-1.5 pb-1.5`,children:o.map(e=>{let n=t.has(e.i),r=e.e/a*100;return/* @__PURE__ */ (0,L.jsx)(`li`,{children:/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:t=>c(t,e.i),"aria-pressed":!n,className:k(`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-[13px] hover:bg-raise`,n&&`text-muted`),children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`size-3 shrink-0 rounded-[3px]`,style:{background:ie(e.name),opacity:n?.3:1},"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ae(e.name)}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num text-[12px] text-muted`,children:[r<.1?`<0.1`:r.toFixed(1),`%`]}),n?/* @__PURE__ */ (0,L.jsx)(AC,{className:`size-3.5 text-muted`,"aria-hidden":!0}):/* @__PURE__ */ (0,L.jsx)(MC,{className:`size-3.5 text-muted/60`,"aria-hidden":!0})]})},e.i)})}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`border-t border-rule px-3.5 py-2 text-[12px] text-muted`,children:t.size?/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,className:`font-medium text-ink underline underline-offset-2`,onClick:()=>n(/* @__PURE__ */ new Set),children:`Show all`}):`Alt-click a feature to see only it`})]})})]})}function DE(e){let t=e.length?e[e.length-1].z:0,n=[1,2,5,10,20,25,50,100].find(e=>t/e<=10)||200,r=[];for(let i=n;i<=t+1e-6;i+=n){let t=e.findIndex(e=>e.z>=i-1e-6);t>=0&&r.push({z:i,at:e.length>1?t/(e.length-1):0})}return r}function OE({layer:e,z:t,vertical:n,at:r}){return/* @__PURE__ */ (0,L.jsxs)(`span`,{className:k(`pointer-events-none absolute flex items-baseline gap-1.5 whitespace-nowrap rounded-md bg-ink px-2 py-1 text-ink-contrast shadow-sm`,n?`top-1/2 right-[calc(100%+10px)] -translate-y-1/2`:`bottom-[calc(100%+10px)] left-1/2`),style:n?void 0:{transform:`translateX(-${r*100}%)`},children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num text-[13px] font-semibold`,children:e}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num text-[11px] opacity-70`,children:[t.toFixed(2),` mm`]})]})}function kE({layers:e,fallbackZ:t,value:n,onChange:r,vertical:i}){let a=Math.max(1,e.length),o=(0,I.useMemo)(()=>DE(e),[e]),s=n=>e[n-1]?e[n-1].z:t,c=e=>a>1?(e-1)/(a-1):0,[l,u]=n;return/* @__PURE__ */ (0,L.jsx)(`div`,{className:k(`flex rounded-xl border border-rule bg-panel/90 backdrop-blur`,i?`h-full w-16 flex-col items-center py-4`:`h-14 w-full items-center px-5`),children:/* @__PURE__ */ (0,L.jsxs)(Os,{orientation:i?`vertical`:`horizontal`,min:1,max:a,step:1,minStepsBetweenThumbs:0,value:n,onValueChange:r,className:k(`relative flex touch-none select-none`,i?`h-full w-5 flex-col items-center`:`h-5 w-full items-center`),children:[/* @__PURE__ */ (0,L.jsx)(Fs,{className:k(`relative grow rounded-full bg-raise`,i?`w-1.5`:`h-1.5`),children:/* @__PURE__ */ (0,L.jsx)(Ls,{className:k(`absolute rounded-full bg-ink`,i?`w-full`:`h-full`)})}),o.map(e=>/* @__PURE__ */ (0,L.jsxs)(`span`,{className:k(`pointer-events-none absolute flex items-center gap-1 text-[10px] text-muted`,i?`left-[calc(100%+4px)] -translate-y-1/2`:`top-[calc(100%+3px)] -translate-x-1/2 flex-col`),style:i?{bottom:`${e.at*100}%`}:{left:`${e.at*100}%`},"aria-hidden":!0,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:k(`bg-muted/60`,i?`h-px w-1.5`:`h-1.5 w-px`)}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num`,children:e.z})]},e.z)),/* @__PURE__ */ (0,L.jsx)(Ws,{"aria-label":`Bottom layer`,className:`relative block size-4 rounded-full border-2 border-ink bg-panel`,children:l>1&&/* @__PURE__ */ (0,L.jsx)(OE,{layer:l,z:s(l),vertical:i,at:c(l)})}),/* @__PURE__ */ (0,L.jsx)(Ws,{"aria-label":`Top layer`,className:`relative block size-5 rounded-full border-2 border-ink bg-ink`,children:/* @__PURE__ */ (0,L.jsx)(OE,{layer:u,z:s(u),vertical:i,at:c(u)})})]})})}var AE=e=>e==null?null:`${+e.toFixed(3)} mm`;function jE(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.round(e%60);return[t&&`${t}h`,(t||n)&&`${n}m`,`${r}s`].filter(Boolean).join(` `)}function ME(e){if(!e.bed)return null;let t=e.bed.map(e=>e[0]),n=e.bed.map(e=>e[1]);return[Math.max(...t)-Math.min(...t),Math.max(...n)-Math.min(...n),e.bedHeight].filter(e=>e!=null).map(e=>+e.toFixed(1)).join(` × `)+` mm`}function NE({value:e,unit:t,label:n}){return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`num display text-[20px] leading-none font-semibold whitespace-nowrap`,children:[e,t&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`ml-0.5 text-[13px] font-medium text-muted`,children:t})]}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1 text-[12px] text-muted`,children:n})]})}function PE({result:e,quote:t}){let n=e.meta,r=t&&t.used,i=t&&t.stats,a=[[`Sliced with`,n.generatedBy&&n.generatedBy.split(` on `)[0]],[`Printer`,r&&r.printer||n.printer],[`Process`,r&&r.process||n.process],[`Filament`,r&&r.filament||n.filament],[`Material`,n.filamentType],[`Layer height`,AE(n.layerHeight)],[`Nozzle`,AE(n.nozzle)],[`Total time`,n.totalTime&&`${n.totalTime} with start and end`],[`Filament volume`,n.filamentCm3!=null&&`${n.filamentCm3} cm³`],[`Bed`,ME(n)],[`Model size`,i&&i.sizeMm.map(e=>+e.toFixed(1)).join(` × `)+` mm`],[`Model volume`,i&&`${i.volumeCm3} cm³`],[`Watertight`,i&&(i.watertight?`Yes`:`No, results may be off`)]].filter(([,e])=>e);return/* @__PURE__ */ (0,L.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-[13px]`,children:a.flatMap(([e,t])=>[/* @__PURE__ */ (0,L.jsx)(`dt`,{className:`text-muted`,children:e},e),/* @__PURE__ */ (0,L.jsx)(`dd`,{className:`text-right font-medium [overflow-wrap:anywhere]`,children:t},e+`:`)])})}function FE({result:e,quote:t,thumbnail:n}){let{portal:r}=i(),a=e.meta,o=t&&t.stats,s=a.filamentG??(o&&o.weightG),c=a.printTime||o&&jE(o.seconds);return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex w-full items-start gap-3 rounded-xl border border-rule bg-panel/90 px-4 py-3 backdrop-blur lg:w-auto lg:items-center`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`grid flex-1 grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4 lg:flex lg:gap-6`,children:[s!=null&&/* @__PURE__ */ (0,L.jsx)(NE,{value:s,unit:`g`,label:`Weight`}),c&&/* @__PURE__ */ (0,L.jsx)(NE,{value:c,label:`Print time`}),a.filamentMm!=null&&/* @__PURE__ */ (0,L.jsx)(NE,{value:(a.filamentMm/1e3).toFixed(2),unit:`m`,label:`Filament`}),/* @__PURE__ */ (0,L.jsx)(NE,{value:Math.max(1,e.layers.length),label:`Layers`})]}),/* @__PURE__ */ (0,L.jsxs)(Xa,{children:[/* @__PURE__ */ (0,L.jsx)(M,{label:`Print details`,children:/* @__PURE__ */ (0,L.jsx)(Qa,{asChild:!0,children:/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Print details`,className:`ml-auto grid size-8 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(RC,{className:`size-[18px]`,"aria-hidden":!0})})})}),/* @__PURE__ */ (0,L.jsx)(no,{container:r,children:/* @__PURE__ */ (0,L.jsxs)(io,{side:`top`,align:`start`,sideOffset:10,className:`z-50 w-80 rounded-xl border border-rule bg-panel p-4 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.35)]`,children:[/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mb-3 text-[14px] font-semibold`,children:`Print details`}),n&&/* @__PURE__ */ (0,L.jsx)(`img`,{src:n,alt:`The sliced plate`,className:`mb-3 aspect-[4/3] w-full rounded-lg bg-viewer object-contain`}),/* @__PURE__ */ (0,L.jsx)(PE,{result:e,quote:t})]})})]})]})}function IE(){let{layout:e}=i(),[t,n]=(0,I.useState)(()=>e.clientWidth);return(0,I.useEffect)(()=>{let t=new ResizeObserver(()=>n(e.clientWidth));return t.observe(e),()=>t.disconnect()},[e]),t}var LE=(0,I.lazy)(()=>import(`./chunks/Viewer3D-o2piEXHZ.js`)),RE=(0,I.lazy)(()=>import(`./chunks/ModelPreview-CYVyGDd1.js`)),zE=[{value:`iso`,label:`3D`},{value:`top`,label:`Top`},{value:`front`,label:`Front`}];function BE({children:e}){return/* @__PURE__ */ (0,L.jsx)(gx.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2},className:`absolute top-1/2 left-1/2 z-20 w-[min(360px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-rule bg-panel p-6 text-center`,children:e})}function VE({slicing:e}){let t=CE(e.since);return/* @__PURE__ */ (0,L.jsxs)(BE,{children:[/* @__PURE__ */ (0,L.jsx)(w,{className:`mx-auto size-7 animate-spin text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-3 text-[15px] font-semibold`,children:e.title}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1 text-[13px] text-muted`,children:e.printer}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,L.jsx)(gx.div,{className:`h-full w-1/3 rounded-full bg-ink`,animate:{x:[`-100%`,`300%`]},transition:{repeat:1/0,duration:1.4,ease:`easeInOut`}})}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`num mt-2 text-[12px] text-muted`,children:[t,` s`]})]})}function HE({onChooseModel:e,onOpenGcode:t}){return/* @__PURE__ */ (0,L.jsx)(`div`,{className:`absolute inset-0 grid place-items-center p-6`,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`max-w-sm text-center`,children:[/* @__PURE__ */ (0,L.jsx)(HC,{className:`mx-auto size-10 text-muted`,strokeWidth:1.5,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`display mt-4 text-[20px] font-semibold`,children:`Slice a model to see how it prints`}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-2 text-[14px] text-muted`,children:`Drop a model anywhere on the page (STL, 3MF, OBJ, STEP or IGES), set the printer on the left, then slice. Already have G-code or a sliced 3MF? Open it to inspect it.`}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-5 flex flex-wrap justify-center gap-2`,children:[/* @__PURE__ */ (0,L.jsxs)(_w,{variant:`primary`,onClick:e,children:[/* @__PURE__ */ (0,L.jsx)(fw,{className:`size-4`,"aria-hidden":!0}),` Choose model`]}),/* @__PURE__ */ (0,L.jsxs)(_w,{onClick:t,children:[/* @__PURE__ */ (0,L.jsx)(PC,{className:`size-4`,"aria-hidden":!0}),` Open G-code`]})]})]})})}function UE({label:e,pressed:t,onClick:n,children:r,...i}){return/* @__PURE__ */ (0,L.jsx)(M,{label:e,children:/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":t,onClick:n,...i,className:k(`grid size-9 place-items-center rounded-lg border border-rule bg-panel/90 text-muted backdrop-blur hover:text-ink`,t&&`border-ink text-ink`),children:r})})}function WE({gcode:e,model:t,rot:n,slicing:r,onChooseModel:i,onOpenGcode:a}){let{status:o,result:s}=e,c=o===`ready`,l=IE()>=1024,u=Bb(),[d,f]=(0,I.useState)([1,1]),[p,m]=(0,I.useState)(()=>/* @__PURE__ */ new Set),[h,g]=(0,I.useState)(!1),[_,v]=(0,I.useState)(`iso`),[y,b]=(0,I.useState)(0),[x,S]=(0,I.useState)(l),C=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!s)return;let e=Math.max(1,s.layers.length);if(m(/* @__PURE__ */ new Set),v(`iso`),u||e<3){f([1,e]);return}f([1,1]);let t=hx(1,e,{duration:1.2,ease:[.22,1,.36,1],onUpdate:e=>f([1,Math.round(e)])});return C.current=t,()=>t.stop()},[s,u]);let w=c,T=!r&&!!t&&o===`empty`,E=(0,I.useMemo)(()=>e.download?URL.createObjectURL(e.download):null,[e.download]);return(0,I.useEffect)(()=>()=>{E&&URL.revokeObjectURL(E)},[E]),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`relative flex min-h-0 flex-col lg:h-full`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`relative h-[58vh] min-h-[340px] overflow-hidden bg-viewer lg:h-auto lg:flex-1`,children:[w&&/* @__PURE__ */ (0,L.jsx)(`div`,{className:`absolute inset-0`,children:/* @__PURE__ */ (0,L.jsx)(I.Suspense,{fallback:null,children:/* @__PURE__ */ (0,L.jsx)(LE,{result:s,layerMin:d[0]-1,layerMax:d[1]-1,hidden:p,showTravels:h,view:_,fitKey:y})})}),o===`empty`&&!r&&!t&&/* @__PURE__ */ (0,L.jsx)(HE,{onChooseModel:i,onOpenGcode:a}),T&&/* @__PURE__ */ (0,L.jsx)(I.Suspense,{fallback:null,children:/* @__PURE__ */ (0,L.jsx)(RE,{file:t,rot:n})}),r&&/* @__PURE__ */ (0,L.jsx)(VE,{slicing:r}),o===`loading`&&!r&&/* @__PURE__ */ (0,L.jsxs)(BE,{children:[/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`text-[15px] font-semibold`,children:[`Reading `,e.name]}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:`mt-4 h-1.5 overflow-hidden rounded-full bg-raise`,children:/* @__PURE__ */ (0,L.jsx)(`div`,{className:`h-full rounded-full bg-ink transition-[width]`,style:{width:`${Math.round(e.progress*100)}%`}})})]}),o===`error`&&!r&&/* @__PURE__ */ (0,L.jsxs)(BE,{children:[/* @__PURE__ */ (0,L.jsx)(te,{className:`mx-auto size-7 text-danger`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-3 text-[14px]`,role:`alert`,children:e.error}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[/* @__PURE__ */ (0,L.jsx)(_w,{onClick:a,children:`Open another file`}),/* @__PURE__ */ (0,L.jsx)(_w,{variant:`ghost`,onClick:e.close,children:`Close`})]})]}),w&&/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(`div`,{className:`absolute top-3 left-3 z-10`,children:/* @__PURE__ */ (0,L.jsx)(EE,{features:s.features,hidden:p,onHidden:m,open:x,onOpen:S})}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`absolute top-3 right-3 z-10 flex flex-col items-end gap-2 sm:flex-row sm:items-center`,children:[/* @__PURE__ */ (0,L.jsx)(yw,{label:`View`,value:_,onChange:e=>{v(e),b(e=>e+1)},options:zE,className:`w-40 border border-rule bg-panel/90 backdrop-blur`}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex gap-2`,children:[/* @__PURE__ */ (0,L.jsx)(UE,{label:h?`Hide travel moves`:`Show travel moves`,pressed:h,onClick:()=>g(e=>!e),children:/* @__PURE__ */ (0,L.jsx)(nw,{className:`size-[18px]`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(UE,{label:`Fit to model`,onClick:()=>b(e=>e+1),children:/* @__PURE__ */ (0,L.jsx)(ow,{className:`size-[18px]`,"aria-hidden":!0})})]})]}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:l?`absolute top-[72px] right-3 bottom-28 z-10`:`absolute inset-x-3 bottom-3 z-10`,children:/* @__PURE__ */ (0,L.jsx)(kE,{layers:s.layers,fallbackZ:s.bounds.max[2],value:d,vertical:l,onChange:e=>{C.current?.stop(),f(e)}})})]})]}),c&&/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-t border-rule bg-panel p-3 lg:absolute lg:bottom-3 lg:left-3 lg:z-10 lg:max-w-[calc(100%-110px)] lg:flex-nowrap lg:border-0 lg:bg-transparent lg:p-0`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 rounded-xl border border-rule bg-panel/90 py-1.5 pr-1.5 pl-3 backdrop-blur`,children:[/* @__PURE__ */ (0,L.jsx)(PC,{className:`size-4 shrink-0 text-muted`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`max-w-[220px] truncate text-[13px] font-medium`,title:e.name,children:e.name}),E&&/* @__PURE__ */ (0,L.jsx)(M,{label:`Download G-code`,children:/* @__PURE__ */ (0,L.jsx)(`a`,{href:E,download:e.name,"aria-label":`Download G-code`,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(EC,{className:`size-4`,"aria-hidden":!0})})}),/* @__PURE__ */ (0,L.jsx)(M,{label:`Close`,children:/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Close file`,onClick:e.close,className:`grid size-7 place-items-center rounded-md text-muted hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(mw,{className:`size-4`,"aria-hidden":!0})})})]}),/* @__PURE__ */ (0,L.jsx)(FE,{result:s,quote:e.quote,thumbnail:e.thumbnail})]})]})}var GE=`gcode-viewer.api-key`,KE=()=>{try{return localStorage.getItem(GE)||``}catch{return``}},qE=e=>{try{localStorage.setItem(GE,e)}catch{}},JE=(e,t)=>`${String(e||``).replace(/\/+$/,``)}${t}`;async function YE(e,{key:t,...n}={}){let r=await fetch(e,{...n,headers:t?{"x-api-key":t}:{}}),i=null;try{i=await r.json()}catch{}if(!r.ok)throw Object.assign(Error(i&&i.error||`Request failed (HTTP ${r.status})`),{status:r.status});return i}var XE=[`process`,`model`,`files`,`material`,`strength`,`cost`,`contact`],ZE=[`auto`,`exact`,`estimate`],QE=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0,$E=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function eD(e,t=e=>console.warn(`slicer-studio: ${e}`)){let n=e;if(typeof e==`string`){if(!e.trim())return{};try{n=JSON.parse(e)}catch(e){return t(`config is not valid JSON: ${e.message}`),{}}}if(n==null)return{};if(!$E(n))return t(`config must be an object`),{};let{currency:r,pricePerGram:i,priceRange:a,regularMode:o,contact:s,defaultPrinter:c,defaults:l,cards:u,advanced:d,...f}=n;for(let e of Object.keys(f))t(`unknown config key "${e}" left out`);let p={};if(r!==void 0&&(typeof r==`string`&&/^[a-z]{3}$/i.test(r)?p.currency=r.toUpperCase():t(`currency ${JSON.stringify(r)} left out: use a code like INR`)),$E(i)){p.pricePerGram={};for(let[e,n]of Object.entries(i))QE(n)?p.pricePerGram[e.toUpperCase()]=n:t(`pricePerGram.${e} left out: it must be a number of 0 or more`)}if(a!==void 0&&(QE(a)?p.priceRange=a:t(`priceRange left out: it must be a percentage of 0 or more`)),$E(o)&&(p.regularMode={},typeof o.supports==`boolean`?p.regularMode.supports=o.supports:o.supports!==void 0&&t(`regularMode.supports left out: it must be true or false`),ZE.includes(o.mode)?p.regularMode.mode=o.mode:o.mode!==void 0&&t(`regularMode.mode left out: it must be ${ZE.join(`, `)}`)),$E(s)&&(p.contact={},typeof s.name==`string`&&(p.contact.name=s.name.trim()),typeof s.email==`string`&&s.email.includes(`@`)?p.contact.email=s.email.trim():s.email!==void 0&&t(`contact.email "${s.email}" left out: it is not an email address`)),typeof c==`string`&&c.trim()&&(p.defaultPrinter=c.trim()),$E(l)){p.defaults={},typeof l.material==`string`&&(p.defaults.material=l.material.toUpperCase());let e=(e,n)=>{n.includes(l[e])?p.defaults[e]=l[e]:l[e]!==void 0&&t(`defaults.${e} left out: it must be one of ${n.join(`, `)}`)};e(`quality`,Nw.map(e=>e.id)),e(`infill`,_E),e(`walls`,Pw)}if(Array.isArray(u)){p.cards=u.filter(e=>XE.includes(e));for(let e of u)XE.includes(e)||t(`card "${e}" left out: it must be one of ${XE.join(`, `)}`);!p.cards.includes(`model`)&&!p.cards.includes(`files`)&&(t(`cards need model or files, or there is nowhere to add a file: keeping model`),p.cards.push(`model`))}if(d!==void 0){let e=e=>{let n=$E(d)?d[e]:void 0;return typeof n==`string`&&n.trim()?n.trim():(t(`advanced.${e} must be a URL: Advanced stays closed until it is`),``)};p.advanced={authUrl:e(`authUrl`),verifyUrl:e(`verifyUrl`)}}return p}var tD=e=>new Set(e.cards||XE);function nD(e,t){let n={...e.pricing&&e.pricing.perGram,...t.pricePerGram};return{...e,pricing:Object.keys(n).length?{currency:t.currency??(e.pricing?e.pricing.currency:`INR`),perGram:n,range:t.priceRange??(e.pricing?e.pricing.range:0)}:null,defaultPrinter:t.defaultPrinter??e.defaultPrinter,regularMode:{...e.regularMode,...t.regularMode},contact:{...e.contact,...t.contact}}}var rD=()=>{let{apiUrl:e}=i();return t=>JE(e,t)};function iD(){let e=rD(),{config:t}=i();return At({queryKey:[`config`],queryFn:()=>YE(e(`/api/config`)),select:e=>nD(e,t)})}function aD(){let e=rD();return At({queryKey:[`health`],queryFn:()=>fetch(e(`/health`)).then(e=>e.json()),staleTime:6e4})}function oD(e){let t=rD();return At({queryKey:[`printers`,e],queryFn:()=>YE(t(`/api/printers`),{key:e}),select:e=>iE(e.printers)})}function sD(e,t,n){let r=rD();return At({queryKey:[`options`,e,t,n],queryFn:()=>YE(r(`/api/options?printer=${encodeURIComponent(e)}&material=${encodeURIComponent(t)}`),{key:n}),enabled:!!e,placeholderData:t=>t&&t.printer===e?t:void 0})}function cD(e){let t=rD();return jt({mutationFn:({model:n,settings:r,rot:i})=>YE(t(`/api/quote`),{key:e,method:`POST`,body:vE(n,r,i)})})}var lD='const e=Math.PI/18,t=1e-9;var n=class{constructor(e,t=4096){this.Type=e,this.a=new e(t),this.n=0}push(e){if(this.n===this.a.length){let e=new this.Type(this.n*2);e.set(this.a),this.a=e}this.a[this.n++]=e}done(){return this.a.slice(0,this.n)}};const r=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:null},i=e=>Math.round(e*1e4)/1e4;function a(e){let t={};for(let[,n,r]of e.matchAll(/([A-Za-z])\\s*([-+]?(?:\\d+\\.?\\d*|\\.\\d+))/g))t[n.toUpperCase()]=Number(r);return t}function o(o,s){let c=/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/m.test(o),l={start:new n(Float32Array),end:new n(Float32Array),feature:new n(Uint8Array),layer:new n(Float32Array),width:new n(Float32Array),height:new n(Float32Array)},u={pos:new n(Float32Array),layer:new n(Float32Array)},d=[],f=[],p=/* @__PURE__ */ new Map,m={},h={},g=[1/0,1/0,1/0],_=[-1/0,-1/0,-1/0],v=0,y=0,b=0,x=0,S=!1,C=!1,w=-1,T=null,E=null,D=!1,O=!1,k=()=>Math.max(0,d.length-1),A=e=>(p.has(e)||(p.set(e,f.length),f.push({name:e,e:0})),p.get(e));function j(e,t,n,a,o,s,u){if(!c&&(!d.length||Math.abs(s-d[d.length-1].z)>1e-4)){let e=d.length?d[d.length-1].z:0;d.push({z:i(s),height:i(Math.abs(s-e))})}w<0&&(w=A(`Custom`)),f[w].e+=u,l.start.push(e),l.start.push(t),l.start.push(n),l.end.push(a),l.end.push(o),l.end.push(s),l.feature.push(w),l.layer.push(k()),l.width.push(T??r(m.nozzle_diameter)??.4),l.height.push(E??r(m.layer_height)??.2),M(0,e),M(1,t),M(2,n),M(0,a),M(1,o),M(2,s)}function M(e,t){t<g[e]&&(g[e]=t),t>_[e]&&(_[e]=t)}function N(e,t,n,r,i,a){for(let o of[e,t,n,r,i,a])u.pos.push(o);u.layer.push(k())}function P(e,n,r,i,a,o,s){s>t&&(Math.abs(i-e)>t||Math.abs(a-n)>t)?j(e,n,r,i,a,o,s):(Math.abs(i-e)>t||Math.abs(a-n)>t||Math.abs(o-r)>t)&&N(e,n,r,i,a,o)}function F(e){let t;if(/^;\\s*(?:CHANGE_LAYER|LAYER_CHANGE)\\s*$/.test(e))d.push({z:i(b),height:E??r(m.layer_height)??.2}),D=O=!1;else if(t=e.match(/^;\\s*(?:Z_HEIGHT|Z):\\s*([-+\\d.]+)/))c&&d.length&&!D&&(d[d.length-1].z=r(t[1]),D=!0);else if(t=e.match(/^;\\s*(?:LAYER_HEIGHT|HEIGHT):\\s*([\\d.]+)/))E=r(t[1]),c&&d.length&&!O&&(d[d.length-1].height=E,O=!0);else if(t=e.match(/^;\\s*(?:FEATURE|TYPE):\\s*(.+?)\\s*$/))w=A(t[1]);else if(t=e.match(/^;\\s*(?:LINE_WIDTH|WIDTH):\\s*([\\d.]+)/))T=r(t[1]);else if(t=e.match(/^;\\s*(?:total )?filament used \\[(g|mm|cm3)\\]\\s*=\\s*([\\d.]+)/)){let e={g:`filamentG`,mm:`filamentMm`,cm3:`filamentCm3`}[t[1]];h[e]??(h[e]=r(t[2]))}else(t=e.match(/^;\\s*(\\w+)\\s*=\\s*(.*?)\\s*$/))?m[t[1]]=t[2].replace(/^"(.*)"$/,`$1`):(t=e.match(/^;\\s*generated by\\s+(.+?)\\s*$/i))?h.generatedBy=t[1]:/printing time/i.test(e)&&((t=e.match(/model printing time:\\s*([^;]+)/i))&&(h.printTime=t[1].trim()),(t=e.match(/total estimated time:\\s*([^;]+)/i))&&(h.totalTime=t[1].trim()),(t=e.match(/estimated printing time \\(normal mode\\)\\s*=\\s*(.+)/i))&&!h.printTime&&(h.printTime=t[1].trim()))}function I(n,r){let i=`X`in r?S?v+r.X:r.X:v,a=`Y`in r?S?y+r.Y:r.Y:y,o=`Z`in r?S?b+r.Z:r.Z:b,s=0;if(`E`in r){let e=S||C;s=e?r.E:r.E-x,x=e?x+r.E:r.E}if(!((n===2||n===3)&&(`I`in r||`J`in r)))P(v,y,b,i,a,o,s);else{let c=v+(r.I||0),l=y+(r.J||0),u=Math.hypot(v-c,y-l),d=Math.atan2(y-l,v-c),f=Math.atan2(a-l,i-c)-d;n===3&&f<=t&&(f+=2*Math.PI),n===2&&f>=-1e-9&&(f-=2*Math.PI);let p=Math.max(1,Math.ceil(Math.max(Math.abs(f)*u/1,Math.abs(f)/e))),m=v,h=y,g=b;for(let e=1;e<=p;e++){let t=d+f*e/p,n=e===p?i:c+u*Math.cos(t),r=e===p?a:l+u*Math.sin(t),_=b+(o-b)*e/p;P(m,h,g,n,r,_,s/p),m=n,h=r,g=_}}v=i,y=a,b=o}let L=0,R=0;for(;L<o.length;){let e=o.indexOf(`\n`,L);e<0&&(e=o.length);let t=o.slice(L,e).trim();if(L=e+1,s&&++R%5e4==0&&s(L/o.length),!t)continue;if(t[0]===`;`){F(t);continue}let n=t.indexOf(`;`),r=(n<0?t:t.slice(0,n)).trim(),i=r.match(/^([GMgm])(\\d+(?:\\.\\d+)?)(?=\\s|$)/);if(!i||i[2].includes(`.`))continue;let c=i[1].toUpperCase(),l=Number(i[2]);if(c===`G`&&l<=3)I(l,a(r.slice(i[0].length)));else if(c===`G`&&l===90)S=!1;else if(c===`G`&&l===91)S=!0;else if(c===`M`&&l===82)C=!1;else if(c===`M`&&l===83)C=!0;else if(c===`G`&&l===92){let e=a(r.slice(i[0].length));Object.keys(e).length||(v=y=b=x=0),`X`in e&&(v=e.X),`Y`in e&&(y=e.Y),`Z`in e&&(b=e.Z),`E`in e&&(x=e.E)}}s&&s(1);let z=m.printable_area?m.printable_area.split(`,`).map(e=>e.split(`x`).map(Number)):null;return Object.assign(h,{generatedBy:h.generatedBy??null,printer:m.printer_settings_id||null,process:m.print_settings_id||null,filament:m.filament_settings_id||null,filamentType:m.filament_type||null,nozzle:r(m.nozzle_diameter),layerHeight:r(m.layer_height),bed:z&&z.every(e=>e.length===2&&e.every(Number.isFinite))?z:null,bedHeight:r(m.printable_height),printTime:h.printTime??null,totalTime:h.totalTime??null,filamentG:h.filamentG??null,filamentMm:h.filamentMm??null,filamentCm3:h.filamentCm3??null}),{segments:{count:l.feature.n,start:l.start.done(),end:l.end.done(),feature:l.feature.done(),layer:l.layer.done(),width:l.width.done(),height:l.height.done()},travels:{count:u.layer.n,pos:u.pos.done(),layer:u.layer.done()},layers:d,features:f,meta:h,bounds:l.feature.n?{min:g,max:_}:null}}\n/*!\nfflate - fast JavaScript compression/decompression\n<https://101arrowz.github.io/fflate>\nLicensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE\nversion 0.8.2\n*/\nvar s=Uint8Array,c=Uint16Array,l=Int32Array,u=new s([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),d=new s([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new s([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p=function(e,t){for(var n=new c(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new l(n[30]),r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},m=p(u,2),h=m.b,g=m.r;h[28]=258,g[258]=28;var _=p(d,0),v=_.b;_.r;for(var y=new c(32768),b=0;b<32768;++b){var x=(b&43690)>>1|(b&21845)<<1;x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,y[b]=((x&65280)>>8|(x&255)<<8)>>1}for(var S=(function(e,t,n){for(var r=e.length,i=0,a=new c(t);i<r;++i)e[i]&&++a[e[i]-1];var o=new c(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(n){s=new c(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],f=o[e[i]-1]++<<d,p=f|(1<<d)-1;f<=p;++f)s[y[f]>>l]=u}else for(s=new c(r),i=0;i<r;++i)e[i]&&(s[i]=y[o[e[i]-1]++]>>15-e[i]);return s}),C=new s(288),b=0;b<144;++b)C[b]=8;for(var b=144;b<256;++b)C[b]=9;for(var b=256;b<280;++b)C[b]=7;for(var b=280;b<288;++b)C[b]=8;for(var w=new s(32),b=0;b<32;++b)w[b]=5;var T=/*#__PURE__*/ S(C,9,1),E=/*#__PURE__*/ S(w,5,1),D=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},O=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},k=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},A=function(e){return(e+7)/8|0},j=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new s(e.subarray(t,n))},M=[`unexpected EOF`,`invalid block type`,`invalid length/literal`,`invalid distance`,`stream finished`,`no stream handler`,,`no callback`,`invalid UTF-8 data`,`extra field too long`,`date not in range 1980-2099`,`filename too long`,`stream finishing`,`invalid zip data`],N=function(e,t,n){var r=Error(t||M[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,N),!n)throw r;return r},P=function(e,t,n,r){var i=e.length,a=r?r.length:0;if(!i||t.f&&!t.l)return n||new s(0);var o=!n,c=o||t.i!=2,l=t.i;o&&(n=new s(i*3));var p=function(e){var t=n.length;if(e>t){var r=new s(Math.max(t*2,e));r.set(n),n=r}},m=t.f||0,g=t.p||0,_=t.b||0,y=t.l,b=t.d,x=t.m,C=t.n,w=i*8;do{if(!y){m=O(e,g,1);var M=O(e,g+1,3);if(g+=3,!M){var P=A(g)+4,F=e[P-4]|e[P-3]<<8,I=P+F;if(I>i){l&&N(0);break}c&&p(_+F),n.set(e.subarray(P,I),_),t.b=_+=F,t.p=g=I*8,t.f=m;continue}if(M==1)y=T,b=E,x=9,C=5;else if(M==2){var L=O(e,g,31)+257,R=O(e,g+10,15)+4,z=L+O(e,g+5,31)+1;g+=14;for(var B=new s(z),V=new s(19),H=0;H<R;++H)V[f[H]]=O(e,g+H*3,7);g+=R*3;for(var U=D(V),W=(1<<U)-1,ee=S(V,U,1),H=0;H<z;){var G=ee[O(e,g,W)];g+=G&15;var P=G>>4;if(P<16)B[H++]=P;else{var K=0,q=0;for(P==16?(q=3+O(e,g,3),g+=2,K=B[H-1]):P==17?(q=3+O(e,g,7),g+=3):P==18&&(q=11+O(e,g,127),g+=7);q--;)B[H++]=K}}var te=B.subarray(0,L),J=B.subarray(L);x=D(te),C=D(J),y=S(te,x,1),b=S(J,C,1)}else N(1);if(g>w){l&&N(0);break}}c&&p(_+131072);for(var ne=(1<<x)-1,re=(1<<C)-1,Y=g;;Y=g){var K=y[k(e,g)&ne],X=K>>4;if(g+=K&15,g>w){l&&N(0);break}if(K||N(2),X<256)n[_++]=X;else if(X==256){Y=g,y=null;break}else{var ie=X-254;if(X>264){var H=X-257,Z=u[H];ie=O(e,g,(1<<Z)-1)+h[H],g+=Z}var Q=b[k(e,g)&re],$=Q>>4;Q||N(3),g+=Q&15;var J=v[$];if($>3){var Z=d[$];J+=k(e,g)&(1<<Z)-1,g+=Z}if(g>w){l&&N(0);break}c&&p(_+131072);var ae=_+ie;if(_<J){var oe=a-J,se=Math.min(J,ae);for(oe+_<0&&N(3);_<se;++_)n[_]=r[oe+_]}for(;_<ae;++_)n[_]=n[_-J]}}t.l=y,t.p=Y,t.b=_,t.f=m,y&&(m=1,t.m=x,t.d=b,t.n=C)}while(!m);return _!=n.length&&o?j(n,0,_):n.subarray(0,_)},F=/*#__PURE__*/ new s(0),I=function(e,t){return e[t]|e[t+1]<<8},L=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},R=function(e,t){return L(e,t)+L(e,t+4)*4294967296};function z(e,t){return P(e,{i:2},t&&t.out,t&&t.dictionary)}var B=typeof TextDecoder<`u`&&/*#__PURE__*/ new TextDecoder;try{B.decode(F,{stream:!0})}catch{}var V=function(e){for(var t=``,n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return{s:t,r:j(e,n-1)};i?i==3?(r=((r&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)):i&1?t+=String.fromCharCode((r&31)<<6|e[n++]&63):t+=String.fromCharCode((r&15)<<12|(e[n++]&63)<<6|e[n++]&63):t+=String.fromCharCode(r)}};function H(e,t){if(t){for(var n=``,r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(B)return B.decode(e);var i=V(e),a=i.s,n=i.r;return n.length&&N(8),a}var U=function(e,t){return t+30+I(e,t+26)+I(e,t+28)},W=function(e,t,n){var r=I(e,t+28),i=H(e.subarray(t+46,t+46+r),!(I(e,t+8)&2048)),a=t+46+r,o=L(e,t+20),s=n&&o==4294967295?ee(e,a):[o,L(e,t+24),L(e,t+42)],c=s[0],l=s[1],u=s[2];return[I(e,t+10),c,l,i,a+I(e,t+30)+I(e,t+32),u]},ee=function(e,t){for(;I(e,t)!=1;t+=4+I(e,t+2));return[R(e,t+12),R(e,t+4),R(e,t+20)]};function G(e,t){for(var n={},r=e.length-22;L(e,r)!=101010256;--r)(!r||e.length-r>65558)&&N(13);var i=I(e,r+8);if(!i)return{};var a=L(e,r+16),o=a==4294967295||i==65535;if(o){var c=L(e,r-12);o=L(e,c)==101075792,o&&(i=L(e,c+32),a=L(e,c+48))}for(var l=t&&t.filter,u=0;u<i;++u){var d=W(e,a,o),f=d[0],p=d[1],m=d[2],h=d[3],g=d[4],_=d[5],v=U(e,_);a=g,(!l||l({name:h,size:p,originalSize:m,compression:f}))&&(f?f==8?n[h]=z(e.subarray(v,v+p),{out:new s(m)}):N(14,`unknown compression type `+f):n[h]=j(e,v,v+p))}return n}Object.keys({stl:`stl`,"3mf":`3mf`,obj:`obj`,step:`step`,stp:`step`,iges:`iges`,igs:`iges`}).map(e=>`.`+e).join(`,`);function K(e,t,n=()=>{}){try{return G(e,{filter:e=>(n(e),t(e.name))})}catch{return null}}function q(e,t){let n=K(e,e=>e===`Metadata/plate_${t}.gcode`||e===`Metadata/plate_${t}.png`)||{},r=n[`Metadata/plate_${t}.gcode`];if(!r)throw Error(`This file has no G-code for plate ${t}`);return{text:new TextDecoder().decode(r),thumbnail:n[`Metadata/plate_${t}.png`]||null}}self.onmessage=async({data:e})=>{try{let t=e.text,n=null;e.plate==null?e.file&&(t=await e.file.text()):{text:t,thumbnail:n}=q(new Uint8Array(await e.file.arrayBuffer()),e.plate);let r=o(t,e=>self.postMessage({type:`progress`,value:e})),i=r.segments,a=r.travels,s=[i.start.buffer,i.end.buffer,i.feature.buffer,i.layer.buffer,i.width.buffer,i.height.buffer,a.pos.buffer,a.layer.buffer];self.postMessage({type:`done`,result:r,thumbnail:n},n?[...s,n.buffer]:s)}catch(e){self.postMessage({type:`error`,message:e.message})}};',uD=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,lD],{type:`text/javascript;charset=utf-8`});function dD(e){let t;try{if(t=uD&&(self.URL||self.webkitURL).createObjectURL(uD),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(lD),{type:`module`,name:e?.name})}}function fD(){let[e,t]=(0,I.useState)({status:`empty`}),n=(0,I.useRef)(null),r=(0,I.useRef)(null),i=()=>{n.current?.terminate(),n.current=null},a=()=>{r.current&&URL.revokeObjectURL(r.current),r.current=null},o=(0,I.useCallback)((e,o,s=null,{plate:c=null}={})=>{i(),a();let l=typeof e==`string`?e:null,u=l==null?s?e:null:new Blob([l],{type:`text/plain`});t({status:`loading`,name:o,text:l,download:u,quote:s,plate:c,progress:0});let d=e=>{i(),t(t=>({...t,status:`error`,error:`Could not read this G-code: `+e}))},f=n.current=new dD;f.onmessage=({data:e})=>{if(e.type===`progress`)t(t=>({...t,progress:e.value}));else if(e.type===`error`)d(e.message);else if(e.type===`done`){i();let n=e.result;e.thumbnail&&(r.current=URL.createObjectURL(new Blob([e.thumbnail],{type:`image/png`}))),t(e=>n.segments.count?{...e,status:`ready`,result:n,thumbnail:r.current}:{...e,status:`error`,error:`No extrusion moves found. Is this a G-code file?`})}},f.onerror=e=>d(e.message||`parser failed`),f.postMessage(l==null?{file:e,plate:c}:{text:l})},[]),s=(0,I.useCallback)(()=>{i(),a(),t({status:`empty`})},[]);return(0,I.useEffect)(()=>()=>{i(),a()},[]),{...e,open:o,close:s}}var pD=e=>Math.max(1,Math.ceil(e/2)),mD=e=>Math.floor(e/2),hD={items:[],selected:null},gD=(e,t,n)=>e.items.some(e=>e.id===t)?{...e,items:e.items.map(e=>e.id===t?n(e):e)}:e;function _D(e,t){switch(t.type){case`add`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults,r=t.files.slice(0,10-e.items.length).map(({id:e,file:t})=>({id:e,file:t,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}));return r.length?{items:[...e.items,...r],selected:r[0].id}:e}case`replace`:{let n=(e.items.find(t=>t.id===e.selected)||{}).settings||t.defaults;return{items:[{id:t.id,file:t.file,rot:[0,0,0],copies:1,settings:{...n},result:null,error:null}],selected:t.id}}case`remove`:{let n=e.items.findIndex(e=>e.id===t.id);if(n<0)return e;let r=e.items.filter(e=>e.id!==t.id),i=r[Math.min(n,r.length-1)];return{items:r,selected:e.selected===t.id?i?i.id:null:e.selected}}case`select`:return e.items.some(e=>e.id===t.id)?{...e,selected:t.id}:e;case`settings`:return gD(e,t.id,e=>({...e,settings:{...e.settings,...t.patch}}));case`applyToAll`:{let n=e.items.find(n=>n.id===(t.id??e.selected));return n?{...e,items:e.items.map(e=>({...e,settings:{...n.settings}}))}:e}case`copies`:return gD(e,t.id,e=>({...e,copies:typeof t.value==`function`?t.value(e.copies):t.value}));case`rotate`:return gD(e,t.id,e=>({...e,rot:t.rot}));case`result`:return gD(e,t.id,e=>({...e,result:t.result,error:null}));case`error`:return gD(e,t.id,e=>({...e,error:t.error}));default:return e}}var vD=(e,t)=>JSON.stringify([t,e.rot,[e.file.name,e.file.size,e.file.lastModified]]),yD=(e,t)=>!e.result||e.result.sig!==t||!!e.error,bD=e=>e.replace(/\.\w+$/,``);function xD({defaults:e,slice:t,requestFor:n}){let[r,i]=(0,I.useReducer)(_D,hD),a=(0,I.useRef)(0),[o,s]=(0,I.useState)(null),c=r.items.find(e=>e.id===r.selected)||null,l=e=>vD(e,n(e)),u=r.items.map(e=>({item:e,stale:!!e.result&&e.result.sig!==l(e)})),d=r.items.filter(e=>yD(e,l(e))),f=t=>{let n=10-r.items.length;if(n<=0)return Nx.error(`Up to 10 files at a time. Remove one to add another.`);i({type:`add`,defaults:e,files:t.slice(0,n).map(e=>({id:`file-${++a.current}`,file:e}))});let o=t.length-n;o>0&&Nx.error(`Up to 10 files at a time, so ${o} ${o===1?`was`:`were`} left out.`)},p=t=>i({type:`replace`,defaults:e,id:`file-${++a.current}`,file:t}),m=async({verb:e,success:r})=>{let a=(d.length?d:[c]).slice().sort((e,t)=>(t===c)-(e===c)),o=Date.now(),u=0,f=null;for(let[e,r]of a.entries()){let c=n(r),d=l(r);s({since:o,step:e+1,of:a.length,file:r.file.name,printer:c.printer});try{let e=await t.mutateAsync({model:r.file,settings:c,rot:r.rot}),n=e.gcode?new Blob([e.gcode],{type:`text/plain`}):null;i({type:`result`,id:r.id,result:{stats:e.stats,used:e.used,gcode:n,name:bD(r.file.name)+`.gcode`,material:c.material,sig:d}}),u++}catch(e){if(f=e,i({type:`error`,id:r.id,error:e.status===401?`This server needs an API key.`:e.message}),e.status===401)break}}s(null);let p=Math.max(1,Math.round((Date.now()-o)/1e3));f&&f.status===401?Nx.error(`This server needs an API key.`):u===a.length?Nx.success(r(a.length===1?a[0].file.name:`${a.length} files`,p)):a.length===1?Nx.error(f.message):Nx.error(u?`${u} of ${a.length} files ${e}. The list says what went wrong with the others.`:`None of the ${a.length} files could be ${e}. The list says why.`)},h=c&&c.id;return{items:r.items,selected:c,rows:u,todo:d,slicing:o,add:f,replace:p,sliceAll:m,setSettings:e=>i({type:`settings`,id:h,patch:e}),rotate:e=>i({type:`rotate`,id:h,rot:e}),list:{rows:u,selected:r.selected,max:10,onSelect:e=>i({type:`select`,id:e}),onRemove:e=>i({type:`remove`,id:e}),onCopies:(e,t)=>i({type:`copies`,id:e,value:t}),onApplyAll:e=>{i({type:`applyToAll`,id:e}),Nx.success(`${r.items.find(t=>t.id===e).file.name}'s settings now apply to all ${r.items.length} files`)}}}}var SD=`print-preview.theme`,CD=()=>{try{return localStorage.getItem(SD)||`system`}catch{return`system`}};function wD(){let{root:e,theme:t}=i(),[n,r]=(0,I.useState)(CD),a=t||n;return(0,I.useLayoutEffect)(()=>{let t=matchMedia(`(prefers-color-scheme: dark)`),n=()=>{e.dataset.theme=a===`dark`||a===`system`&&t.matches?`dark`:`light`};if(n(),a===`system`)return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[a,e]),(0,I.useEffect)(()=>{if(!t)try{n===`system`?localStorage.removeItem(SD):localStorage.setItem(SD,n)}catch{}},[n,t]),[a,t?null:r]}var TD=`print-preview.printer`,ED=()=>{try{return localStorage.getItem(TD)}catch{return null}},DD=[`PLA`,`PETG`,`ABS`];function OD({onMode:e}){let[t,n]=wD(),[r,i]=(0,I.useState)(KE),a=aD(),o=iD(),s=oD(r),c=fD(),l=cD(r),[u,d]=(0,I.useState)(null),f=(0,I.useRef)(null),p=(0,I.useRef)(null),[m,h]=(0,I.useState)(()=>({...gE,printer:ED()??``})),g=(0,I.useRef)(ED()!==null),_=xD({defaults:m,slice:l,requestFor:e=>e.settings}),{selected:v}=_,y=v?v.settings:m,b=e=>v?_.setSettings(e):h(t=>({...t,...e})),x=sD(y.printer,y.material,r);(0,I.useEffect)(()=>{if(typeof y.printer==`string`)try{localStorage.setItem(TD,y.printer)}catch{}},[y.printer]),(0,I.useEffect)(()=>{!g.current&&o.data&&(g.current=!0,o.data.defaultPrinter&&b({printer:o.data.defaultPrinter,process:``,filament:``}))},[o.data]),(0,I.useEffect)(()=>{(s.data&&y.printer&&!oE(s.data,y.printer)||s.error&&s.error.status!==401&&y.printer)&&b({printer:``})},[s.data,s.error,v&&v.id]);let S=y.printer?x.data&&x.data.materials:DD;(0,I.useEffect)(()=>{S&&S.length&&!S.includes(y.material)&&b({material:S.includes(`PLA`)?`PLA`:S[0],filament:``})},[S,y.material]);let C=async e=>{let{models:t,others:n}=await se(e);if(t.length){_.add(t),n.length&&Nx.error(`${n.map(e=>e.file.name).join(`, `)}: not added. Open G-code files on their own.`);return}if(!n.length)return;let{file:r,what:i}=n[0];i.kind===`gcode`?c.open(r,r.name):i.kind===`gcode3mf`&&i.plates.length===1?c.open(r,r.name,null,{plate:i.plates[0].plate}):i.kind===`gcode3mf`?d({file:r,plates:i.plates}):Nx.error(`${r.name} is not a model or G-code file. Use STL, 3MF, OBJ, STEP, IGES or G-code.`)},w=cC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:C}),T=v&&v.result;(0,I.useEffect)(()=>{T&&T.gcode?c.open(T.gcode,T.name,{stats:T.stats,used:T.used}):c.close()},[v&&v.id,T]);let E=e=>{_.rotate(e),c.status!==`empty`&&c.close()},D=_.items.find(e=>e.settings.printer===null),O=_.items.length?D?D===v?`Choose a model for this brand.`:`Choose a printer model for ${D.file.name}.`:a.isError?`The server can’t be reached.`:a.data&&!a.data.slicer?`Slicing is off on this server. You can still open G-code files.`:null:`Choose a model file to slice.`,k=[o.error,s.error,x.error,l.error].some(e=>e&&e.status===401),A=_.slicing&&{..._.slicing,title:`Slicing ${_.slicing.file}${_.slicing.of>1?` (${_.slicing.step} of ${_.slicing.of})`:``}`,printer:_.slicing.printer||`Your printer`};return/* @__PURE__ */ (0,L.jsxs)(`div`,{...w.getRootProps({className:`flex min-h-full flex-col outline-none lg:h-full`}),children:[/* @__PURE__ */ (0,L.jsx)(ww,{mode:`advanced`,onMode:e,health:a,onOpenGcode:()=>f.current.click(),apiKey:r,keyNeeded:k,onSaveKey:e=>{qE(e),i(e)},theme:t,onTheme:n}),/* @__PURE__ */ (0,L.jsx)(`input`,{ref:f,type:`file`,accept:le,hidden:!0,onChange:e=>{C([...e.target.files].slice(0,1)),e.target.value=``}}),/* @__PURE__ */ (0,L.jsx)(`input`,{ref:p,type:`file`,accept:ce,multiple:!0,hidden:!0,onChange:e=>{C([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex flex-1 flex-col lg:min-h-0 lg:flex-row`,children:[/* @__PURE__ */ (0,L.jsx)(`main`,{className:`min-w-0 lg:order-2 lg:flex-1`,children:/* @__PURE__ */ (0,L.jsx)(WE,{gcode:c,model:v&&v.file,rot:v?v.rot:[0,0,0],slicing:A,onOpenGcode:()=>f.current.click(),onChooseModel:()=>p.current.click()})}),/* @__PURE__ */ (0,L.jsx)(`div`,{className:`lg:order-1 lg:flex lg:min-h-0`,children:/* @__PURE__ */ (0,L.jsx)(wE,{files:{..._.list,onAdd:()=>p.current.click()},onFiles:C,model:v&&v.file,rot:v?v.rot:[0,0,0],onRotate:E,settings:y,onSettings:b,printers:s,ourPrinters:Hw(o.data),options:x,toSlice:_.todo.length,slicingSince:_.slicing&&_.slicing.since,blocker:O,onSlice:()=>_.sliceAll({verb:`sliced`,success:(e,t)=>`Sliced ${e} in ${t} s`})})})]}),/* @__PURE__ */ (0,L.jsx)(Ew,{show:w.isDragActive,text:`Drop models to slice them, or G-code to open it`}),/* @__PURE__ */ (0,L.jsx)(Tw,{pick:u,onClose:()=>d(null),onPick:e=>{c.open(u.file,`${u.file.name}, plate ${e}`,null,{plate:e}),d(null)}})]})}var kD=8e3;async function AD(e,t,n,r){n?.throwIfAborted();let i=new AbortController,a=()=>i.abort(),o=setTimeout(a,r);n?.addEventListener(`abort`,a);try{let n=await fetch(e,{...t,method:`POST`,headers:{"content-type":`application/json`},signal:i.signal});return n.status===200?await n.json():null}catch(e){if(e.name===`SyntaxError`)return null;throw e}finally{clearTimeout(o),n?.removeEventListener(`abort`,a)}}async function jD({authUrl:e,verifyUrl:t},n,r=kD){if(!e||!t)return`not-set-up`;try{let i=await AD(e,{credentials:`include`,body:`{}`},n,r);if(!i||typeof i.token!=`string`||!i.token)return`refused`;let a=await AD(t,{credentials:`omit`,body:JSON.stringify({token:i.token})},n,r);return a&&a.valid===!0?`granted`:`refused`}catch{return`unreachable`}}var MD={refused:`Advanced is for staff. Sign in and try again.`,unreachable:`We couldn’t check your access. Please try again.`,"not-set-up":`Advanced isn’t set up on this page.`};function ND(){return wD(),/* @__PURE__ */ (0,L.jsx)(`div`,{role:`status`,className:`flex h-full min-h-[240px] items-center justify-center text-[14px] text-muted`,children:`Checking your access…`})}function PD({onMode:e}){let{config:t,emit:n}=i(),{advanced:r}=t,a=r?JSON.stringify(r):null,[o,s]=(0,I.useState)(null);return(0,I.useEffect)(()=>{if(!a)return;let t=new AbortController;return jD(r,t.signal).then(r=>{t.signal.aborted||(r===`granted`?s(a):(Nx.error(MD[r]),n(`advanceddenied`,{reason:r}),e(`simple`)))}),()=>t.abort()},[a]),a&&o!==a?/* @__PURE__ */ (0,L.jsx)(ND,{}):/* @__PURE__ */ (0,L.jsx)(OD,{onMode:e})}function FD({title:e,aside:t,action:n}){return/* @__PURE__ */ (0,L.jsxs)(`header`,{className:`mb-3 flex items-baseline justify-between gap-4`,children:[/* @__PURE__ */ (0,L.jsx)(`h2`,{className:`font-display text-[16px] leading-tight font-semibold tracking-[-0.01em]`,children:e}),t&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`min-w-0 text-right text-[11px] text-muted`,children:t}),n]})}function ID({area:e,title:t,aside:n,action:r,className:i,children:a}){return/* @__PURE__ */ (0,L.jsxs)(`section`,{className:k(`min-w-0 rounded-[20px] bg-panel p-5`,i),style:{gridArea:e},children:[t&&/* @__PURE__ */ (0,L.jsx)(FD,{title:t,aside:n,action:r}),a]})}function LD({label:e,value:t,onChange:n,options:r,stack:i}){return/* @__PURE__ */ (0,L.jsx)(gc,{type:`single`,"aria-label":e,value:String(t),onValueChange:e=>{e&&n(e)},className:i?`grid gap-1.5`:`flex flex-wrap gap-1.5`,children:r.map(e=>/* @__PURE__ */ (0,L.jsxs)(Tc,{value:String(e.value),className:k(`flex min-h-10 items-center justify-between gap-3 rounded-[12px] bg-raise px-3.5 text-[14px] font-medium text-ink transition-colors hover:bg-rule`,`data-[state=on]:bg-accent data-[state=on]:text-accent-contrast`,!i&&`flex-1 justify-center`),children:[/* @__PURE__ */ (0,L.jsx)(`span`,{children:e.label}),e.aside&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num text-[12px] font-normal opacity-75`,children:e.aside})]},e.value))})}var RD=[{id:`FDM`,name:`Filament`,hint:`Strong everyday parts in PLA, PETG, ABS or TPU`,priced:!0},{id:`SLA`,name:`Resin`,hint:`Fine detail and smooth surfaces, for small precise parts`,priced:!1},{id:`SLS`,name:`Nylon powder`,hint:`Tough, functional nylon parts, no supports needed`,priced:!1}];function zD(e,t,n){if(!e||!e.email)return null;let r=`${e.name?`Hello ${e.name},`:`Hello,`}\n\n${n.length?`I'd like these printed in ${t}:\n${n.map(e=>`- ${e}`).join(`
|
|
55
|
+
`)}`:`I'd like some parts printed in ${t}. I'll attach the models.`}\n\nWhat they're for, and how many I need:\n\n`;return`mailto:${e.email}?subject=${encodeURIComponent(`${t} print enquiry`)}&body=${encodeURIComponent(r)}`}function BD({id:e}){let t={width:28,height:28,viewBox:`0 0 28 28`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};return e===`FDM`?/* @__PURE__ */ (0,L.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M10 4h8v5l-3 4h-2l-3-4z`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M14 13v3`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M5 20h18M7 23.5h14`})]}):e===`SLA`?/* @__PURE__ */ (0,L.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M8 5h12v6H8z`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M5 17h18l-2 6H7z`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M14 11v6`,strokeDasharray:`1.5 2`})]}):/* @__PURE__ */ (0,L.jsxs)(`svg`,{...t,children:[/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M4 18h20v6H4z`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M9 21h.01M14 21h.01M19 21h.01`,strokeWidth:2.4}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M20 4l-5 12`}),/* @__PURE__ */ (0,L.jsx)(`path`,{d:`M18 4h4`})]})}function VD({value:e,onChange:t,action:n}){let r=RD.find(t=>t.id===e);return/* @__PURE__ */ (0,L.jsxs)(ID,{area:`process`,title:`How should we print it?`,action:n,children:[/* @__PURE__ */ (0,L.jsx)(gc,{type:`single`,"aria-label":`Printing process`,value:e,onValueChange:e=>{e&&t(e)},className:`grid grid-cols-3 gap-2`,children:RD.map(e=>/* @__PURE__ */ (0,L.jsxs)(Tc,{value:e.id,className:`flex flex-col items-start gap-2 rounded-[16px] bg-raise p-3 text-left outline-offset-2 transition-colors hover:bg-rule data-[state=on]:bg-panel data-[state=on]:ring-2 data-[state=on]:ring-silver-edge`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`text-muted in-data-[state=on]:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(BD,{id:e.id})}),/* @__PURE__ */ (0,L.jsxs)(`span`,{children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`block font-display text-[18px] leading-none font-semibold`,children:e.id}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`mt-1 block text-[12px] text-muted`,children:e.name})]})]},e.id))}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-3 text-[13px] text-muted`,children:[r.hint,`.`,!r.priced&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`font-medium text-ink`,children:` Quoted by our team.`})]})]})}var HD=(0,I.lazy)(()=>import(`./chunks/ModelPreview-CYVyGDd1.js`));function UD({model:e,single:t,onChoose:n}){return/* @__PURE__ */ (0,L.jsx)(`section`,{style:{gridArea:`model`},className:k(`relative overflow-hidden rounded-[28px] lg:min-h-[480px]`,e?`min-h-[480px] bg-viewer`:`min-h-[360px] bg-panel p-3`),children:e?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(I.Suspense,{fallback:null,children:/* @__PURE__ */ (0,L.jsx)(HD,{file:e,customer:!0})}),t&&/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,onClick:n,className:`absolute right-3 bottom-3 rounded-xl bg-panel px-3.5 py-2 text-[13px] font-medium transition-colors hover:bg-raise`,children:`Choose another file`})]}):/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:n,className:`group flex h-full min-h-[336px] w-full flex-col items-center justify-center gap-3 rounded-[20px] border-2 border-dashed border-rule bg-raise px-6 text-center transition-colors hover:border-accent lg:min-h-[456px]`,style:{backgroundImage:`linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px)`,backgroundSize:`28px 28px`,backgroundPosition:`center`},children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`grid size-14 place-items-center rounded-2xl bg-accent text-accent-contrast transition-transform group-hover:-translate-y-0.5`,children:/* @__PURE__ */ (0,L.jsx)(fw,{className:`size-6`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 font-display text-[24px] leading-tight font-semibold`,children:[`Drop your 3D `,t?`model`:`models`,` here`]}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`rounded-lg bg-raise px-2 text-[14px] text-muted`,children:[`or `,/* @__PURE__ */ (0,L.jsx)(`span`,{className:`font-medium text-ink underline underline-offset-4`,children:t?`choose a file`:`choose files`}),`. STL, 3MF, OBJ or STEP, up to `,t?`50 MB`:`10 files of 50 MB`]})]})})}function WD({icon:e,children:t}){return/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[/* @__PURE__ */ (0,L.jsx)(e,{className:`size-3 shrink-0`,"aria-hidden":!0}),` `,t]})}function GD({name:e,value:t,onChange:n}){let r=e=>n(t=>Math.min(50,Math.max(1,t+e))),i=`grid size-9 place-items-center rounded-lg text-ink transition-colors hover:bg-rule disabled:text-muted disabled:opacity-50`;return/* @__PURE__ */ (0,L.jsxs)(`div`,{role:`group`,"aria-label":`Copies of ${e}`,className:`flex shrink-0 items-center rounded-xl bg-raise p-0.5`,children:[/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`One copy fewer`,disabled:t<=1,onClick:()=>r(-1),className:i,children:/* @__PURE__ */ (0,L.jsx)(KC,{className:`size-3`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num w-8 text-center text-[14px] font-semibold`,"aria-live":`polite`,children:t}),/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`One copy more`,disabled:t>=50,onClick:()=>r(1),className:i,children:/* @__PURE__ */ (0,L.jsx)(QC,{className:`size-4`,"aria-hidden":!0})})]})}function KD({name:e,onApplyAll:t,onRemove:n}){let{portal:r}=i(),a=`cursor-pointer rounded-lg px-3 py-2 text-[14px] outline-none data-[highlighted]:bg-raise`;return/* @__PURE__ */ (0,L.jsxs)(Ma,{children:[/* @__PURE__ */ (0,L.jsx)(Pa,{"aria-label":`More for ${e}`,className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink`,children:/* @__PURE__ */ (0,L.jsx)(OC,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(Fa,{container:r,children:/* @__PURE__ */ (0,L.jsxs)(La,{align:`end`,sideOffset:4,className:`z-50 min-w-[240px] rounded-xl border border-rule bg-panel p-1 shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:[t&&/* @__PURE__ */ (0,L.jsx)(Ra,{className:a,onSelect:t,children:`Use these settings for all files`}),/* @__PURE__ */ (0,L.jsx)(Ra,{className:k(a,`text-danger`),onSelect:n,children:`Remove file`})]})})]})}function qD({row:{item:e,stale:t},line:n,thumb:r,on:i,priced:a,onSelect:o,onRemove:s,onCopies:c,onApplyAll:l}){let u=e.file.name,d=e.result&&e.result.stats.sizeMm||r&&r.size,f=d?/* @__PURE__ */ (0,L.jsxs)(WD,{icon:iw,children:[d.map(e=>e.toFixed(1)).join(` × `),` mm`]}):/* @__PURE__ */ (0,L.jsx)(`span`,{children:kw(e.file.size)}),p=a&&n&&!t&&!e.error;return/* @__PURE__ */ (0,L.jsxs)(`li`,{className:k(`flex flex-wrap items-center gap-x-3 gap-y-2 rounded-2xl border bg-panel p-2 transition-colors @xl:flex-nowrap`,i?`border-accent`:`border-rule`),children:[/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,"aria-current":i||void 0,onClick:o,className:`flex min-w-0 flex-1 basis-full items-center gap-3.5 rounded-xl text-left @xl:basis-0`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`grid size-[62px] shrink-0 place-items-center overflow-hidden rounded-xl bg-raise`,children:r?/* @__PURE__ */ (0,L.jsx)(`img`,{src:r.url,alt:``,className:`size-full object-contain`}):/* @__PURE__ */ (0,L.jsx)(_,{className:`size-6 text-muted`,strokeWidth:1.6,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`block truncate text-[14px] font-medium`,title:u,children:u}),e.error?/* @__PURE__ */ (0,L.jsx)(`span`,{className:`mt-1 line-clamp-2 block text-[13px] text-warn`,title:e.error,children:e.error}):/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-[12px] text-muted`,children:[p&&/* @__PURE__ */ (0,L.jsx)(WD,{icon:_,children:Yw(n.gramsRange)}),p&&/* @__PURE__ */ (0,L.jsx)(WD,{icon:wC,children:Xw(n.secondsRange)}),f,a&&!n&&/* @__PURE__ */ (0,L.jsx)(`span`,{children:`Not priced yet`}),a&&t&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`text-warn`,children:`Changed, update the price`})]})]})]}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex w-full items-center justify-end gap-3 @xl:w-auto`,children:[p&&n.range&&/* @__PURE__ */ (0,L.jsx)(`span`,{className:`num mr-auto text-[14px] font-semibold whitespace-nowrap @xl:mr-1`,children:Jw(n.range,n.currency)}),a&&/* @__PURE__ */ (0,L.jsx)(GD,{name:u,value:e.copies,onChange:c}),/* @__PURE__ */ (0,L.jsx)(KD,{name:u,onApplyAll:a?l:void 0,onRemove:s})]})]})}function JD({page:e,pages:t,first:n,last:r,count:i,onPage:a}){let o=`grid size-8 place-items-center rounded-lg text-muted transition-colors hover:bg-raise hover:text-ink disabled:opacity-40 disabled:hover:bg-transparent`;return/* @__PURE__ */ (0,L.jsxs)(`nav`,{"aria-label":`File pages`,className:`flex items-center justify-between gap-2 pt-1`,children:[/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num text-[13px] text-muted`,children:[n===r?n:`${n}–${r}`,` of `,i]}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Previous files`,disabled:e===0,onClick:()=>a(e-1),className:o,children:/* @__PURE__ */ (0,L.jsx)(vC,{className:`size-4`,"aria-hidden":!0})}),Array.from({length:t},(t,n)=>/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Page ${n+1}`,"aria-current":n===e?`page`:void 0,onClick:()=>a(n),className:k(`num grid size-8 place-items-center rounded-lg text-[13px] font-medium transition-colors`,n===e?`bg-accent text-accent-contrast`:`text-muted hover:bg-raise hover:text-ink`),children:n+1},n)),/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,"aria-label":`Next files`,disabled:e===t-1,onClick:()=>a(e+1),className:o,children:/* @__PURE__ */ (0,L.jsx)(gC,{className:`size-4`,"aria-hidden":!0})})]})]})}function YD({files:e,lineCost:t,thumbs:n,priced:r}){let i=e.rows.length,a=pD(i),[o,s]=(0,I.useState)(0),c=Math.min(o,a-1);(0,I.useEffect)(()=>{let t=e.rows.findIndex(t=>t.item.id===e.selected);t>=0&&s(mD(t))},[e.selected]);let l=e.rows.slice(c*2,(c+1)*2),u=i>0&&/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num rounded-full border border-rule px-2.5 py-0.5 text-[13px] text-muted`,children:[i,` of `,e.max]});return/* @__PURE__ */ (0,L.jsx)(ID,{area:`files`,title:`Your files`,action:u,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`@container space-y-2`,children:[i<e.max&&/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,onClick:e.onAdd,className:`flex w-full items-center gap-4 rounded-2xl border border-dashed border-rule p-2.5 text-left transition-colors hover:border-accent`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`grid size-12 shrink-0 place-items-center rounded-full bg-raise`,children:/* @__PURE__ */ (0,L.jsx)(QC,{className:`size-5`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{className:`block text-[14px] font-semibold`,children:i?`Add more files`:`Add files`}),/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`block text-[13px] text-muted`,children:[`Upload STL, 3MF, OBJ or STEP (max `,e.max,` files)`]})]})]}),i>0&&/* @__PURE__ */ (0,L.jsx)(`ul`,{className:k(`space-y-2`,a>1&&`min-h-[284px] @xl:min-h-[188px]`),children:l.map(a=>/* @__PURE__ */ (0,L.jsx)(qD,{row:a,line:a.item.result?t(a.item):null,thumb:n[a.item.id],on:a.item.id===e.selected,priced:r,onSelect:()=>e.onSelect(a.item.id),onRemove:()=>e.onRemove(a.item.id),onCopies:t=>e.onCopies(a.item.id,t),onApplyAll:i>1?()=>e.onApplyAll(a.item.id):void 0},a.item.id))}),a>1&&/* @__PURE__ */ (0,L.jsx)(JD,{page:c,pages:a,first:c*2+1,last:Math.min((c+1)*2,i),count:i,onPage:s})]})})}function XD({simple:e,onSimple:t,materials:n,printer:r}){let i=n.find(t=>t.id===e.material),a=Bw(e.material,r),o=Math.max(0,Nw.findIndex(t=>t.id===e.quality));return/* @__PURE__ */ (0,L.jsxs)(ID,{area:`material`,children:[/* @__PURE__ */ (0,L.jsx)(FD,{title:`Material`,aside:i&&i.hint}),/* @__PURE__ */ (0,L.jsx)(LD,{label:`Material`,value:e.material,onChange:e=>t({material:e}),options:n.map(e=>({value:e.id,label:e.id}))}),a&&/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-2.5 text-[13px] text-warn`,children:a}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-5 border-t border-rule pt-4`,children:[/* @__PURE__ */ (0,L.jsx)(FD,{title:`Finish`,aside:`${Nw[o].mm} mm layers`}),/* @__PURE__ */ (0,L.jsx)(hE,{bare:!0,label:`Finish`,values:Nw.map((e,t)=>t),value:o,onChange:e=>t({quality:Nw[e].id}),format:e=>Nw[e].label,valueText:e=>`${Nw[e].label}, ${Nw[e].mm} mm layers`,captions:Nw.map(e=>e.label)})]})]})}function ZD({simple:e,onSimple:t}){return/* @__PURE__ */ (0,L.jsx)(ID,{area:`strength`,title:`Strength`,children:/* @__PURE__ */ (0,L.jsx)(`div`,{className:`@container`,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`grid gap-4 @md:grid-cols-2 @md:gap-6`,children:[/* @__PURE__ */ (0,L.jsx)(hE,{label:`Infill`,values:_E,value:e.infill,onChange:e=>t({infill:e}),format:e=>`${e}%`,captions:[`Lighter`,`Stronger`]}),/* @__PURE__ */ (0,L.jsx)(hE,{label:`Walls`,values:Pw,value:e.walls,onChange:e=>t({walls:e}),format:e=>`${e} ${e===1?`wall`:`walls`}`,captions:[Pw[0],Pw[Pw.length-1]]})]})})})}var QD=`silver-fill inline-flex h-11 w-full items-center justify-center gap-2 rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90 disabled:opacity-50`;function $D({children:e}){let{portal:t}=i();return/* @__PURE__ */ (0,L.jsxs)(Xa,{children:[/* @__PURE__ */ (0,L.jsx)(Qa,{"aria-label":`How this price is worked out`,className:`grid size-6 place-items-center rounded-full opacity-75 transition-opacity hover:opacity-100`,children:/* @__PURE__ */ (0,L.jsx)(RC,{className:`size-4`,"aria-hidden":!0})}),/* @__PURE__ */ (0,L.jsx)(no,{container:t,children:/* @__PURE__ */ (0,L.jsx)(io,{side:`top`,sideOffset:4,collisionPadding:12,className:`z-50 max-w-[260px] space-y-1.5 rounded-xl border border-rule bg-panel p-3 text-[13px] text-ink shadow-[0_12px_32px_-12px_rgb(0_0_0/0.3)]`,children:e})})]})}function eO({children:e}){return/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-3 flex items-start gap-2 text-[13px] text-hero-warn`,children:[/* @__PURE__ */ (0,L.jsx)(SC,{className:`mt-px size-4 shrink-0`,"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(`span`,{children:e})]})}function tO({estimate:e,percent:t,files:n,missing:r,stale:i,pieces:a,quick:o,ready:s,slicing:c,blocker:l,onEstimate:u,onDetails:d}){let f=CE(c&&c.since),p=i+r>0,m=e&&e.range;return/* @__PURE__ */ (0,L.jsxs)(`section`,{style:{gridArea:`cost`},className:`hero @container flex min-w-0 flex-col justify-between gap-5 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[/* @__PURE__ */ (0,L.jsx)(`h2`,{className:`text-[14px] font-medium opacity-75`,children:`Estimated price`}),e&&(m||o)&&/* @__PURE__ */ (0,L.jsxs)($D,{children:[m&&/* @__PURE__ */ (0,L.jsxs)(`p`,{children:[`Worked out from the material your models use.`,t>0&&` The range runs from that price to ${t}% more.`]}),o&&/* @__PURE__ */ (0,L.jsx)(`p`,{children:`A quick estimate, from the shape of your models.`})]})]}),e?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[m?/* @__PURE__ */ (0,L.jsx)(gx.p,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.35},className:`num mt-1.5 font-display text-[34px] leading-[1.05] font-semibold tracking-[-0.02em] @sm:text-[40px]`,children:Jw(m,e.currency)},`${m.low}-${m.high}`):/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-1.5 font-display text-[24px] leading-tight font-semibold`,children:[`No price set for `,e.unpriced.join(` or `),` yet`]}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-x-5 gap-y-1 text-[13px] opacity-85`,children:[/* @__PURE__ */ (0,L.jsxs)(WD,{icon:_,children:[Yw(e.gramsRange),` of material`]}),/* @__PURE__ */ (0,L.jsxs)(WD,{icon:wC,children:[`About `,Xw(e.secondsRange)]}),n>1&&/* @__PURE__ */ (0,L.jsxs)(WD,{icon:IC,children:[n,` files, `,a,` pieces`]})]})]}):/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1.5 text-[15px] opacity-85`,children:n?`Your files are ready. Get the price when your choices are set.`:`Upload a model, and its price shows here.`}),p&&!c&&e&&/* @__PURE__ */ (0,L.jsxs)(eO,{children:[r?`${r} ${r===1?`file has`:`files have`} no price yet.`:`Your choices changed.`,` Update the price to include `,r+i===1?`it`:`them`,`.`]}),l&&!c&&n>0&&/* @__PURE__ */ (0,L.jsx)(eO,{children:l})]}),s&&e&&!c?/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,className:QD,onClick:d,children:`View details`}):/* @__PURE__ */ (0,L.jsx)(`button`,{type:`button`,className:QD,disabled:!n||!!l||!!c,onClick:u,children:c?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(w,{className:`size-[18px] animate-spin`,"aria-hidden":!0}),` Working it out`,c.of>1?`, ${c.step} of ${c.of}`:``,` `,/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`num`,children:[f,` s`]})]}):e?`Update the price`:`Get the price`})]})}var nO={SLA:`Resin is cured layer by layer with light, for fine detail and smooth surfaces: miniatures, small precise parts, moulds.`,SLS:`A laser fuses nylon powder, for tough, functional parts with no supports: clips, hinges, housings that take a beating.`};function rO({process:e,contact:t,fileNames:n}){let r=RD.find(t=>t.id===e),i=zD(t,e,n),a=t&&t.name||`our lab`;return/* @__PURE__ */ (0,L.jsxs)(`section`,{style:{gridArea:`contact`},className:`hero flex min-w-0 flex-col justify-between gap-6 rounded-[28px] p-6`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`max-w-md`,children:[/* @__PURE__ */ (0,L.jsxs)(`h2`,{className:`font-display text-[24px] leading-tight font-semibold`,children:[r.id,` prints are quoted by our team`]}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:nO[e]}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-3 text-[15px] leading-relaxed`,children:[`Email `,a,` your models and what they’re for, and we’ll reply with a price.`,n.length?` The email lists your files; attach them before you send it.`:``]})]}),i?/* @__PURE__ */ (0,L.jsxs)(`a`,{href:i,className:`silver-fill inline-flex h-11 items-center justify-center gap-2 self-start rounded-[14px] px-5 text-[15px] font-semibold transition-opacity hover:opacity-90`,children:[/* @__PURE__ */ (0,L.jsx)(WC,{className:`size-[18px]`,"aria-hidden":!0}),` Email us about `,r.id]}):/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`text-[14px] font-medium`,children:[`Ask at `,a,` for a price.`]})]})}function iO({label:e,children:t}){return/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,L.jsx)(`dt`,{className:`text-[12px] text-muted`,children:e}),/* @__PURE__ */ (0,L.jsx)(`dd`,{className:`num display mt-1 text-[18px] leading-tight font-semibold`,children:t})]})}function aO({details:e,onClose:t}){let{portal:n}=i(),r=t=>Jw(t,e.currency),a=e&&e.items.length;return/* @__PURE__ */ (0,L.jsx)(Ar,{open:!!e,onOpenChange:e=>{e||t()},children:/* @__PURE__ */ (0,L.jsxs)(Pr,{container:n,children:[/* @__PURE__ */ (0,L.jsx)(Ir,{className:`fixed inset-0 z-50 bg-black/50`}),/* @__PURE__ */ (0,L.jsxs)(Br,{className:`@container fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-32px)] w-[min(640px,calc(100%-32px))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-rule bg-panel shadow-[0_24px_64px_-24px_rgb(0_0_0/0.5)]`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-rule px-5 py-3.5`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[/* @__PURE__ */ (0,L.jsx)(Wr,{className:`text-[16px] font-semibold`,children:`Estimate details`}),/* @__PURE__ */ (0,L.jsx)(Gr,{className:`text-[13px] text-muted`,children:e&&`${a} ${a===1?`file`:`files`}, ${e.pieces} ${e.pieces===1?`piece`:`pieces`}, estimated for our ${e.printer?Vw(e.printer):`printer`}`})]}),/* @__PURE__ */ (0,L.jsx)(qr,{className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted hover:bg-raise hover:text-ink`,"aria-label":`Close`,children:/* @__PURE__ */ (0,L.jsx)(mw,{className:`size-5`,"aria-hidden":!0})})]}),e&&/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[/* @__PURE__ */ (0,L.jsx)(`ul`,{className:`min-h-0 flex-1 divide-y divide-rule overflow-y-auto px-5`,children:e.items.map((e,t)=>/* @__PURE__ */ (0,L.jsxs)(`li`,{className:`flex flex-col gap-2 py-4 @xl:flex-row @xl:items-start @xl:justify-between @xl:gap-6`,children:[/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ (0,L.jsx)(`p`,{className:`truncate text-[14px] font-medium`,title:e.title,children:e.title}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`mt-1 text-[12px] text-muted`,children:e.settings}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[12px] text-muted`,children:e.each})]}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`num flex shrink-0 items-baseline justify-between gap-3 @xl:flex-col-reverse @xl:items-end @xl:gap-0.5`,children:[/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`text-[12px] text-muted`,children:[e.quantity,` `,e.quantity===1?`copy`:`copies`]}),/* @__PURE__ */ (0,L.jsx)(`p`,{className:`text-[14px] font-semibold`,children:e.range?r(e.range):`No price`})]})]},t))}),/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`border-t border-rule bg-raise px-5 py-4`,children:[/* @__PURE__ */ (0,L.jsxs)(`dl`,{className:`grid grid-cols-3 gap-4`,children:[/* @__PURE__ */ (0,L.jsx)(iO,{label:`Total weight`,children:Yw(e.total.gramsRange)}),/* @__PURE__ */ (0,L.jsx)(iO,{label:`Total print time`,children:Xw(e.total.secondsRange)}),/* @__PURE__ */ (0,L.jsx)(iO,{label:`Total cost`,children:e.total.range?r(e.total.range):/* @__PURE__ */ (0,L.jsxs)(`span`,{className:`text-[13px] font-medium text-warn`,children:[`No price set for `,e.total.unpriced.join(` or `),` yet`]})})]}),/* @__PURE__ */ (0,L.jsxs)(`p`,{className:`mt-3 text-[12px] text-muted`,children:[e.quick?`Quick estimates from each model’s shape, not sliced, so the final figures can differ.`:`Each file is worked out on its own.`,` `,`Print time assumes the prints run one after another.`,e.percent>0&&` Cost, weight and time are ranges: the calculated figure up to ${e.percent}% more.`]})]})]})]})]})})}function oO(e){let[t,n]=(0,I.useState)(()=>matchMedia(e).matches);return(0,I.useEffect)(()=>{let t=matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function sO({theme:e,onTheme:t}){let n=oO(`(prefers-color-scheme: dark)`),r=e===`dark`||e===`system`&&n;return/* @__PURE__ */ (0,L.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":r,"aria-label":`Dark theme`,title:r?`Switch to light`:`Switch to dark`,onClick:()=>t(r?`light`:`dark`),className:`relative inline-flex h-7 w-[52px] shrink-0 items-center rounded-full bg-raise p-0.5 transition-colors hover:bg-rule`,children:[/* @__PURE__ */ (0,L.jsx)(`span`,{"aria-hidden":!0,className:k(`absolute top-0.5 left-0.5 size-6 rounded-full bg-accent transition-transform duration-200`,r&&`translate-x-6`)}),/* @__PURE__ */ (0,L.jsx)(uw,{className:k(`relative z-10 m-1 size-4 transition-colors`,r?`text-muted`:`text-accent-contrast`),"aria-hidden":!0}),/* @__PURE__ */ (0,L.jsx)(XC,{className:k(`relative z-10 m-1 size-4 transition-colors`,r?`text-accent-contrast`:`text-muted`),"aria-hidden":!0})]})}function cO(e){let[t,n]=(0,I.useState)({}),r=(0,I.useRef)(/* @__PURE__ */ new Set),i=(0,I.useRef)(Promise.resolve()),a=e.map(e=>e.id).join();return(0,I.useEffect)(()=>{for(let{id:t,file:a}of e)r.current.has(t)||(r.current.add(t),i.current=i.current.then(async()=>{if(await new Promise(e=>setTimeout(e)),!r.current.has(t))return;let{renderThumbnail:e}=await import(`./chunks/thumbnail-21laMIqI.js`),i=await e(a).catch(()=>null);i&&(r.current.has(t)?n(e=>({...e,[t]:i})):URL.revokeObjectURL(i.url))}));let t=new Set(e.map(e=>e.id));for(let e of r.current)t.has(e)||r.current.delete(e);n(e=>{let n=Object.keys(e).filter(e=>!t.has(e));return n.length?(n.forEach(t=>URL.revokeObjectURL(e[t].url)),Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))):e})},[a]),t}var lO=e=>e.map(e=>`"${e.join(` `)}"`).join(` `),uO=(e,t)=>Array(t).fill(e);function dO(e,t){let n=t=>e.has(t),r=n(`model`)?`model`:null,i=n(`files`)?`files`:null,a=t?[`material`,`strength`].filter(n):[],o=n(t?`cost`:`contact`)?t?`cost`:`contact`:null,s=[`process`,`model`,`files`,...a,o].filter(e=>e&&n(e)),c=!t&&i&&o,l=s.filter(e=>!c||e!==i&&e!==o).map(e=>uO(e,2));c&&l.push([i,o]);let u=[...n(`process`)?[`process`]:[],...a];o&&(!i||!t&&r)&&u.push(o);let d=u.length?u.map(e=>r?[r,r,e,e]:uO(e,4)):r?[uO(r,4)]:[],f=i?o?[[i,i,o,o]]:[uO(i,4)]:[];return{one:lO(s.map(e=>[e])),two:lO(l),four:lO([...d,...f])}}function fO(e,t){let n=Qw(e.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material})),t);return{currency:n.currency,range:n.range,gramsRange:n.gramsRange,secondsRange:n.secondsRange,unpriced:n.unpriced,quick:e.some(e=>e.result.stats.estimated),files:e.map(e=>{let{range:n,gramsRange:r,secondsRange:i}=Zw(e.result.stats,e.copies,e.result.material,t);return{name:e.file.name,file:e.file,copies:e.copies,settings:e.settings,range:n,gramsRange:r,secondsRange:i}})}}function pO({currency:e,perGram:t,range:n,lines:r}){let i={currency:e,perGram:t,range:n},a=Qw(r.map(e=>({stats:e.stats,copies:e.copies,material:e.settings.material})),i);return{currency:e,percent:n||0,items:r.map(({modelName:e,settings:t,stats:n,copies:r})=>{let a=Zw(n,1,t.material,i),o=Nw.find(e=>e.id===t.quality),s=`${t.walls} ${Number(t.walls)===1?`wall`:`walls`}`;return{title:e,settings:`${t.material}, ${o.label} finish (${o.mm} mm layers), ${t.infill}% infill, ${s}, ${t.supports?`with supports`:`no supports`}`,each:`about ${Yw(a.gramsRange)} and ${Xw(a.secondsRange)} each`,quantity:r,range:Zw(n,r,t.material,i).range}}),total:{gramsRange:a.gramsRange,secondsRange:a.secondsRange,range:a.range,unpriced:a.unpriced}}}function mO(){let{config:e,emit:t,actions:n}=i(),[r,a]=wD(),o=iD(),s=aD(),c=cD(KE()),[l,u]=(0,I.useState)(`FDM`),[d,f]=(0,I.useState)(()=>({...Fw,...e.defaults})),[p,m]=(0,I.useState)(null),h=(0,I.useRef)(null),g=JSON.stringify(e.defaults);(0,I.useEffect)(()=>f(t=>({...t,...e.defaults})),[g]);let _=o.data,v=_&&_.defaultPrinter||``,y=!_||_.regularMode.supports,b=Rw(_&&_.regularMode.mode,s.data?s.data.slicer:void 0),x=_?_.pricing:null,S=xD({defaults:d,slice:c,requestFor:e=>Lw({...e.settings,printer:v,supports:y,mode:b})}),{selected:C}=S,w=C?C.settings:d,T=e=>C?S.setSettings(e):f(t=>({...t,...e})),E=cO(S.items),D=tD(e),O=!D.has(`files`),k=sD(v,w.material,KE()),A=Iw(v?k.data?k.data.materials:jw.map(e=>e.id):null),ee=A.map(e=>e.id).join();(0,I.useEffect)(()=>{A.length&&!A.some(e=>e.id===w.material)&&T({material:A[0].id})},[ee,w.material]);let te=async e=>{let{models:t,others:n}=await se(e);t.length&&(O?S.replace(t[0]):S.add(t)),n.length&&Nx.error(`${n.map(e=>e.file.name).join(`, `)}: not a 3D model. Use STL, 3MF, OBJ, STEP or IGES.`)},j=cC({noClick:!0,noKeyboard:!0,multiple:!0,onDrop:te}),M=S.items.filter(e=>e.result),ne=M.map(e=>({stats:e.result.stats,copies:e.copies,material:e.result.material})),N=e=>Zw(e.result.stats,e.copies,e.result.material,x),P=S.items.length?s.isError?`The server can’t be reached.`:s.data&&!s.data.slicer&&b===`exact`?`Prices can’t be worked out right now. Please try again later.`:null:`Upload a model to get a price.`,F=()=>m({...pO({currency:x?x.currency:null,perGram:x?x.perGram:{},range:x?x.range:0,lines:S.items.map(e=>({modelName:e.file.name,settings:{...e.settings,supports:y},stats:e.result.stats,copies:e.copies}))}),printer:v,pieces:S.items.reduce((e,t)=>e+t.copies,0),quick:S.items.some(e=>e.result.stats.estimated)}),re={...S.list,onAdd:()=>h.current.click()},ie=RD.find(e=>e.id===l).priced,ae=dO(D,ie),oe=()=>S.sliceAll({verb:`priced`,success:e=>`Price ready for ${e}`}),le=ie&&M.length===S.items.length&&!S.todo.length&&!S.slicing&&S.items.length>0,ue=(0,I.useRef)(null),de=e=>{let n=fO(S.items,x),r=JSON.stringify({...n,files:n.files.map(({file:e,...t})=>t)});(e||r!==ue.current)&&t(`estimate`,n),ue.current=r};return(0,I.useEffect)(()=>{le&&de(!1)}),(0,I.useEffect)(()=>{n.getPrice=()=>{if(ie&&S.items.length&&!S.slicing&&!P)return S.todo.length?oe():de(!0)}}),/* @__PURE__ */ (0,L.jsxs)(`div`,{...j.getRootProps({className:`outline-none`}),children:[/* @__PURE__ */ (0,L.jsx)(`input`,{ref:h,type:`file`,accept:ce,multiple:!O,hidden:!0,onChange:e=>{te([...e.target.files]),e.target.value=``}}),/* @__PURE__ */ (0,L.jsx)(`main`,{className:`mx-auto w-full max-w-[1440px] p-3 sm:p-4`,children:/* @__PURE__ */ (0,L.jsxs)(`div`,{className:`bento`,style:{"--areas-one":ae.one,"--areas-two":ae.two,"--areas-four":ae.four},children:[D.has(`process`)&&/* @__PURE__ */ (0,L.jsx)(VD,{value:l,onChange:u,action:a&&/* @__PURE__ */ (0,L.jsx)(sO,{theme:r,onTheme:a})}),D.has(`model`)&&/* @__PURE__ */ (0,L.jsx)(UD,{model:C&&C.file,single:O,onChoose:()=>h.current.click()}),D.has(`files`)&&/* @__PURE__ */ (0,L.jsx)(YD,{files:re,lineCost:N,thumbs:E,priced:ie}),ie?/* @__PURE__ */ (0,L.jsxs)(L.Fragment,{children:[D.has(`material`)&&/* @__PURE__ */ (0,L.jsx)(XD,{simple:w,onSimple:T,materials:A,printer:v}),D.has(`strength`)&&/* @__PURE__ */ (0,L.jsx)(ZD,{simple:w,onSimple:T}),D.has(`cost`)&&/* @__PURE__ */ (0,L.jsx)(tO,{estimate:ne.length?Qw(ne,x):null,percent:x?x.range:0,files:S.items.length,missing:S.items.length-M.length,stale:S.rows.filter(e=>e.stale).length,pieces:S.items.reduce((e,t)=>e+t.copies,0),quick:M.some(e=>e.result.stats.estimated),ready:!S.todo.length,slicing:S.slicing,blocker:P,onDetails:F,onEstimate:oe})]}):D.has(`contact`)&&/* @__PURE__ */ (0,L.jsx)(rO,{process:l,contact:_&&_.contact,fileNames:S.items.map(e=>e.file.name)})]})}),/* @__PURE__ */ (0,L.jsx)(Ew,{show:j.isDragActive,text:`Drop your models to get a price`}),/* @__PURE__ */ (0,L.jsx)(aO,{details:p,onClose:()=>m(null)})]})}var hO=()=>new _t({defaultOptions:{queries:{staleTime:1/0,retry:!1,refetchOnWindowFocus:!1}}});function gO({mode:e,onMode:t,...n}){let[r]=(0,I.useState)(hO);return/* @__PURE__ */ (0,L.jsx)(o.Provider,{value:n,children:/* @__PURE__ */ (0,L.jsx)(z,{client:r,children:/* @__PURE__ */ (0,L.jsx)(Ay,{reducedMotion:`user`,children:/* @__PURE__ */ (0,L.jsxs)(j,{delayDuration:300,children:[e===`advanced`?/* @__PURE__ */ (0,L.jsx)(PD,{onMode:t}):/* @__PURE__ */ (0,L.jsx)(mO,{}),(0,Xt.createPortal)(/* @__PURE__ */ (0,L.jsx)(Jx,{position:`top-center`,toastOptions:{className:`!bg-panel !text-ink !border-rule`}}),n.portal)]})})})})}var _O=`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
56
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--leading-tight:1.25;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Archivo Variable", ui-sans-serif, system-ui, sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{flex-direction:column;width:100%;min-width:0;display:flex}:host([mode=advanced]){height:100dvh}.studio-theme{all:initial;color-scheme:inherit;background:var(--bench);min-height:0;color:var(--ink);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;flex-direction:column;flex:auto;font-size:14px;line-height:1.45;display:flex}.studio-layout{flex:auto;min-height:0;container:studio/inline-size}:host([mode=advanced]) .studio-layout{overflow-y:auto}:focus-visible{outline:2px solid var(--ink);outline-offset:2px}button{cursor:pointer}button:disabled{cursor:not-allowed}}@layer components{.bento{grid-template-columns:minmax(0,1fr);grid-template-areas:var(--areas-one);gap:12px;display:grid}@container studio (width>=640px){.bento{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:var(--areas-two)}}@container studio (width>=1024px){.bento{grid-template-columns:minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr);grid-template-areas:var(--areas-four)}}@container studio (width>=1280px){.bento{grid-template-columns:minmax(0,1.5fr) minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr)}}}@layer utilities{.\\@container{container-type:inline-size}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.top-0\\.5{top:calc(var(--spacing) * .5)}.top-1\\.5{top:calc(var(--spacing) * 1.5)}.top-1\\/2{top:50%}.top-3{top:calc(var(--spacing) * 3)}.top-\\[72px\\]{top:72px}.top-\\[calc\\(100\\%\\+3px\\)\\]{top:calc(100% + 3px)}.right-1\\.5{right:calc(var(--spacing) * 1.5)}.right-3{right:calc(var(--spacing) * 3)}.right-\\[calc\\(100\\%\\+10px\\)\\]{right:calc(100% + 10px)}.bottom-0{bottom:0}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-28{bottom:calc(var(--spacing) * 28)}.bottom-\\[calc\\(100\\%\\+10px\\)\\]{bottom:calc(100% + 10px)}.left-0\\.5{left:calc(var(--spacing) * .5)}.left-1\\/2{left:50%}.left-2\\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.left-\\[calc\\(100\\%\\+4px\\)\\]{left:calc(100% + 4px)}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.container{width:100%}.m-1{margin:var(--spacing)}.mx-0\\.5{margin-inline:calc(var(--spacing) * .5)}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-px{margin-top:1px}.mr-1{margin-right:var(--spacing)}.mr-auto{margin-right:auto}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-3\\.5{margin-bottom:calc(var(--spacing) * 3.5)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14)}.size-\\[18px\\]{width:18px;height:18px}.size-\\[62px\\]{width:62px;height:62px}.size-full{width:100%;height:100%}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-\\[58vh\\]{height:58vh}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\\[calc\\(100dvh-32px\\)\\]{max-height:calc(100dvh - 32px)}.min-h-0{min-height:0}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-\\[240px\\]{min-height:240px}.min-h-\\[284px\\]{min-height:284px}.min-h-\\[336px\\]{min-height:336px}.min-h-\\[340px\\]{min-height:340px}.min-h-\\[360px\\]{min-height:360px}.min-h-\\[480px\\]{min-height:480px}.min-h-full{min-height:100%}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-1\\/3{width:33.3333%}.w-5{width:calc(var(--spacing) * 5)}.w-8{width:calc(var(--spacing) * 8)}.w-16{width:calc(var(--spacing) * 16)}.w-40{width:calc(var(--spacing) * 40)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-\\[52px\\]{width:52px}.w-\\[168px\\]{width:168px}.w-\\[min\\(360px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(360px,100% - 32px)}.w-\\[min\\(560px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(560px,100% - 32px)}.w-\\[min\\(640px\\,calc\\(100\\%-32px\\)\\)\\]{width:min(640px,100% - 32px)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-\\[var\\(--radix-select-trigger-width\\)\\]{width:var(--radix-select-trigger-width)}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[260px\\]{max-width:260px}.max-w-\\[1440px\\]{max-width:1440px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\\[240px\\]{min-width:240px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-full{flex-basis:100%}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-6{--tw-translate-x:calc(var(--spacing) * 6);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.auto-cols-fr{grid-auto-columns:minmax(0,1fr)}.grid-flow-col{grid-auto-flow:column}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\\[auto_1fr\\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-3\\.5{gap:calc(var(--spacing) * 3.5)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\\.5{row-gap:calc(var(--spacing) * 1.5)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-rule>:not(:last-child)){border-color:var(--rule)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[12px\\]{border-radius:12px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[16px\\]{border-radius:16px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[28px\\]{border-radius:28px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.\\!border-rule{border-color:var(--rule)!important}.border-accent{border-color:var(--accent)}.border-ink{border-color:var(--ink)}.border-rule{border-color:var(--rule)}.\\!bg-panel{background-color:var(--panel)!important}.bg-accent{background-color:var(--accent)}.bg-bench\\/80{background-color:var(--bench)}@supports (color:color-mix(in lab, red, red)){.bg-bench\\/80{background-color:color-mix(in oklab, var(--bench) 80%, transparent)}}.bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-danger{background-color:var(--danger)}.bg-ink{background-color:var(--ink)}.bg-muted,.bg-muted\\/60{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\\/60{background-color:color-mix(in oklab, var(--muted) 60%, transparent)}}.bg-ok{background-color:var(--ok)}.bg-panel,.bg-panel\\/90{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/90{background-color:color-mix(in oklab, var(--panel) 90%, transparent)}}.bg-raise{background-color:var(--raise)}.bg-rule{background-color:var(--rule)}.bg-transparent{background-color:#0000}.bg-viewer{background-color:var(--viewer-bg)}.bg-warn{background-color:var(--warn)}.object-contain{object-fit:contain}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-7{padding-block:calc(var(--spacing) * 7)}.pt-1{padding-top:var(--spacing)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-2\\.5{padding-right:calc(var(--spacing) * 2.5)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pl-1{padding-left:var(--spacing)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-display{font-family:Bricolage Grotesque Variable,Archivo Variable,ui-sans-serif,system-ui,sans-serif}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-\\[17px\\]{font-size:17px}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[24px\\]{font-size:24px}.text-\\[34px\\]{font-size:34px}.leading-\\[1\\.05\\]{--tw-leading:1.05;line-height:1.05}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.display{letter-spacing:-.01em;font-stretch:118%}.tracking-\\[-0\\.01em\\]{--tw-tracking:-.01em;letter-spacing:-.01em}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.\\[overflow-wrap\\:anywhere\\]{overflow-wrap:anywhere}.whitespace-nowrap{white-space:nowrap}.hero{background:var(--hero);color:#f4f4f5;box-shadow:inset 0 1px 0 #ffffff1a, 0 0 0 1px var(--hero-edge)}.silver-fill{background:var(--silver);color:#111114}.\\!text-ink{color:var(--ink)!important}.text-accent-contrast{color:var(--accent-contrast)}.text-danger{color:var(--danger)}.text-hero-warn{color:var(--hero-warn)}.text-ink{color:var(--ink)}.text-ink-contrast{color:var(--ink-contrast)}.text-muted,.text-muted\\/60{color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.text-muted\\/60{color:color-mix(in oklab, var(--muted) 60%, transparent)}}.text-warn{color:var(--warn)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.num{font-variant-numeric:tabular-nums;font-stretch:112%}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-85{opacity:.85}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.3\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_12px_32px_-12px_rgb\\(0_0_0\\/0\\.35\\)\\]{--tw-shadow:0 12px 32px -12px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_24px_64px_-24px_rgb\\(0_0_0\\/0\\.5\\)\\]{--tw-shadow:0 24px 64px -24px var(--tw-shadow-color,#00000080);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-ink{--tw-ring-color:var(--ink)}.ring-offset-2{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.ring-offset-panel{--tw-ring-offset-color:var(--panel)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-offset-2{outline-offset:2px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,border-color\\,background-color\\]{transition-property:opacity,border-color,background-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\\:-translate-y-0\\.5:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}}.placeholder\\:text-muted::placeholder{color:var(--muted)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\\:border-accent:hover{border-color:var(--accent)}.hover\\:border-ink:hover{border-color:var(--ink)}.hover\\:border-muted:hover{border-color:var(--muted)}.hover\\:bg-raise:hover{background-color:var(--raise)}.hover\\:bg-rule:hover{background-color:var(--rule)}.hover\\:text-ink:hover{color:var(--ink)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:opacity-100:hover{opacity:1}}.focus\\:border-muted:focus{border-color:var(--muted)}.disabled\\:text-muted:disabled{color:var(--muted)}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}:where([data-state=on]) .in-data-\\[state\\=on\\]\\:text-ink{color:var(--ink)}.data-\\[highlighted\\]\\:bg-raise[data-highlighted],.data-\\[selected\\=true\\]\\:bg-raise[data-selected=true]{background-color:var(--raise)}.data-\\[state\\=on\\]\\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\\[state\\=on\\]\\:bg-panel[data-state=on]{background-color:var(--panel)}.data-\\[state\\=on\\]\\:text-accent-contrast[data-state=on]{color:var(--accent-contrast)}.data-\\[state\\=on\\]\\:text-ink[data-state=on]{color:var(--ink)}.data-\\[state\\=on\\]\\:shadow-\\[0_1px_2px_rgb\\(0_0_0\\/0\\.08\\)\\][data-state=on]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-2[data-state=on]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.data-\\[state\\=on\\]\\:ring-silver-edge[data-state=on]{--tw-ring-color:var(--silver-edge)}@container (width>=24rem){.\\@sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.\\@sm\\:text-\\[40px\\]{font-size:40px}}@container (width>=28rem){.\\@md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.\\@md\\:gap-6{gap:calc(var(--spacing) * 6)}}@container (width>=36rem){.\\@xl\\:mr-1{margin-right:var(--spacing)}.\\@xl\\:min-h-\\[188px\\]{min-height:188px}.\\@xl\\:w-auto{width:auto}.\\@xl\\:basis-0{flex-basis:0}.\\@xl\\:flex-col-reverse{flex-direction:column-reverse}.\\@xl\\:flex-row{flex-direction:row}.\\@xl\\:flex-nowrap{flex-wrap:nowrap}.\\@xl\\:items-end{align-items:flex-end}.\\@xl\\:items-start{align-items:flex-start}.\\@xl\\:justify-between{justify-content:space-between}.\\@xl\\:gap-0\\.5{gap:calc(var(--spacing) * .5)}.\\@xl\\:gap-6{gap:calc(var(--spacing) * 6)}}@container studio (width>=640px){.sm\\:not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.sm\\:inline{display:inline}.sm\\:inline-flex{display:inline-flex}.sm\\:w-\\[188px\\]{width:188px}.sm\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:p-4{padding:calc(var(--spacing) * 4)}}@container studio (width>=1024px){.lg\\:absolute{position:absolute}.lg\\:bottom-3{bottom:calc(var(--spacing) * 3)}.lg\\:left-3{left:calc(var(--spacing) * 3)}.lg\\:z-10{z-index:10}.lg\\:order-1{order:1}.lg\\:order-2{order:2}.lg\\:flex{display:flex}.lg\\:h-auto{height:auto}.lg\\:h-full{height:100%}.lg\\:min-h-0{min-height:0}.lg\\:min-h-\\[456px\\]{min-height:456px}.lg\\:min-h-\\[480px\\]{min-height:480px}.lg\\:w-\\[380px\\]{width:380px}.lg\\:w-auto{width:auto}.lg\\:max-w-\\[calc\\(100\\%-110px\\)\\]{max-width:calc(100% - 110px)}.lg\\:flex-1{flex:1}.lg\\:shrink-0{flex-shrink:0}.lg\\:flex-row{flex-direction:row}.lg\\:flex-nowrap{flex-wrap:nowrap}.lg\\:items-center{align-items:center}.lg\\:gap-6{gap:calc(var(--spacing) * 6)}.lg\\:overflow-y-auto{overflow-y:auto}.lg\\:border-0{border-style:var(--tw-border-style);border-width:0}.lg\\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.lg\\:bg-transparent{background-color:#0000}.lg\\:p-0{padding:0}}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2\\.5 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2.5)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pt-2 [cmdk-group-heading]{padding-top:calc(var(--spacing) * 2)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:pb-1 [cmdk-group-heading]{padding-bottom:var(--spacing)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-\\[12px\\] [cmdk-group-heading]{font-size:12px}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted [cmdk-group-heading]{color:var(--muted)}.\\[\\&\\>\\*\\]\\:pointer-events-auto>*{pointer-events:auto}}html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{width:var(--width);--gray1:#fcfcfc;--gray2:#f8f8f8;--gray3:#f3f3f3;--gray4:#ededed;--gray5:#e8e8e8;--gray6:#e2e2e2;--gray7:#dbdbdb;--gray8:#c7c7c7;--gray9:#8f8f8f;--gray10:#858585;--gray11:#6f6f6f;--gray12:#171717;--border-radius:8px;box-sizing:border-box;z-index:999999999;outline:none;margin:0;padding:0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;list-style:none;transition:transform .4s;position:fixed}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);opacity:0;transform:var(--y);touch-action:none;box-sizing:border-box;overflow-wrap:anywhere;outline:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;position:absolute}[data-sonner-toast][data-styled=true]{background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);width:var(--width);align-items:center;gap:6px;padding:16px;font-size:13px;display:flex;box-shadow:0 4px 12px #0000001a}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap));top:0}[data-sonner-toast][data-y-position=bottom]{--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap));bottom:0}[data-sonner-toast][data-styled=true] [data-description]{color:#3f3f3f;font-weight:400;line-height:1.4}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{color:inherit;font-weight:500;line-height:1.5}[data-sonner-toast][data-styled=true] [data-icon]{width:16px;height:16px;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end);flex-shrink:0;justify-content:flex-start;align-items:center;display:flex;position:relative}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform-origin:50%;animation:.3s forwards sonner-fade-in;transform:scale(.8)}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}[data-sonner-toast][data-styled=true] [data-button]{height:24px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);cursor:pointer;border:none;border-radius:4px;outline:none;flex-shrink:0;align-items:center;padding-left:8px;padding-right:8px;font-size:12px;font-weight:500;transition:opacity .4s,box-shadow .2s;display:flex}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:#00000014}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:#ffffff4d}[data-sonner-toast][data-styled=true] [data-close-button]{left:var(--toast-close-button-start);right:var(--toast-close-button-end);width:20px;height:20px;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);cursor:pointer;z-index:1;border-radius:50%;justify-content:center;align-items:center;padding:0;transition:opacity .1s,background .2s,border-color .2s;display:flex;position:absolute;top:0}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";z-index:-1;height:100%;position:absolute;left:-100%;right:-100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3)translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3)translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]:after{content:"";height:calc(var(--gap) + 1px);width:100%;position:absolute;bottom:100%;left:0}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * .05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0px)) translateX(var(--swipe-amount-x,0px));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (width<=600px){[data-sonner-toaster]{right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%;position:fixed}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{width:calc(100% - var(--mobile-offset-left) * 2);left:0;right:0}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:#ecfdf3;--success-border:#bffcd9;--success-text:#008a2e;--info-bg:#f0f8ff;--info-border:#dde7fd;--info-text:#0973dc;--warning-bg:#fffcf0;--warning-border:#fbeeb1;--warning-text:#dc7609;--error-bg:#fff0f0;--error-border:#ffe0e1;--error-text:#e60000}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:#333;--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:#1f1f1f;--normal-border:#333;--normal-border-hover:#404040;--normal-text:var(--gray1);--success-bg:#001f0f;--success-border:#003d1c;--success-text:#59f3a6;--info-bg:#000d1f;--info-border:#19233e;--info-text:#5896f3;--warning-bg:#1d1f00;--warning-border:#2e2e00;--warning-text:#f3cf58;--error-bg:#2d0607;--error-border:#4d0408;--error-text:#ff9ea1}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);z-index:10;position:absolute;inset:0}.sonner-loading-wrapper[data-visible=false]{transform-origin:50%;animation:.2s forwards sonner-fade-out}.sonner-spinner{height:var(--size);width:var(--size);position:relative;top:50%;left:50%}.sonner-loading-bar{background:var(--gray11);border-radius:6px;width:24%;height:8%;animation:1.2s linear infinite sonner-spin;position:absolute;top:-3.9%;left:-10%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg)translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg)translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg)translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg)translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg)translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg)translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg)translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg)translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg)translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg)translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg)translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg)translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{transform-origin:50%;transition:opacity .2s,transform .2s;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8)translate(-50%,-50%)}:host{--bench:#f2f2f3;--panel:#fff;--raise:#f5f5f6;--ink:#141416;--ink-contrast:#fff;--muted:#6b6d73;--rule:#e3e3e6;--accent:#18181b;--accent-contrast:#fff;--silver-edge:#b4b6bd;--hero:linear-gradient(145deg, #2a2b30 0%, #121215 55%, #050506 100%);--hero-edge:#26272b;--hero-warn:#e08a4f;--silver:linear-gradient(135deg, #f5f5f7 0%, #c9cbd1 45%, #9a9ca3 100%);--ok:#2f8f5b;--warn:#b4561f;--danger:#b8322a;--viewer-bg:#ecedee;--bed:#dddee1;--grid:#c9cacf;--bed-edge:#9c9da3;--travel:#2f6fdb;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-theme=dark]{--bench:#0b0b0d;--panel:#141417;--raise:#1c1c20;--ink:#ececef;--ink-contrast:#0b0b0d;--muted:#9a9ba2;--rule:#2a2a2f;--accent:#dcdde2;--accent-contrast:#111114;--silver-edge:#c9cbd1;--hero:linear-gradient(145deg, #3a3b41 0%, #1d1e22 60%, #101012 100%);--hero-edge:#3a3b41;--ok:#4cb27a;--warn:#e08a4f;--danger:#ef6b5f;--viewer-bg:#0f0f11;--bed:#1b1b1f;--grid:#2a2a2f;--bed-edge:#55565c;--travel:#6fa0ff;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}`,vO=/@(?:property\s+[^{]+|font-face\s*)\{[^}]*\}/g;function yO(e){let t=e.match(vO)||[];return{shadow:e.replace(vO,``),page:t.join(``)}}var bO=e=>e===`advanced`?`advanced`:`simple`,xO=e=>e===`advanced`?`advanced`:`quote`,SO=[`light`,`dark`,`system`],CO=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},wO=e=>{document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]},TO=null;function EO(){if(TO)return TO;let{shadow:e,page:t}=yO(_O);return TO=CO(e),wO(CO(t)),import(`./chunks/fonts-DxaZCWS1.js`).then(({default:e})=>wO(CO(e))),TO}function DO(){customElements.define(`slicer-studio`,class extends HTMLElement{static observedAttributes=[`api-url`,`mode`,`theme`,`config`];#e=null;#t=null;#n=null;#r={};#i={};get config(){return this.#r}set config(e){this.#r=eD(e),this.#t&&this.#o()}getPrice(){return this.#i.getPrice?.()}connectedCallback(){if(clearTimeout(this.#n),Object.hasOwn(this,`config`)){let e=this.config;delete this.config,this.config=e}this.#e||this.#a(),this.#t??=(0,Zt.createRoot)(this.#e.layout),this.#o()}disconnectedCallback(){this.#n=setTimeout(()=>{this.#t.unmount(),this.#t=null})}attributeChangedCallback(e,t,n){e===`config`?this.config=n:this.#t&&this.#o()}#a(){let e=this.attachShadow({mode:`open`});e.adoptedStyleSheets=[EO()];let t=(e,t)=>t.appendChild(Object.assign(document.createElement(`div`),{className:e})),n=t(`studio-theme`,e);this.#e={root:n,layout:t(`studio-layout`,n),portal:t(`studio-portals`,n)}}#o(){let e=this.getAttribute(`api-url`)||``,t=this.getAttribute(`theme`);this.#t.render((0,I.createElement)(I.StrictMode,null,(0,I.createElement)(gO,{key:e,...this.#e,apiUrl:e,config:this.#r,actions:this.#i,mode:bO(this.getAttribute(`mode`)),theme:SO.includes(t)?t:null,emit:(e,t)=>this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0})),onMode:e=>{this.setAttribute(`mode`,xO(e)),this.dispatchEvent(new CustomEvent(`modechange`,{detail:{mode:xO(e)},bubbles:!0,composed:!0}))}})))}})}typeof customElements<`u`&&!customElements.get(`slicer-studio`)&&DO();
|