opencami 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +60 -0
  2. package/dist/client/assets/CSPContext-EgWK8bIJ.js +1 -0
  3. package/dist/client/assets/DirectionContext-DXtY05YF.js +1 -0
  4. package/dist/client/assets/_sessionKey-B89e7G3y.js +100 -0
  5. package/dist/client/assets/agents-screen-1BiEZ9od.js +1 -0
  6. package/dist/client/assets/agents-x54ocA9z.js +2 -0
  7. package/dist/client/assets/bots-screen-BNQciUeJ.js +1 -0
  8. package/dist/client/assets/bots-x86ZHG4b.js +2 -0
  9. package/dist/client/assets/button-nDcsaNPl.js +1 -0
  10. package/dist/client/assets/{connect-D3baVDFL.js → connect-w4lLOqiJ.js} +1 -1
  11. package/dist/client/assets/file-explorer-screen-CAsjd3w8.js +1 -0
  12. package/dist/client/assets/files-Bype5Mnb.js +2 -0
  13. package/dist/client/assets/{index-ByIsZcHh.js → index-36G0WCxU.js} +1 -1
  14. package/dist/client/assets/{index-CVV4XiZo.js → index-BXkRE220.js} +2 -2
  15. package/dist/client/assets/keyboard-shortcuts-dialog-BdCeXRjD.js +1 -0
  16. package/dist/client/assets/{main-CkIF0soY.js → main-B3N0eQFg.js} +129 -17
  17. package/dist/client/assets/{opencami-logo-CIxSO1oo.js → opencami-logo-DD0DPFRQ.js} +1 -1
  18. package/dist/client/assets/{react-BhVdgA5r.js → react-B16OrBeM.js} +1 -1
  19. package/dist/client/assets/search-dialog-BjTPceEl.js +1 -0
  20. package/dist/client/assets/session-export-dialog-DtHKG2zW.js +1 -0
  21. package/dist/client/assets/settings-dialog-hiqdk_UD.js +1 -0
  22. package/dist/client/assets/skills-DhwyFq3y.js +2 -0
  23. package/dist/client/assets/skills-panel-BLUjzfjJ.js +5 -0
  24. package/dist/client/assets/styles-CHP4l6vZ.css +1 -0
  25. package/dist/client/assets/switch-J6wLIVu2.js +1 -0
  26. package/dist/client/assets/tabs-DvPgTz5I.js +1 -0
  27. package/dist/client/assets/tooltip-C14vdXHK.js +1 -0
  28. package/dist/client/assets/use-file-explorer-state-BnaJEqRP.js +12 -0
  29. package/dist/client/assets/useButton-Bnnac1eR.js +1 -0
  30. package/dist/client/assets/useCompositeItem-BgiEMKAt.js +1 -0
  31. package/dist/client/assets/{useControlled-Y306krcC.js → useControlled-BhUuiHAm.js} +1 -1
  32. package/dist/client/assets/{useMutation-0WgW4xQJ.js → useMutation-CFmVaBag.js} +1 -1
  33. package/dist/client/assets/visuallyHidden-DCCICp6T.js +9 -0
  34. package/dist/server/assets/{_sessionKey-BhFH4uWY.js → _sessionKey-tRze5NLR.js} +178 -46
  35. package/dist/server/assets/_tanstack-start-manifest_v-CyfoMvUa.js +4 -0
  36. package/dist/server/assets/{agents-Dz_i76VW.js → agents-CmQ4vvXm.js} +1 -1
  37. package/dist/server/assets/{agents-screen-CqQPJndp.js → agents-screen-bmrIyFbk.js} +43 -35
  38. package/dist/server/assets/{bots-6ryCIgKh.js → bots-Byt6jv0a.js} +1 -1
  39. package/dist/server/assets/bots-screen-C2TGFv42.js +474 -0
  40. package/dist/server/assets/{button-DtQ3rV1m.js → button-CwY2OHFj.js} +2 -2
  41. package/dist/server/assets/{connect-B8jpGQGK.js → connect-d3AqjAqe.js} +2 -2
  42. package/dist/server/assets/{file-explorer-screen-DCfS_Ajx.js → file-explorer-screen-CVlFiAFu.js} +36 -36
  43. package/dist/server/assets/{files-D2GIrPF4.js → files-BIEcSPGp.js} +1 -1
  44. package/dist/server/assets/{index-BNSsDaLb.js → index-CNIATlJ9.js} +22 -3
  45. package/dist/server/assets/{index-B2JHn34C.js → index-CRfLKh30.js} +2 -1
  46. package/dist/server/assets/{keyboard-shortcuts-dialog-CqIm8aYF.js → keyboard-shortcuts-dialog-CsNP85q8.js} +2 -2
  47. package/dist/server/assets/{router-Dme7USeO.js → router-rn7pJO_D.js} +356 -64
  48. package/dist/server/assets/{search-dialog-DG0D9KRN.js → search-dialog-Bz4Cu0KW.js} +23 -6
  49. package/dist/server/assets/{session-export-dialog-DLPZVlQV.js → session-export-dialog-CwclV0Aj.js} +2 -2
  50. package/dist/server/assets/{settings-dialog-BaGT4e5l.js → settings-dialog-BBM7jCjE.js} +386 -95
  51. package/dist/server/assets/skills-Cy8xclXY.js +11 -0
  52. package/dist/server/assets/skills-panel-BnRNb7u9.js +762 -0
  53. package/dist/server/assets/{switch-DnX0MjGS.js → switch-BbkUeVDV.js} +1 -1
  54. package/dist/server/assets/tabs-DDFZob0m.js +67 -0
  55. package/dist/server/assets/{tooltip-gbV6rEVv.js → tooltip-DgsSPocE.js} +1 -1
  56. package/dist/server/assets/{use-file-explorer-state-DfAKF2gZ.js → use-file-explorer-state-Il1LlBAe.js} +1 -1
  57. package/dist/server/server.js +2 -2
  58. package/package.json +6 -2
  59. package/dist/client/assets/_sessionKey-DB95zj1L.js +0 -97
  60. package/dist/client/assets/agents-LFrWe-HX.js +0 -2
  61. package/dist/client/assets/agents-screen-CEBBk1yO.js +0 -1
  62. package/dist/client/assets/bots-CxDwf_WK.js +0 -2
  63. package/dist/client/assets/bots-screen-D6qma1wK.js +0 -1
  64. package/dist/client/assets/button-Il3CHIzX.js +0 -1
  65. package/dist/client/assets/file-explorer-screen-rtV6n-5_.js +0 -1
  66. package/dist/client/assets/files-DMemuq9D.js +0 -2
  67. package/dist/client/assets/keyboard-shortcuts-dialog-DXC0YHoy.js +0 -1
  68. package/dist/client/assets/search-dialog-I1jJplIh.js +0 -1
  69. package/dist/client/assets/session-export-dialog-CH5unryw.js +0 -1
  70. package/dist/client/assets/settings-dialog-B8v-GVJ8.js +0 -1
  71. package/dist/client/assets/styles-BaTVzdPa.css +0 -1
  72. package/dist/client/assets/switch-sQnv1YsK.js +0 -1
  73. package/dist/client/assets/tooltip-j_viC_EE.js +0 -1
  74. package/dist/client/assets/use-file-explorer-state-BUH-u7Jv.js +0 -12
  75. package/dist/client/assets/useButton-9VAzplAB.js +0 -9
  76. package/dist/server/assets/_tanstack-start-manifest_v-BaIrL1VQ.js +0 -4
  77. package/dist/server/assets/bots-screen-DS_ZF9Ec.js +0 -417
@@ -1,12 +0,0 @@
1
- import{r as s,j as W,b as Mt}from"./main-CkIF0soY.js";import{b as lt,a5 as Ye,a6 as ft,a7 as no,f as We,a as Oe,a8 as oo,u as dt,c as je,B as ro,a9 as Ot}from"./button-Il3CHIzX.js";import{g as fn,a as le,i as Me,b as ne,v as so,f as Ve,o as dn,c as pe,h as Je,j as mt,k as io,t as at,l as ct,p as pn,d as kt,q as ao,u as ht,r as gn,s as mn,w as hn,x as ze,y as $t,z as co,B as bn,C as uo,D as lo,E as fo}from"./useButton-9VAzplAB.js";import{o as Ft,p as he,q as Ze,r as Le,v as Ae,w as zt,x as Te,y as It,z as we,B as Nt,C as po,e as De,b as Lt,D as pt,E as yn,F as At,G as qt,H as Xt,I as Fe,J as He,f as ae,K as Jt,L as Rn,M as xn,N as gt,O as Pt,P as En,Q as go,R as _e,S as vn,U as mo,V as ho,W as Zt,X as bo,Y as yo,Z as bt,_ as yt,t as Dt,$ as et,d as Cn,a0 as Sn,a1 as Qt,a2 as Be,a3 as Tn,i as Ro,A as xo,a4 as wn,a5 as Mn,a6 as On,a7 as In,a8 as Bt,a9 as Pn,aa as kn,ab as Fn,ac as Nn,ad as Z,ae as Eo,af as vo,ag as Co,ah as So,ai as To,aj as wo,ak as Ln,al as An,g as Mo,am as Oo,an as Io,ao as Po,ap as ko,aq as Fo,ar as No,as as en,at as Lo,au as Ao,av as Do}from"./tooltip-j_viC_EE.js";import{c as Bo}from"./react-BhVdgA5r.js";function tt(e,t,n){return Math.floor(e/t)!==n}function qe(e,t){return t<0||t>=e.current.length}function Ct(e,t){return me(e,{disabledIndices:t})}function tn(e,t){return me(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function me(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:i=1}={}){let r=t;do r+=n?-i:i;while(r>=0&&r<=e.current.length-1&&Xe(e,r,o));return r}function Ho(e,{event:t,orientation:n,loopFocus:o,rtl:i,cols:r,disabledIndices:g,minIndex:u,maxIndex:c,prevIndex:d,stopEvent:m=!1}){let p=d;const x=[],E={};let y=!1;{let f=null,l=-1;e.current.forEach((b,v)=>{if(b==null)return;const a=b.closest('[role="row"]');a&&(y=!0),(a!==f||l===-1)&&(f=a,l+=1,x[l]=[]),x[l].push(v),E[v]=l})}const h=y&&x.length>0&&x.some(f=>f.length!==r);function R(f){if(!h||d===-1)return;const l=E[d];if(l==null)return;const b=x[l].indexOf(d);let v=f==="up"?l-1:l+1;o&&(v<0?v=x.length-1:v>=x.length&&(v=0));const a=new Set;for(;v>=0&&v<x.length&&!a.has(v);){a.add(v);const T=x[v];if(T.length===0){v=f==="up"?v-1:v+1;continue}const I=Math.min(b,T.length-1);for(let D=I;D>=0;D-=1){const P=T[D];if(!Xe(e,P,g))return P}v=f==="up"?v-1:v+1,o&&(v<0?v=x.length-1:v>=x.length&&(v=0))}}if(t.key===Ft){const f=R("up");if(f!==void 0)m&&he(t),p=f;else{if(m&&he(t),d===-1)p=c;else if(p=me(e,{startingIndex:p,amount:r,decrement:!0,disabledIndices:g}),o&&(d-r<u||p<0)){const l=d%r,b=c%r,v=c-(b-l);b===l?p=c:p=b>l?v:v-r}qe(e,p)&&(p=d)}}if(t.key===Ze){const f=R("down");f!==void 0?(m&&he(t),p=f):(m&&he(t),d===-1?p=u:(p=me(e,{startingIndex:d,amount:r,disabledIndices:g}),o&&d+r>c&&(p=me(e,{startingIndex:d%r-r,amount:r,disabledIndices:g}))),qe(e,p)&&(p=d))}if(n==="both"){const f=zt(d/r);t.key===(i?Le:Ae)&&(m&&he(t),d%r!==r-1?(p=me(e,{startingIndex:d,disabledIndices:g}),o&&tt(p,r,f)&&(p=me(e,{startingIndex:d-d%r-1,disabledIndices:g}))):o&&(p=me(e,{startingIndex:d-d%r-1,disabledIndices:g})),tt(p,r,f)&&(p=d)),t.key===(i?Ae:Le)&&(m&&he(t),d%r!==0?(p=me(e,{startingIndex:d,decrement:!0,disabledIndices:g}),o&&tt(p,r,f)&&(p=me(e,{startingIndex:d+(r-d%r),decrement:!0,disabledIndices:g}))):o&&(p=me(e,{startingIndex:d+(r-d%r),decrement:!0,disabledIndices:g})),tt(p,r,f)&&(p=d));const l=zt(c/r)===f;qe(e,p)&&(o&&l?p=t.key===(i?Ae:Le)?c:me(e,{startingIndex:d-d%r-1,disabledIndices:g}):p=d)}return p}function Wo(e,t,n){const o=[];let i=0;return e.forEach(({width:r,height:g},u)=>{let c=!1;for(n&&(i=0);!c;){const d=[];for(let m=0;m<r;m+=1)for(let p=0;p<g;p+=1)d.push(i+m+p*t);i%t+r<=t&&d.every(m=>o[m]==null)?(d.forEach(m=>{o[m]=u}),c=!0):i+=1}}),[...o]}function jo(e,t,n,o,i){if(e===-1)return-1;const r=n.indexOf(e),g=t[e];switch(i){case"tl":return r;case"tr":return g?r+g.width-1:r;case"bl":return g?r+(g.height-1)*o:r;case"br":return n.lastIndexOf(e);default:return-1}}function Ko(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function Xe(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}let nn=0;function ut(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(nn);const r=()=>e?.focus({preventScroll:n});i?r():nn=requestAnimationFrame(r)}const Ge={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function on(e){return e==="inert"?Ge.inert:e==="aria-hidden"?Ge["aria-hidden"]:Ge.none}let nt=new WeakSet,ot={},St=0;const Dn=e=>e&&(e.host||Dn(e.parentNode)),Uo=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Dn(n);return e.contains(o)?o:null}).filter(n=>n!=null);function _o(e,t,n,o){const i="data-base-ui-inert",r=o?"inert":n?"aria-hidden":null,g=Uo(t,e),u=new Set,c=new Set(g),d=[];ot[i]||(ot[i]=new WeakMap);const m=ot[i];g.forEach(p),x(t),u.clear();function p(E){!E||u.has(E)||(u.add(E),E.parentNode&&p(E.parentNode))}function x(E){!E||c.has(E)||[].forEach.call(E.children,y=>{if(fn(y)!=="script")if(u.has(y))x(y);else{const h=r?y.getAttribute(r):null,R=h!==null&&h!=="false",f=on(r),l=(f.get(y)||0)+1,b=(m.get(y)||0)+1;f.set(y,l),m.set(y,b),d.push(y),l===1&&R&&nt.add(y),b===1&&y.setAttribute(i,""),!R&&r&&y.setAttribute(r,r==="inert"?"":"true")}})}return St+=1,()=>{d.forEach(E=>{const y=on(r),R=(y.get(E)||0)-1,f=(m.get(E)||0)-1;y.set(E,R),m.set(E,f),R||(!nt.has(E)&&r&&E.removeAttribute(r),nt.delete(E)),f||E.removeAttribute(i)}),St-=1,St||(Ge.inert=new WeakMap,Ge["aria-hidden"]=new WeakMap,Ge.none=new WeakMap,nt=new WeakSet,ot={})}}function Vo(e,t=!1,n=!1){const o=Te(e[0]).body;return _o(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}function Go(e,t){const n=mt(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const rn=20;let Ne=[];function Ht(){Ne=Ne.filter(e=>e.isConnected)}function Yo(e){Ht(),e&&fn(e)!=="body"&&(Ne.push(e),Ne.length>rn&&(Ne=Ne.slice(-rn)))}function Tt(){return Ht(),Ne[Ne.length-1]}function $o(e){if(!e)return null;const t=At();return vn(e,t)?e:yn(e,t)[0]||e}function zo(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():io(e).display!=="none"}function sn(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=At(),i=ho(e,n).filter(g=>{const u=g.getAttribute("data-tabindex")||"";return vn(g,n)||g.hasAttribute("data-tabindex")&&!u.startsWith("-")}),r=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?r!=="0"&&e.setAttribute("tabindex","0"):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Bn(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],initialFocus:r=!0,returnFocus:g=!0,restoreFocus:u=!1,modal:c=!0,closeOnFocusOut:d=!0,openInteractionType:m="",getInsideElements:p=()=>[],nextFocusableElement:x,previousFocusableElement:E,beforeContentFocusGuardRef:y,externalTree:h}=e,R="rootStore"in t?t.rootStore:t,f=R.useState("open"),l=R.useState("domReferenceElement"),b=R.useState("floatingElement"),{events:v,dataRef:a}=R.context,T=le(()=>a.current.floatingContext?.nodeId),I=le(p),D=r===!1,P=It(l)&&D,U=we(i),_=we(r),q=we(g),V=we(m),Y=Nt(h),M=po(),G=s.useRef(null),re=s.useRef(null),z=s.useRef(!1),se=s.useRef(!1),O=s.useRef(!1),te=s.useRef(-1),ce=s.useRef(""),k=s.useRef(""),be=s.useRef(null),ye=s.useRef(null),Ce=lt(be,y,M?.beforeInsideRef),ie=lt(ye,M?.afterInsideRef),Re=De(),fe=De(),Q=Lt(),$=M!=null,N=pt(b),ge=le((F=N)=>F?yn(F,At()):[]),xe=le(F=>{const w=ge(F);return U.current.map(()=>w).filter(Boolean).flat()});s.useEffect(()=>{if(o||!c)return;function F(H){H.key==="Tab"&&ae(N,He(Te(N)))&&ge().length===0&&!P&&he(H)}const w=Te(N);return w.addEventListener("keydown",F),()=>{w.removeEventListener("keydown",F)}},[o,l,N,c,U,P,ge,xe]),s.useEffect(()=>{if(o||!b)return;function F(w){const H=_e(w),X=ge().indexOf(H);X!==-1&&(te.current=X)}return b.addEventListener("focusin",F),()=>{b.removeEventListener("focusin",F)}},[o,b,ge]),s.useEffect(()=>{if(o||!f)return;const F=Te(N);function w(){O.current=!1}function H(X){const L=_e(X),j=ae(b,L)||ae(l,L)||ae(M?.portalNode,L);O.current=!j,k.current=X.pointerType||"keyboard"}function A(){k.current="keyboard"}return F.addEventListener("pointerdown",H,!0),F.addEventListener("pointerup",w,!0),F.addEventListener("pointercancel",w,!0),F.addEventListener("keydown",A,!0),()=>{F.removeEventListener("pointerdown",H,!0),F.removeEventListener("pointerup",w,!0),F.removeEventListener("pointercancel",w,!0),F.removeEventListener("keydown",A,!0)}},[o,b,l,N,f,M]),s.useEffect(()=>{if(o||!d)return;function F(){se.current=!0,fe.start(0,()=>{se.current=!1})}function w(L){const j=L.relatedTarget,C=L.currentTarget,B=_e(L);queueMicrotask(()=>{const S=T(),J=R.context.triggerElements,oe=j?.hasAttribute(qt("focus-guard"))&&[be.current,ye.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Fe(E),Fe(x)].includes(j),de=!(ae(l,j)||ae(b,j)||ae(j,b)||ae(M?.portalNode,j)||j!=null&&J.hasElement(j)||J.hasMatchingElement(ue=>ae(ue,j))||oe||Y&&(Jt(Y.nodesRef.current,S).find(ue=>ae(ue.context?.elements.floating,j)||ae(ue.context?.elements.domReference,j))||Xt(Y.nodesRef.current,S).find(ue=>[ue.context?.elements.floating,pt(ue.context?.elements.floating)].includes(j)||ue.context?.elements.domReference===j)));if(C===l&&N&&sn(N,U),u&&C!==l&&!zo(B)&&He(Te(N))===Te(N).body){if(Me(N)&&(N.focus(),u==="popup")){Q.request(()=>{N.focus()});return}const ue=te.current,Ie=ge(),Pe=Ie[ue]||Ie[Ie.length-1]||N;Me(Pe)&&Pe.focus()}if(a.current.insideReactTree){a.current.insideReactTree=!1;return}(P||!c)&&j&&de&&!se.current&&(P||j!==Tt())&&(z.current=!0,R.setOpen(!1,pe(Je,L)))})}function H(){O.current||(a.current.insideReactTree=!0,Re.start(0,()=>{a.current.insideReactTree=!1}))}const A=Me(l)?l:null,X=[];if(!(!b&&!A))return A&&(A.addEventListener("focusout",w),A.addEventListener("pointerdown",F),X.push(()=>{A.removeEventListener("focusout",w),A.removeEventListener("pointerdown",F)})),b&&(b.addEventListener("focusout",w),M&&(b.addEventListener("focusout",H,!0),X.push(()=>{b.removeEventListener("focusout",H,!0)})),X.push(()=>{b.removeEventListener("focusout",w)})),()=>{X.forEach(L=>{L()})}},[o,l,b,N,c,Y,M,R,d,u,ge,P,T,U,a,Re,fe,Q,x,E]),s.useEffect(()=>{if(o||!b||!f)return;const F=Array.from(M?.portalNode?.querySelectorAll(`[${qt("portal")}]`)||[]),H=(Y?Xt(Y.nodesRef.current,T()):[]).find(L=>It(L.context?.elements.domReference||null))?.context?.elements.domReference,A=[b,H,...F,...I(),G.current,re.current,be.current,ye.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Fe(E),Fe(x),P?l:null].filter(L=>L!=null),X=Vo(A,c||P);return()=>{X()}},[f,o,l,b,c,U,M,P,Y,T,I,x,E]),ne(()=>{if(!f||o||!Me(N))return;const F=Te(N),w=He(F);queueMicrotask(()=>{const H=xe(N),A=_.current,X=typeof A=="function"?A(V.current||""):A;if(X===void 0||X===!1)return;let L;X===!0||X===null?L=H[0]||N:L=Fe(X),L=L||H[0]||N,!ae(N,w)&&ut(L,{preventScroll:L===N})})},[o,f,N,D,xe,_,V]),ne(()=>{if(o||!N)return;const F=Te(N),w=He(F);Yo(w);function H(L){if(L.open||(ce.current=Go(L.nativeEvent,k.current)),L.reason===Ve&&L.nativeEvent.type==="mouseleave"&&(z.current=!0),L.reason===dn)if(L.nested)z.current=!1;else if(Rn(L.nativeEvent)||xn(L.nativeEvent))z.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?z.current=!1:z.current=!0}}v.on("openchange",H);const A=F.createElement("span");A.setAttribute("tabindex","-1"),A.setAttribute("aria-hidden","true"),Object.assign(A.style,so),$&&l&&l.insertAdjacentElement("afterend",A);function X(){const L=q.current;let j=typeof L=="function"?L(ce.current):L;if(j===void 0||j===!1)return null;if(j===null&&(j=!0),typeof j=="boolean"){const B=l||Tt();return B&&B.isConnected?B:A}const C=l||Tt()||A;return Fe(j)||C}return()=>{v.off("openchange",H);const L=He(F),j=ae(b,L)||Y&&Jt(Y.nodesRef.current,T(),!1).some(B=>ae(B.context?.elements.floating,L)),C=X();queueMicrotask(()=>{const B=$o(C),S=typeof q.current!="boolean";q.current&&!z.current&&Me(B)&&(!(!S&&B!==L&&L!==F.body)||j)&&B.focus({preventScroll:!0}),A.remove()})}},[o,b,N,q,a,v,Y,$,l,T]),s.useEffect(()=>{queueMicrotask(()=>{z.current=!1})},[o]),s.useEffect(()=>{if(o||!f)return;function F(H){_e(H)?.closest(`[${mo}]`)&&(se.current=!0)}const w=Te(N);return w.addEventListener("pointerdown",F,!0),()=>{w.removeEventListener("pointerdown",F,!0)}},[o,f,N]),ne(()=>{if(!o&&M)return M.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:R.setOpen,domReference:l}),()=>{M.setFocusManagerState(null)}},[o,M,c,f,R,d,l]),ne(()=>{if(!(o||!N))return sn(N,U),()=>{queueMicrotask(Ht)}},[o,N,U]);const ve=!o&&(c?!P:!0)&&($||c);return W.jsxs(s.Fragment,{children:[ve&&W.jsx(gt,{"data-type":"inside",ref:Ce,onFocus:F=>{if(c){const w=xe();ut(w[w.length-1])}else M?.portalNode&&(z.current=!1,Pt(F,M.portalNode)?En(l)?.focus():Fe(E??M.beforeOutsideRef)?.focus())}}),n,ve&&W.jsx(gt,{"data-type":"inside",ref:ie,onFocus:F=>{c?ut(xe()[0]):M?.portalNode&&(d&&(z.current=!0),Pt(F,M.portalNode)?go(l)?.focus():Fe(x??M.afterOutsideRef)?.focus())}})]})}function qo(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:i=!0,event:r="click",toggle:g=!0,ignoreMouse:u=!1,stickIfOpen:c=!0,touchOpenDelay:d=0}=t,m=s.useRef(void 0),p=Lt(),x=De(),E=s.useMemo(()=>({onPointerDown(y){m.current=y.pointerType},onMouseDown(y){const h=m.current,R=y.nativeEvent,f=n.select("open");if(y.button!==0||r==="click"||Zt(h,!0)&&u)return;const l=o.current.openEvent,b=l?.type,v=n.select("domReferenceElement")!==y.currentTarget,a=f&&v||!(f&&g&&(!(l&&c)||b==="click"||b==="mousedown"));if(yo(R.target)){const I=pe(at,R,R.target);a&&h==="touch"&&d>0?x.start(d,()=>{n.setOpen(!0,I)}):n.setOpen(a,I);return}const T=y.currentTarget;p.request(()=>{const I=pe(at,R,T);a&&h==="touch"&&d>0?x.start(d,()=>{n.setOpen(!0,I)}):n.setOpen(a,I)})},onClick(y){if(r==="mousedown-only")return;const h=m.current;if(r==="mousedown"&&h){m.current=void 0;return}if(Zt(h,!0)&&u)return;const R=n.select("open"),f=o.current.openEvent,l=n.select("domReferenceElement")!==y.currentTarget,b=R&&l||!(R&&g&&(!(f&&c)||bo(f))),v=pe(at,y.nativeEvent,y.currentTarget);b&&h==="touch"&&d>0?x.start(d,()=>{n.setOpen(!0,v)}):n.setOpen(b,v)},onKeyDown(){m.current=void 0}}),[o,r,u,n,c,g,p,x,d]);return s.useMemo(()=>i?{reference:E}:Ye,[i,E])}const Xo="Escape";function Rt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function rt(e,t){return Rt(t,e===Ft||e===Ze,e===Le||e===Ae)}function wt(e,t,n){return Rt(t,e===Ze,n?e===Le:e===Ae)||e==="Enter"||e===" "||e===""}function Jo(e,t,n){return Rt(t,n?e===Le:e===Ae,e===Ze)}function Zo(e,t,n,o){const i=n?e===Ae:e===Le,r=e===Ft;return t==="both"||t==="horizontal"&&o&&o>1?e===Xo:Rt(t,i,r)}function Qo(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),i=n.useState("floatingElement"),r=n.useState("domReferenceElement"),g=n.context.dataRef,{listRef:u,activeIndex:c,onNavigate:d=()=>{},enabled:m=!0,selectedIndex:p=null,allowEscape:x=!1,loopFocus:E=!1,nested:y=!1,rtl:h=!1,virtual:R=!1,focusItemOnOpen:f="auto",focusItemOnHover:l=!0,openOnArrowKeyDown:b=!0,disabledIndices:v=void 0,orientation:a="vertical",parentOrientation:T,cols:I=1,scrollItemIntoView:D=!0,itemSizes:P,dense:U=!1,id:_,resetOnPointerLeave:q=!0,externalTree:V}=t,Y=pt(i),M=we(Y),G=bt(),re=Nt(V);ne(()=>{g.current.orientation=a},[g,a]);const z=It(r),se=s.useRef(f),O=s.useRef(p??-1),te=s.useRef(null),ce=s.useRef(!0),k=le(C=>{d(O.current===-1?null:O.current,C)}),be=s.useRef(k),ye=s.useRef(!!i),Ce=s.useRef(o),ie=s.useRef(!1),Re=s.useRef(!1),fe=we(v),Q=we(o),$=we(D),N=we(p),ge=we(q),xe=le(()=>{function C(oe){R?re?.events.emit("virtualfocus",oe):ut(oe,{sync:ie.current,preventScroll:!0})}const B=u.current[O.current],S=Re.current;B&&C(B),(ie.current?oe=>oe():requestAnimationFrame)(()=>{const oe=u.current[O.current]||B;if(!oe)return;B||C(oe);const de=$.current;de&&F&&(S||!ce.current)&&oe.scrollIntoView?.(typeof de=="boolean"?{block:"nearest",inline:"nearest"}:de)})});ne(()=>{m&&(o&&i?(O.current=p??-1,se.current&&p!=null&&(Re.current=!0,k())):ye.current&&(O.current=-1,be.current()))},[m,o,i,p,k]),ne(()=>{if(m){if(!o){ie.current=!1;return}if(i)if(c==null){if(ie.current=!1,N.current!=null)return;if(ye.current&&(O.current=-1,xe()),(!Ce.current||!ye.current)&&se.current&&(te.current!=null||se.current===!0&&te.current==null)){let C=0;const B=()=>{u.current[0]==null?(C<2&&(C?requestAnimationFrame:queueMicrotask)(B),C+=1):(O.current=te.current==null||wt(te.current,a,h)||y?Ct(u):tn(u),te.current=null,k())};B()}}else qe(u,c)||(O.current=c,xe(),Re.current=!1)}},[m,o,i,c,N,y,u,a,h,k,xe,fe]),ne(()=>{if(!m||i||!re||R||!ye.current)return;const C=re.nodesRef.current,B=C.find(oe=>oe.id===G)?.context?.elements.floating,S=He(Te(i)),J=C.some(oe=>oe.context&&ae(oe.context.elements.floating,S));B&&!J&&ce.current&&B.focus({preventScroll:!0})},[m,i,re,G,R]),ne(()=>{be.current=k,Ce.current=o,ye.current=!!i}),ne(()=>{o||(te.current=null,se.current=f)},[o,f]);const ve=c!=null,F=s.useMemo(()=>{function C(S){if(!Q.current)return;const J=u.current.indexOf(S.currentTarget);J!==-1&&O.current!==J&&(O.current=J,k(S))}return{onFocus(S){ie.current=!0,C(S)},onClick:({currentTarget:S})=>S.focus({preventScroll:!0}),onMouseMove(S){ie.current=!0,Re.current=!1,l&&C(S)},onPointerLeave(S){if(!Q.current||!ce.current||S.pointerType==="touch")return;ie.current=!0;const J=S.relatedTarget;!l||u.current.includes(J)||ge.current&&(O.current=-1,k(S),R||M.current?.focus({preventScroll:!0}))}}},[Q,M,l,u,k,ge,R]),w=s.useCallback(()=>T??re?.nodesRef.current.find(C=>C.id===G)?.context?.dataRef?.current.orientation,[G,re,T]),H=le(C=>{if(ce.current=!1,ie.current=!0,C.which===229||!Q.current&&C.currentTarget===M.current)return;if(y&&Zo(C.key,a,h,I)){rt(C.key,w())||he(C),n.setOpen(!1,pe(ct,C.nativeEvent)),Me(r)&&(R?re?.events.emit("virtualfocus",r):r.focus());return}const B=O.current,S=Ct(u,v),J=tn(u,v);if(z||(C.key==="Home"&&(he(C),O.current=S,k(C)),C.key==="End"&&(he(C),O.current=J,k(C))),I>1){const oe=P||Array.from({length:u.current.length},()=>({width:1,height:1})),de=Wo(oe,I,U),ue=de.findIndex(Se=>Se!=null&&!Xe(u,Se,v)),Ie=de.reduce((Se,ke,K)=>ke!=null&&!Xe(u,ke,v)?K:Se,-1),Pe=de[Ho({current:de.map(Se=>Se!=null?u.current[Se]:null)},{event:C,orientation:a,loopFocus:E,rtl:h,cols:I,disabledIndices:Ko([...(typeof v!="function"?v:null)||u.current.map((Se,ke)=>Xe(u,ke,v)?ke:void 0),void 0],de),minIndex:ue,maxIndex:Ie,prevIndex:jo(O.current>J?S:O.current,oe,de,I,C.key===Ze?"bl":C.key===(h?Le:Ae)?"tr":"tl"),stopEvent:!0})];if(Pe!=null&&(O.current=Pe,k(C)),a==="both")return}if(rt(C.key,a)){if(he(C),o&&!R&&He(C.currentTarget.ownerDocument)===C.currentTarget){O.current=wt(C.key,a,h)?S:J,k(C);return}wt(C.key,a,h)?E?B>=J?x&&B!==u.current.length?O.current=-1:(ie.current=!1,O.current=S):O.current=me(u,{startingIndex:B,disabledIndices:v}):O.current=Math.min(J,me(u,{startingIndex:B,disabledIndices:v})):E?B<=S?x&&B!==-1?O.current=u.current.length:(ie.current=!1,O.current=J):O.current=me(u,{startingIndex:B,decrement:!0,disabledIndices:v}):O.current=Math.max(S,me(u,{startingIndex:B,decrement:!0,disabledIndices:v})),qe(u,O.current)&&(O.current=-1),k(C)}}),A=s.useMemo(()=>R&&o&&ve&&{"aria-activedescendant":`${_}-${c}`},[R,o,ve,_,c]),X=s.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,...z?{}:A,onKeyDown(C){if(C.key==="Tab"&&C.shiftKey&&o&&!R){const B=_e(C.nativeEvent);if(B&&!ae(M.current,B))return;he(C),n.setOpen(!1,pe(Je,C.nativeEvent)),Me(r)&&r.focus();return}H(C)},onPointerMove(){ce.current=!0}}),[A,H,M,a,z,n,o,R,r]),L=s.useMemo(()=>{function C(S){f==="auto"&&Rn(S.nativeEvent)&&(se.current=!R)}function B(S){se.current=f,f==="auto"&&xn(S.nativeEvent)&&(se.current=!0)}return{onKeyDown(S){const J=n.select("open");ce.current=!1;const oe=S.key.startsWith("Arrow"),de=Jo(S.key,w(),h),ue=rt(S.key,a),Ie=(y?de:ue)||S.key==="Enter"||S.key.trim()==="";if(R&&J)return H(S);if(!(!J&&!b&&oe)){if(Ie){const Pe=rt(S.key,w());te.current=y&&Pe?null:S.key}if(y){de&&(he(S),J?(O.current=Ct(u,fe.current),k(S)):n.setOpen(!0,pe(ct,S.nativeEvent,S.currentTarget)));return}ue&&(N.current!=null&&(O.current=N.current),he(S),!J&&b?n.setOpen(!0,pe(ct,S.nativeEvent,S.currentTarget)):H(S),J&&k(S))}},onFocus(S){n.select("open")&&!R&&(O.current=-1,k(S))},onPointerDown:B,onPointerEnter:B,onMouseDown:C,onClick:C}},[H,fe,f,u,y,k,n,b,a,w,h,N,R]),j=s.useMemo(()=>({...A,...L}),[A,L]);return s.useMemo(()=>m?{reference:j,floating:X,item:F,trigger:L}:{},[m,j,X,L,F])}const er=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Hn(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),i=n.useState("floatingId"),r=n.useState("domReferenceElement"),g=n.useState("floatingElement"),{enabled:u=!0,role:c="dialog"}=t,d=pn(),m=r?.id||d,p=s.useMemo(()=>pt(g)?.id||i,[g,i]),x=er.get(c)??c,y=bt()!=null,h=s.useMemo(()=>x==="tooltip"||c==="label"?Ye:{"aria-haspopup":x==="alertdialog"?"dialog":x,"aria-expanded":"false",...x==="listbox"&&{role:"combobox"},...x==="menu"&&y&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[x,y,c]),R=s.useMemo(()=>x==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:o?p:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?p:void 0,...x==="menu"&&{id:m}},[x,p,o,m,c,h]),f=s.useMemo(()=>{const b={id:p,...x&&{role:x}};return x==="tooltip"||c==="label"?b:{...b,...x==="menu"&&{"aria-labelledby":m}}},[x,p,m,c]),l=s.useCallback(({active:b,selected:v})=>{const a={role:"option",...b&&{id:`${p}-fui-option`}};switch(c){case"select":case"combobox":return{...a,"aria-selected":v}}return{}},[p,c]);return s.useMemo(()=>u?{reference:R,floating:f,item:l,trigger:h}:{},[u,R,f,h,l])}function tr(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),i=n.context.dataRef,{listRef:r,activeIndex:g,onMatch:u,onTypingChange:c,enabled:d=!0,findMatch:m=null,resetMs:p=750,ignoreKeys:x=ft,selectedIndex:E=null}=t,y=De(),h=s.useRef(""),R=s.useRef(E??g??-1),f=s.useRef(null);ne(()=>{o&&(y.clear(),f.current=null,h.current="")},[o,y]),ne(()=>{o&&h.current===""&&(R.current=E??g??-1)},[o,E,g]);const l=le(T=>{T?i.current.typing||(i.current.typing=T,c?.(T)):i.current.typing&&(i.current.typing=T,c?.(T))}),b=le(T=>{function I(q,V,Y){const M=m?m(V,Y):V.find(G=>G?.toLocaleLowerCase().indexOf(Y.toLocaleLowerCase())===0);return M?q.indexOf(M):-1}const D=r.current;if(h.current.length>0&&h.current[0]!==" "&&(I(D,D,h.current)===-1?l(!1):T.key===" "&&he(T)),D==null||x.includes(T.key)||T.key.length!==1||T.ctrlKey||T.metaKey||T.altKey)return;o&&T.key!==" "&&(he(T),l(!0)),D.every(q=>q?q[0]?.toLocaleLowerCase()!==q[1]?.toLocaleLowerCase():!0)&&h.current===T.key&&(h.current="",R.current=f.current),h.current+=T.key,y.start(p,()=>{h.current="",R.current=f.current,l(!1)});const U=R.current,_=I(D,[...D.slice((U||0)+1),...D.slice(0,(U||0)+1)],h.current);_!==-1?(u?.(_),f.current=_):T.key!==" "&&(h.current="",l(!1))}),v=s.useMemo(()=>({onKeyDown:b}),[b]),a=s.useMemo(()=>({onKeyDown:b,onKeyUp(T){T.key===" "&&l(!1)}}),[b,l]);return s.useMemo(()=>d?{reference:v,floating:a}:{},[d,v,a])}function Wn(e){return no(19)?e:e?"true":void 0}const jn=s.createContext(void 0);function Ke(e){const t=s.useContext(jn);if(e===!1&&t===void 0)throw new Error(We(27));return t}const nr={...yt,...Dt},or=s.forwardRef(function(t,n){const{render:o,className:i,forceRender:r=!1,...g}=t,{store:u}=Ke(),c=u.useState("open"),d=u.useState("nested"),m=u.useState("mounted"),p=u.useState("transitionStatus"),x=s.useMemo(()=>({open:c,transitionStatus:p}),[c,p]);return Oe("div",t,{state:x,ref:[u.context.backdropRef,n],stateAttributesMapping:nr,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},g],enabled:r||!d})}),rr=s.forwardRef(function(t,n){const{render:o,className:i,disabled:r=!1,nativeButton:g=!0,...u}=t,{store:c}=Ke(),d=c.useState("open");function m(y){d&&c.setOpen(!1,pe(ao,y.nativeEvent))}const{getButtonProps:p,buttonRef:x}=kt({disabled:r,native:g}),E=s.useMemo(()=>({disabled:r}),[r]);return Oe("button",t,{state:E,ref:[n,x],props:[{onClick:m},u,p]})}),sr=s.forwardRef(function(t,n){const{render:o,className:i,id:r,...g}=t,{store:u}=Ke(),c=ht(r);return u.useSyncedValueWithCleanup("descriptionElementId",c),Oe("p",t,{ref:n,props:[{id:c},g]})});let ir=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),ar=(function(e){return e[e.open=et.open]="open",e[e.closed=et.closed]="closed",e[e.startingStyle=et.startingStyle]="startingStyle",e[e.endingStyle=et.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Kn=s.createContext(void 0);function cr(){const e=s.useContext(Kn);if(e===void 0)throw new Error(We(26));return e}const Wt="ArrowUp",jt="ArrowDown",Kt="ArrowLeft",Ut="ArrowRight",xt="Home",Et="End",ur=new Set([Kt,Ut]),gs=new Set([Kt,Ut,xt,Et]),lr=new Set([Wt,jt]),ms=new Set([Wt,jt,xt,Et]),fr=new Set([...ur,...lr]),hs=new Set([...fr,xt,Et]),Un=new Set([Wt,jt,Kt,Ut,xt,Et]),dr="Shift",pr="Control",gr="Alt",mr="Meta",bs=new Set([dr,pr,gr,mr]);function hr(e){return Me(e)&&e.tagName==="INPUT"}function ys(e){return!!(hr(e)&&e.selectionStart!=null||Me(e)&&e.tagName==="TEXTAREA")}function Rs(e,t,n,o){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,r=e.scrollTop;const g=e.clientWidth<e.scrollWidth,u=e.clientHeight<e.scrollHeight;if(g&&o!=="vertical"){const c=an(e,t,"left"),d=st(e),m=st(t);n==="ltr"&&(c+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?i=c+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:c-m.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(i=c-m.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(c-m.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?i=c-m.scrollMarginLeft-d.scrollPaddingLeft:c+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(i=c+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(u&&o!=="horizontal"){const c=an(e,t,"top"),d=st(e),m=st(t);c-m.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?r=c-m.scrollMarginTop-d.scrollPaddingTop:c+t.offsetHeight+m.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(r=c+t.offsetHeight+m.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:i,top:r,behavior:"auto"})}function an(e,t,n){const o=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[o],t.offsetParent!==e);)t=t.offsetParent;return i}function st(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const br={...yt,...Dt,nestedDialogOpen(e){return e?{[ar.nestedDialogOpen]:""}:null}},yr=s.forwardRef(function(t,n){const{className:o,finalFocus:i,initialFocus:r,render:g,...u}=t,{store:c}=Ke(),d=c.useState("descriptionElementId"),m=c.useState("disablePointerDismissal"),p=c.useState("floatingRootContext"),x=c.useState("popupProps"),E=c.useState("modal"),y=c.useState("mounted"),h=c.useState("nested"),R=c.useState("nestedOpenDialogCount"),f=c.useState("open"),l=c.useState("openMethod"),b=c.useState("titleElementId"),v=c.useState("transitionStatus"),a=c.useState("role");cr(),Cn({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete?.(!0)}});function T(_){return _==="touch"?c.context.popupRef.current:!0}const I=r===void 0?T:r,D=R>0,P=s.useMemo(()=>({open:f,nested:h,transitionStatus:v,nestedDialogOpen:D}),[f,h,v,D]),U=Oe("div",t,{state:P,props:[x,{"aria-labelledby":b??void 0,"aria-describedby":d??void 0,role:a,tabIndex:-1,hidden:!y,onKeyDown(_){Un.has(_.key)&&_.stopPropagation()},style:{[ir.nestedDialogs]:R}},u],ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],stateAttributesMapping:br});return W.jsx(Bn,{context:p,openInteractionType:l,disabled:!y,closeOnFocusOut:!m,initialFocus:I,returnFocus:i,modal:E!==!1,restoreFocus:"popup",children:U})}),_n=s.forwardRef(function(t,n){const{cutout:o,...i}=t;let r;if(o){const g=o?.getBoundingClientRect();r=`polygon(
2
- 0% 0%,
3
- 100% 0%,
4
- 100% 100%,
5
- 0% 100%,
6
- 0% 0%,
7
- ${g.left}px ${g.top}px,
8
- ${g.left}px ${g.bottom}px,
9
- ${g.right}px ${g.bottom}px,
10
- ${g.right}px ${g.top}px,
11
- ${g.left}px ${g.top}px
12
- )`}return W.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:r}})}),Rr=s.forwardRef(function(t,n){const{keepMounted:o=!1,...i}=t,{store:r}=Ke(),g=r.useState("mounted"),u=r.useState("modal"),c=r.useState("open");return g||o?W.jsx(Kn.Provider,{value:o,children:W.jsxs(Sn,{ref:n,...i,children:[g&&u===!0&&W.jsx(_n,{ref:r.context.internalBackdropRef,inert:Wn(!c)}),t.children]})}):null});let cn={},un={},ln="";function xr(e){if(typeof document>"u")return!1;const t=Be(e);return mt(t).innerWidth-t.documentElement.clientWidth>0}function Er(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const o=Be(e).documentElement,i={scrollbarGutter:o.style.scrollbarGutter,overflowY:o.style.overflowY};o.style.scrollbarGutter="stable",o.style.overflowY="scroll";const r=o.offsetWidth;o.style.overflowY="hidden";const g=o.offsetWidth;return Object.assign(o.style,i),r===g}function vr(e){const t=Be(e),n=t.documentElement,o=t.body,i=gn(n)?n:o,r=i.style.overflow;return i.style.overflow="hidden",()=>{i.style.overflow=r}}function Cr(e){const t=Be(e),n=t.documentElement,o=t.body,i=mt(n);let r=0,g=0,u=!1;const c=xo.create();if(Ro&&(i.visualViewport?.scale??1)!==1)return()=>{};function d(){const x=i.getComputedStyle(n),E=i.getComputedStyle(o),R=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";r=n.scrollTop,g=n.scrollLeft,cn={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ln=n.style.scrollBehavior,un={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const f=n.scrollHeight>n.clientHeight,l=n.scrollWidth>n.clientWidth,b=x.overflowY==="scroll"||E.overflowY==="scroll",v=x.overflowX==="scroll"||E.overflowX==="scroll",a=Math.max(0,i.innerWidth-o.clientWidth),T=Math.max(0,i.innerHeight-o.clientHeight),I=parseFloat(E.marginTop)+parseFloat(E.marginBottom),D=parseFloat(E.marginLeft)+parseFloat(E.marginRight),P=gn(n)?n:o;if(u=Er(e),u){n.style.scrollbarGutter=R,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(f||b)&&(n.style.overflowY="scroll"),(l||v)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:I||T?`calc(100dvh - ${I+T}px)`:"100dvh",width:D||a?`calc(100vw - ${D+a}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=r,o.scrollLeft=g,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,cn),Object.assign(o.style,un),u||(n.scrollTop=r,n.scrollLeft=g,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=ln)}function p(){m(),c.request(d)}return d(),i.addEventListener("resize",p),()=>{c.cancel(),m(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",p)}}class Sr{lockCount=0;restore=null;timeoutLock=Qt.create();timeoutUnlock=Qt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Be(t).documentElement,i=mt(o).getComputedStyle(o).overflowY;if(i==="hidden"||i==="clip"){this.restore=oo;return}const r=Tn||!xr(t);this.restore=r?vr(t):Cr(t)}}const Tr=new Sr;function Vn(e=!0,t=null){ne(()=>{if(e)return Tr.acquire(t)},[e,t])}function wr(e){const t=s.useRef(""),n=s.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:s.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i&&e(i,i.pointerType),e(i,t.current),t.current=""},[e]),onPointerDown:n}}function Gn(e){const[t,n]=s.useState(null),o=le((u,c)=>{e||n(c||(Tn?"touch":""))}),i=s.useCallback(()=>{n(null)},[]),{onClick:r,onPointerDown:g}=wr(o);return s.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:r,onPointerDown:g}}),[t,i,r,g])}function Mr(e){const{store:t,parentContext:n,actionsRef:o}=e,i=t.useState("open"),r=t.useState("disablePointerDismissal"),g=t.useState("modal"),u=t.useState("popupElement"),{openMethod:c,triggerProps:d,reset:m}=Gn(i);wn(t);const{forceUnmount:p}=Mn(i,t,()=>{m()}),x=le(U=>{const _=pe(U);return _.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},_}),E=s.useCallback(()=>{t.setOpen(!1,x(mn))},[t,x]);s.useImperativeHandle(o,()=>({unmount:p,close:E}),[p,E]);const y=On({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,R]=s.useState(0),f=h===0,l=Hn(y),b=In(y,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:g==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(U){if("button"in U&&U.button!==0||"touches"in U&&U.touches.length!==1)return!1;const _=_e(U);if(f&&!r){const q=_;return g&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===q||t.context.backdropRef.current===q||ae(q,u)&&!q?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:f});Vn(i&&g===!0,u);const{getReferenceProps:v,getFloatingProps:a,getTriggerProps:T}=Bt([l,b]);t.useContextCallback("onNestedDialogOpen",U=>{R(U+1)}),t.useContextCallback("onNestedDialogClose",()=>{R(0)}),s.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,h]);const I=s.useMemo(()=>v(d),[v,d]),D=s.useMemo(()=>T(d),[T,d]),P=s.useMemo(()=>a(),[a]);t.useSyncedValues({openMethod:c,activeTriggerProps:I,inactiveTriggerProps:D,popupProps:P,floatingRootContext:y,nestedOpenDialogCount:h})}const Or={...Fn,modal:Z(e=>e.modal),nested:Z(e=>e.nested),nestedOpenDialogCount:Z(e=>e.nestedOpenDialogCount),disablePointerDismissal:Z(e=>e.disablePointerDismissal),openMethod:Z(e=>e.openMethod),descriptionElementId:Z(e=>e.descriptionElementId),titleElementId:Z(e=>e.titleElementId),viewportElement:Z(e=>e.viewportElement),role:Z(e=>e.role)};class Ir extends Pn{constructor(t){super(Pr(t),{popupRef:s.createRef(),backdropRef:s.createRef(),internalBackdropRef:s.createRef(),triggerElements:new kn,onOpenChange:void 0,onOpenChangeComplete:void 0},Or)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const o={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",o);const i={open:t},r=n.trigger?.id??null;(r||t)&&(i.activeTriggerId=r,i.activeTriggerElement=n.trigger??null),this.update(i)}}function Pr(e={}){return{...Nn(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function kr(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:i,onOpenChangeComplete:r,disablePointerDismissal:g=!1,modal:u=!0,actionsRef:c,handle:d,triggerId:m,defaultTriggerId:p=null}=e,x=Ke(!0),E=!!x,y=dt(()=>d?.store??new Ir({open:n??o,activeTriggerId:m!==void 0?m:p,modal:u,disablePointerDismissal:g,nested:E})).current;y.useControlledProp("open",n,o),y.useControlledProp("activeTriggerId",m,p),y.useSyncedValues({disablePointerDismissal:g,nested:E,modal:u}),y.useContextCallback("onOpenChange",i),y.useContextCallback("onOpenChangeComplete",r);const h=y.useState("payload");Mr({store:y,actionsRef:c,parentContext:x?.store.context});const R=s.useMemo(()=>({store:y}),[y]);return W.jsx(jn.Provider,{value:R,children:typeof t=="function"?t({payload:h}):t})}const Fr=s.forwardRef(function(t,n){const{render:o,className:i,id:r,...g}=t,{store:u}=Ke(),c=ht(r);return u.useSyncedValueWithCleanup("titleElementId",c),Oe("h2",t,{ref:n,props:[{id:c},g]})});function xs({children:e,...t}){return W.jsx(kr,{...t,children:e})}function Es({className:e,children:t}){return W.jsxs(Rr,{children:[W.jsx(or,{className:"fixed inset-0 bg-ink/40 transition-all duration-150 data-[state=open]:opacity-100 data-[state=closed]:opacity-0 dark:bg-surface/40"}),W.jsx(yr,{className:je("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2","w-[min(400px,92vw)] rounded-[20px] border border-primary-200 bg-primary-50 p-0 shadow-lg","transition-all duration-150","data-[state=open]:opacity-100 data-[state=closed]:opacity-0","data-[state=open]:scale-100 data-[state=closed]:scale-95",e),children:t})]})}function vs({className:e,...t}){return W.jsx(Fr,{className:je("text-lg font-medium text-primary-900",e),...t})}function Cs({className:e,...t}){return W.jsx(sr,{className:je("text-sm text-primary-600",e),...t})}function Ss({className:e,render:t,...n}){return W.jsx(rr,{render:t||W.jsx(ro,{variant:"outline",className:je(e)}),...n})}const Yn=s.createContext(void 0);function $n(e){const t=s.useContext(Yn);if(t===void 0&&!e)throw new Error(We(33));return t}const zn=s.createContext(void 0);function Ue(e){const t=s.useContext(zn);if(t===void 0&&!e)throw new Error(We(36));return t}const Nr=s.createContext(void 0);function vt(e=!0){const t=s.useContext(Nr);if(t===void 0&&!e)throw new Error(We(25));return t}const Lr={type:"regular-item"};function Ar(e){const{closeOnClick:t,disabled:n=!1,highlighted:o,id:i,store:r,nativeButton:g,itemMetadata:u,nodeId:c}=e,d=s.useRef(null),m=vt(!0),p=m!==void 0,{events:x}=r.useState("floatingTreeRoot"),{getButtonProps:E,buttonRef:y}=kt({disabled:n,focusableWhenDisabled:!0,native:g}),h=s.useCallback(f=>Ot({id:i,role:"menuitem",tabIndex:o?0:-1,onMouseMove(l){c&&x.emit("itemhover",{nodeId:c,target:l.currentTarget})},onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()},onKeyUp(l){l.key===" "&&r.context.typingRef.current&&l.preventBaseUIHandler()},onClick(l){t&&x.emit("close",{domEvent:l,reason:hn})},onMouseUp(l){if(m){const b=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,p&&b&&Math.abs(l.clientX-b.x)<=1&&Math.abs(l.clientY-b.y)<=1)return}d.current&&r.context.allowMouseUpTriggerRef.current&&(!p||l.button===2)&&u.type==="regular-item"&&d.current.click()}},f,E),[i,o,E,t,x,r,p,m,u,c]),R=lt(d,y);return s.useMemo(()=>({getItemProps:h,itemRef:R}),[h,R])}const qn=s.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Dr(){return s.useContext(qn)}let Br=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Xn(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:i,index:r}=e,{register:g,unregister:u,subscribeMapChange:c,elementsRef:d,labelsRef:m,nextIndexRef:p}=Dr(),x=s.useRef(-1),[E,y]=s.useState(r??(i===Br.GuessFromOrder?()=>{if(x.current===-1){const f=p.current;p.current+=1,x.current=f}return x.current}:-1)),h=s.useRef(null),R=s.useCallback(f=>{if(h.current=f,E!==-1&&f!==null&&(d.current[E]=f,m)){const l=t!==void 0;m.current[E]=l?t:o?.current?.textContent??f.textContent}},[E,d,m,t,o]);return ne(()=>{if(r!=null)return;const f=h.current;if(f)return g(f,n),()=>{u(f)}},[r,g,u,n]),ne(()=>{if(r==null)return c(f=>{const l=h.current?f.get(h.current)?.index:null;l!=null&&y(l)})},[r,c,y]),s.useMemo(()=>({ref:R,index:E}),[E,R])}const Hr=s.forwardRef(function(t,n){const{render:o,className:i,id:r,label:g,nativeButton:u=!1,disabled:c=!1,closeOnClick:d=!0,...m}=t,p=Xn({label:g}),x=$n(!0),E=ht(r),{store:y}=Ue(),h=y.useState("isActive",p.index),R=y.useState("itemProps"),{getItemProps:f,itemRef:l}=Ar({closeOnClick:d,disabled:c,highlighted:h,id:E,store:y,nativeButton:u,nodeId:x?.nodeId,itemMetadata:Lr}),b=s.useMemo(()=>({disabled:c,highlighted:h}),[c,h]);return Oe("div",t,{state:b,props:[R,m,f],ref:[l,n,p.ref]})}),Wr=s.createContext(void 0);function jr(e){return s.useContext(Wr)}const Kr={...yt,...Dt},Ur=s.forwardRef(function(t,n){const{render:o,className:i,finalFocus:r,...g}=t,{store:u}=Ue(),{side:c,align:d}=$n(),m=jr()!=null,p=u.useState("open"),x=u.useState("transitionStatus"),E=u.useState("popupProps"),y=u.useState("mounted"),h=u.useState("instantType"),R=u.useState("activeTriggerElement"),f=u.useState("parent"),l=u.useState("lastOpenChangeReason"),b=u.useState("rootId"),v=u.useState("floatingRootContext"),a=u.useState("floatingTreeRoot"),T=u.useState("closeDelay"),I=u.useState("activeTriggerElement"),D=f.type==="context-menu";Cn({open:p,ref:u.context.popupRef,onComplete(){p&&u.context.onOpenChangeComplete?.(!0)}}),s.useEffect(()=>{function Y(M){u.setOpen(!1,pe(M.reason,M.domEvent))}return a.events.on("close",Y),()=>{a.events.off("close",Y)}},[a.events,u]);const P=u.useState("hoverEnabled"),U=u.useState("disabled");Eo(v,{enabled:P&&!U&&!D&&f.type!=="menubar",closeDelay:T});const _=s.useMemo(()=>({transitionStatus:x,side:c,align:d,open:p,nested:f.type==="menu",instant:h}),[x,c,d,p,f.type,h]),q=Oe("div",t,{state:_,ref:[n,u.context.popupRef],stateAttributesMapping:Kr,props:[E,{onKeyDown(Y){m&&Un.has(Y.key)&&Y.stopPropagation()}},vo(x),g,{"data-rootownerid":b}]});let V=f.type===void 0||D;return(R||f.type==="menubar"&&l!==dn)&&(V=!0),W.jsx(Bn,{context:v,modal:D,disabled:!y,returnFocus:r===void 0?V:r,initialFocus:f.type!=="menu",restoreFocus:!0,externalTree:f.type!=="menubar"?a:void 0,previousFocusableElement:I,nextFocusableElement:f.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:f.type===void 0?u.context.beforeContentFocusGuardRef:void 0,children:q})}),Jn=s.createContext(void 0);function _r(){const e=s.useContext(Jn);if(e===void 0)throw new Error(We(32));return e}const Vr=s.forwardRef(function(t,n){const{keepMounted:o=!1,...i}=t,{store:r}=Ue();return r.useState("mounted")||o?W.jsx(Jn.Provider,{value:o,children:W.jsx(Sn,{ref:n,...i})}):null});function Gr(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:i}=e,r=le(i),g=s.useRef(0),u=dt($r).current,c=dt(Yr).current,[d,m]=s.useState(0),p=s.useRef(d),x=le((f,l)=>{c.set(f,l??null),p.current+=1,m(p.current)}),E=le(f=>{c.delete(f),p.current+=1,m(p.current)}),y=s.useMemo(()=>{const f=new Map;return Array.from(c.keys()).filter(b=>b.isConnected).sort(zr).forEach((b,v)=>{const a=c.get(b)??{};f.set(b,{...a,index:v})}),f},[c,d]);ne(()=>{if(typeof MutationObserver!="function"||y.size===0)return;const f=new MutationObserver(l=>{const b=new Set,v=a=>b.has(a)?b.delete(a):b.add(a);l.forEach(a=>{a.removedNodes.forEach(v),a.addedNodes.forEach(v)}),b.size===0&&(p.current+=1,m(p.current))});return y.forEach((l,b)=>{b.parentElement&&f.observe(b.parentElement,{childList:!0})}),()=>{f.disconnect()}},[y]),ne(()=>{p.current===d&&(n.current.length!==y.size&&(n.current.length=y.size),o&&o.current.length!==y.size&&(o.current.length=y.size),g.current=y.size),r(y)},[r,y,n,o,d]),ne(()=>()=>{n.current=[]},[n]),ne(()=>()=>{o&&(o.current=[])},[o]);const h=le(f=>(u.add(f),()=>{u.delete(f)}));ne(()=>{u.forEach(f=>f(y))},[u,y]);const R=s.useMemo(()=>({register:x,unregister:E,subscribeMapChange:h,elementsRef:n,labelsRef:o,nextIndexRef:g}),[x,E,h,n,o,g]);return W.jsx(qn.Provider,{value:R,children:t})}function Yr(){return new Map}function $r(){return new Set}function zr(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const qr=s.forwardRef(function(t,n){const{anchor:o,positionMethod:i="absolute",className:r,render:g,side:u,align:c,sideOffset:d=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:x=5,arrowPadding:E=5,sticky:y=!1,disableAnchorTracking:h=!1,collisionAvoidance:R=Co,...f}=t,{store:l}=Ue(),b=_r(),v=vt(!0),a=l.useState("parent"),T=l.useState("floatingRootContext"),I=l.useState("floatingTreeRoot"),D=l.useState("mounted"),P=l.useState("open"),U=l.useState("modal"),_=l.useState("activeTriggerElement"),q=l.useState("lastOpenChangeReason"),V=l.useState("floatingNodeId"),Y=l.useState("floatingParentNodeId");let M=o,G=d,re=m,z=c,se=R;a.type==="context-menu"&&(M=o??a.context?.anchor,z=z??"start",!u&&z!=="center"&&(re=t.alignOffset??2,G=t.sideOffset??-5));let O=u,te=z;a.type==="menu"?(O=O??"inline-end",te=te??"start",se=t.collisionAvoidance??So):a.type==="menubar"&&(O=O??"bottom",te=te??"start");const ce=a.type==="context-menu",k=To({anchor:M,floatingRootContext:T,positionMethod:v?"fixed":i,mounted:D,side:O,sideOffset:G,align:te,alignOffset:re,arrowPadding:ce?0:E,collisionBoundary:p,collisionPadding:x,sticky:y,nodeId:V,keepMounted:b,disableAnchorTracking:h,collisionAvoidance:se,shiftCrossAxis:ce,externalTree:I}),be=s.useMemo(()=>{const Q={};return P||(Q.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...k.positionerStyles,...Q}}},[P,D,k.positionerStyles]);s.useEffect(()=>{function Q($){$.open?($.parentNodeId===V&&l.set("hoverEnabled",!1),$.nodeId!==V&&$.parentNodeId===l.select("floatingParentNodeId")&&l.setOpen(!1,pe(ze))):$.parentNodeId===V&&$.reason!==ze&&l.set("hoverEnabled",!0)}return I.events.on("menuopenchange",Q),()=>{I.events.off("menuopenchange",Q)}},[l,I.events,V]),s.useEffect(()=>{if(l.select("floatingParentNodeId")==null)return;function Q($){if($.open||$.nodeId!==l.select("floatingParentNodeId"))return;const N=$.reason??ze;l.setOpen(!1,pe(N))}return I.events.on("menuopenchange",Q),()=>{I.events.off("menuopenchange",Q)}},[I.events,l]),s.useEffect(()=>{function Q($){!P||$.nodeId!==l.select("floatingParentNodeId")||$.target&&_&&_!==$.target&&l.setOpen(!1,pe(ze))}return I.events.on("itemhover",Q),()=>{I.events.off("itemhover",Q)}},[I.events,P,_,l]),s.useEffect(()=>{const Q={open:P,nodeId:V,parentNodeId:Y,reason:l.select("lastOpenChangeReason")};I.events.emit("menuopenchange",Q)},[I.events,P,l,V,Y]);const ye=s.useMemo(()=>({open:P,side:k.side,align:k.align,anchorHidden:k.anchorHidden,nested:a.type==="menu"}),[P,k.side,k.align,k.anchorHidden,a.type]),Ce=s.useMemo(()=>({side:k.side,align:k.align,arrowRef:k.arrowRef,arrowUncentered:k.arrowUncentered,arrowStyles:k.arrowStyles,nodeId:k.context.nodeId}),[k.side,k.align,k.arrowRef,k.arrowUncentered,k.arrowStyles,k.context.nodeId]),ie=Oe("div",t,{state:ye,stateAttributesMapping:yt,ref:[n,l.useStateSetter("positionerElement")],props:[be,f]}),Re=D&&a.type!=="menu"&&(a.type!=="menubar"&&U&&q!==Ve||a.type==="menubar"&&a.context.modal);let fe=null;return a.type==="menubar"?fe=a.context.contentElement:a.type===void 0&&(fe=_),W.jsxs(Yn.Provider,{value:Ce,children:[Re&&W.jsx(_n,{ref:a.type==="context-menu"||a.type==="nested-context-menu"?a.context.internalBackdropRef:null,inert:Wn(!P),cutout:fe}),W.jsx(wo,{id:V,children:W.jsx(Gr,{elementsRef:l.context.itemDomElements,labelsRef:l.context.itemLabels,children:ie})})]})}),Xr=s.createContext(null);function Zn(e){return s.useContext(Xr)}const Jr={...Fn,disabled:Z(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Z(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Z(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:Z(e=>e.stickIfOpen),parent:Z(e=>e.parent),rootId:Z(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Z(e=>e.activeIndex),isActive:Z((e,t)=>e.activeIndex===t),hoverEnabled:Z(e=>e.hoverEnabled),instantType:Z(e=>e.instantType),lastOpenChangeReason:Z(e=>e.openChangeReason),floatingTreeRoot:Z(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Z(e=>e.floatingNodeId),floatingParentNodeId:Z(e=>e.floatingParentNodeId),itemProps:Z(e=>e.itemProps),closeDelay:Z(e=>e.closeDelay),keyboardEventRelay:Z(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class _t extends Pn{constructor(t){super({...Zr(),...t},{positionerRef:s.createRef(),popupRef:s.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:s.createRef(),beforeContentFocusGuardRef:s.createRef(),onOpenChangeComplete:void 0,triggerElements:new kn},Jr),this.observe(Z(n=>n.allowMouseEnter),(n,o)=>{this.state.parent.type==="menu"&&n!==o&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const o=dt(()=>new _t(n)).current;return t??o}unsubscribeParentListener=null}function Zr(){return{...Nn(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Ln,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ye,keyboardEventRelay:void 0,closeDelay:0}}const Qr=s.createContext(void 0);function es(){return s.useContext(Qr)}function ts(e){const{children:t,open:n,onOpenChange:o,onOpenChangeComplete:i,defaultOpen:r=!1,disabled:g=!1,modal:u,loopFocus:c=!0,orientation:d="vertical",actionsRef:m,closeParentOnEsc:p=!1,handle:x,triggerId:E,defaultTriggerId:y=null,highlightItemOnHover:h=!0}=e,R=vt(!0),f=Ue(!0),l=Zn(),b=es(),v=s.useMemo(()=>b&&f?{type:"menu",store:f.store}:l?{type:"menubar",context:l}:R&&!f?{type:"context-menu",context:R}:{type:void 0},[R,f,l,b]),a=_t.useStore(x?.store,{parent:v}),T=a.useState("floatingTreeRoot"),I=An(T),D=bt();ne(()=>{R&&!f?a.update({parent:{type:"context-menu",context:R},floatingNodeId:I,floatingParentNodeId:D}):f&&a.update({floatingNodeId:I,floatingParentNodeId:D})},[R,f,I,D,a]),a.useControlledProp("open",n,r),a.useControlledProp("activeTriggerId",E,y),a.useContextCallback("onOpenChangeComplete",i);const P=a.useState("open"),U=a.useState("activeTriggerElement"),_=a.useState("positionerElement"),q=a.useState("hoverEnabled"),V=a.useState("modal"),Y=a.useState("disabled"),M=a.useState("lastOpenChangeReason"),G=a.useState("parent"),re=a.useState("activeIndex"),z=a.useState("payload"),se=a.useState("floatingParentNodeId"),O=s.useRef(null),te=se!=null;let ce;a.useSyncedValues({disabled:g,modal:G.type===void 0?u:void 0,rootId:pn()});const{openMethod:k,triggerProps:be,reset:ye}=Gn(P);wn(a);const{forceUnmount:Ce}=Mn(P,a,()=>{a.update({allowMouseEnter:!1,stickIfOpen:!0}),ye()}),ie=s.useRef(G.type!=="context-menu"),Re=De();s.useEffect(()=>{if(P||(O.current=null),G.type==="context-menu"){if(!P){Re.clear(),ie.current=!1;return}Re.start(500,()=>{ie.current=!0})}},[Re,P,G.type]),Vn(P&&V&&M!==Ve&&k!=="touch",_),ne(()=>{!P&&!q&&a.set("hoverEnabled",!0)},[P,q,a]);const fe=s.useRef(!0),Q=De(),$=le((K,ee)=>{const Ee=ee.reason;if(P===K&&ee.trigger===U&&M===Ee||(ee.preventUnmountOnClose=()=>{a.set("preventUnmountingOnClose",!0)},!K&&ee.trigger==null&&(ee.trigger=U??void 0),o?.(K,ee),ee.isCanceled))return;const eo={open:K,nativeEvent:ee.event,reason:ee.reason,nested:te};ce?.emit("openchange",eo);const Qe=ee.event;if(K===!1&&Qe?.type==="click"&&Qe.pointerType==="touch"&&!fe.current)return;if(!K&&re!==null){const $e=a.context.itemDomElements.current[re];queueMicrotask(()=>{$e?.setAttribute("tabindex","-1")})}K&&Ee===$t?(fe.current=!1,Q.start(300,()=>{fe.current=!0})):(fe.current=!0,Q.clear());const Vt=(Ee===at||Ee===hn)&&Qe.detail===0&&Qe?.isTrusted,to=!K&&(Ee===co||Ee==null);function Gt(){const $e={open:K,openChangeReason:Ee};O.current=ee.event??null;const Yt=ee.trigger?.id??null;(Yt||K)&&($e.activeTriggerId=Yt,$e.activeTriggerElement=ee.trigger??null),a.update($e)}Ee===Ve?Mt.flushSync(Gt):Gt(),G.type==="menubar"&&(Ee===$t||Ee===Je||Ee===Ve||Ee===ct||Ee===ze)?a.set("instantType","group"):Vt||to?a.set("instantType",Vt?"click":"dismiss"):a.set("instantType",void 0)}),N=s.useCallback(K=>{const ee=pe(K);return ee.preventUnmountOnClose=()=>{a.set("preventUnmountingOnClose",!0)},ee},[a]),ge=s.useCallback(()=>{a.setOpen(!1,N(mn))},[a,N]);s.useImperativeHandle(m,()=>({unmount:Ce,close:ge}),[Ce,ge]);let xe;G.type==="context-menu"&&(xe=G.context),s.useImperativeHandle(xe?.positionerRef,()=>_,[_]),s.useImperativeHandle(xe?.actionsRef,()=>({setOpen:$}),[$]);const ve=On({popupStore:a,onOpenChange:$});ce=ve.context.events,s.useEffect(()=>{const K=({open:ee,eventDetails:Ee})=>$(ee,Ee);return ce.on("setOpen",K),()=>{ce?.off("setOpen",K)}},[ce,$]);const F=In(ve,{enabled:!Y,bubbles:{escapeKey:p&&G.type==="menu"},outsidePress(){return G.type!=="context-menu"||O.current?.type==="contextmenu"?!0:ie.current},externalTree:te?T:void 0}),w=Hn(ve,{role:"menu"}),H=Mo(),A=s.useCallback(K=>{a.select("activeIndex")!==K&&a.set("activeIndex",K)},[a]),X=Qo(ve,{enabled:!Y,listRef:a.context.itemDomElements,activeIndex:re,nested:G.type!==void 0,loopFocus:c,orientation:d,parentOrientation:G.type==="menubar"?G.context.orientation:void 0,rtl:H==="rtl",disabledIndices:ft,onNavigate:A,openOnArrowKeyDown:G.type!=="context-menu",externalTree:te?T:void 0,focusItemOnHover:h}),L=s.useCallback(K=>{a.context.typingRef.current=K},[a]),j=tr(ve,{listRef:a.context.itemLabels,activeIndex:re,resetMs:Io,onMatch:K=>{P&&K!==re&&a.set("activeIndex",K)},onTypingChange:L}),{getReferenceProps:C,getFloatingProps:B,getItemProps:S,getTriggerProps:J}=Bt([F,w,X,j]),oe=s.useMemo(()=>{const K=Ot(C(),{onMouseEnter(){a.set("hoverEnabled",!0)},onMouseMove(){a.set("allowMouseEnter",!0)}},be);return delete K.role,K},[C,a,be]),de=s.useMemo(()=>{const K=J();if(!K)return K;const ee=Ot(K,be);return delete ee.role,delete ee["aria-controls"],ee},[J,be]),ue=Lt(),Ie=s.useMemo(()=>B({onMouseEnter(){G.type==="menu"&&ue.request(()=>a.set("hoverEnabled",!1))},onMouseMove(){a.set("allowMouseEnter",!0)},onClick(){a.select("hoverEnabled")&&a.set("hoverEnabled",!1)},onKeyDown(K){const ee=a.select("keyboardEventRelay");ee&&!K.isPropagationStopped()&&ee(K)}}),[B,G.type,ue,a]),Pe=s.useMemo(()=>S(),[S]);a.useSyncedValues({floatingRootContext:ve,activeTriggerProps:oe,inactiveTriggerProps:de,popupProps:Ie,itemProps:Pe});const Se=s.useMemo(()=>({store:a,parent:v}),[a,v]),ke=W.jsx(zn.Provider,{value:Se,children:typeof t=="function"?t({payload:z}):t});return G.type===void 0||G.type==="context-menu"?W.jsx(Oo,{externalTree:T,children:ke}):ke}function ns(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const r=parseFloat(n.width)||0,g=parseFloat(n.height)||0,u=parseFloat(o.width)||0,c=parseFloat(o.height)||0,d=Math.max(t.width,r,u),m=Math.max(t.height,g,c),p=d-t.width,x=m-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-x/2,bottom:t.bottom+x/2}}function os(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:o}=bn(),{ref:i,index:r}=Xn(e),g=n===r,u=s.useRef(null),c=lt(i,u);return{compositeProps:s.useMemo(()=>({tabIndex:g?0:-1,onFocus(){o(r)},onMouseMove(){const m=u.current;if(!t||!m)return;const p=m.hasAttribute("disabled")||m.ariaDisabled==="true";!g&&!p&&m.focus()}}),[g,o,r,t]),compositeRef:c,index:r}}function rs(e){const{render:t,className:n,state:o=Ye,props:i=ft,refs:r=ft,metadata:g,stateAttributesMapping:u,tag:c="div",...d}=e,{compositeProps:m,compositeRef:p}=os({metadata:g});return Oe(c,e,{state:o,ref:[...r,p],props:[m,...i,d],stateAttributesMapping:u})}function Qn(e){if(Me(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!uo(e))return Qn(lo(e))}function ss(e){const{enabled:t=!0,mouseDownAction:n,open:o}=e,i=s.useRef(!1);return s.useMemo(()=>t?{onMouseDown:r=>{(n==="open"&&!o||n==="close"&&o)&&(i.current=!0,Be(r.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:r=>{i.current&&(i.current=!1,r.preventBaseUIHandler())}}:Ye,[t,n,o])}const it=2,is=s.forwardRef(function(t,n){const{render:o,className:i,disabled:r=!1,nativeButton:g=!0,id:u,openOnHover:c,delay:d=100,closeDelay:m=0,handle:p,payload:x,...E}=t,y=Ue(!0),h=p?.store??y?.store;if(!h)throw new Error(We(85));const R=ht(u),f=h.useState("isTriggerActive",R),l=h.useState("floatingRootContext"),b=h.useState("isOpenedByTrigger",R),v=s.useRef(null),a=cs(),T=bn(!0),I=Nt(),D=s.useMemo(()=>I??new Ln,[I]),P=An(D),U=bt(),{registerTrigger:_,isMountedByThisTrigger:q}=Po(R,v,h,{payload:x,closeDelay:m,parent:a,floatingTreeRoot:D,floatingNodeId:P,floatingParentNodeId:U,keyboardEventRelay:T?.relayKeyboardEvent}),V=a.type==="menubar",Y=h.useState("disabled"),M=r||Y||V&&a.context.disabled,{getButtonProps:G,buttonRef:re}=kt({disabled:M,native:g});s.useEffect(()=>{!b&&a.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,b,a.type]);const z=s.useRef(null),se=De(),O=le(w=>{if(!z.current)return;se.clear(),h.context.allowMouseUpTriggerRef.current=!1;const H=w.target;if(ae(z.current,H)||ae(h.select("positionerElement"),H)||H===z.current||H!=null&&Qn(H)===h.select("rootId"))return;const A=ns(z.current);w.clientX>=A.left-it&&w.clientX<=A.right+it&&w.clientY>=A.top-it&&w.clientY<=A.bottom+it||D.events.emit("close",{domEvent:w,reason:fo})});s.useEffect(()=>{b&&h.select("lastOpenChangeReason")===Ve&&Be(z.current).addEventListener("mouseup",O,{once:!0})},[b,O,h]);const te=V&&a.context.hasSubmenuOpen,k=ko(l,{enabled:(c??te)&&!M&&a.type!=="context-menu"&&(!V||te&&!q),handleClose:Fo({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:a.type===void 0?d:void 0,delay:{close:m},triggerElementRef:v,externalTree:D,isActiveTrigger:f}),be=as(b,h.select("lastOpenChangeReason")),ye=qo(l,{enabled:!M&&a.type!=="context-menu",event:b&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:a.type===void 0?be:!1}),Ce=No(l,{enabled:!M&&te}),ie=ss({open:b,enabled:V,mouseDownAction:"open"}),Re=Bt([ye,Ce]),fe=s.useMemo(()=>({disabled:M,open:b}),[M,b]),Q=h.useState("triggerProps",q),$=[z,n,re,_,v],N=[Re.getReferenceProps(),k??Ye,Q,{"aria-haspopup":"menu",id:R,onMouseDown:w=>{if(h.select("open"))return;se.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Be(w.currentTarget).addEventListener("mouseup",O,{once:!0})}},V?{role:"menuitem"}:{},ie,E,G],ge=s.useRef(null),xe=le(w=>{Mt.flushSync(()=>{h.setOpen(!1,pe(Je,w.nativeEvent,w.currentTarget))}),Ao(ge.current)?.focus()}),ve=le(w=>{const H=h.select("positionerElement");if(H&&Pt(w,H))h.context.beforeContentFocusGuardRef.current?.focus();else{Mt.flushSync(()=>{h.setOpen(!1,pe(Je,w.nativeEvent,w.currentTarget))});let A=Do(h.context.triggerFocusTargetRef.current||v.current);for(;A!==null&&ae(H,A);){const X=A;if(A=En(A),A===X)break}A?.focus()}}),F=Oe("button",t,{enabled:!V,stateAttributesMapping:en,state:fe,ref:$,props:N});return V?W.jsx(rs,{tag:"button",render:o,className:i,state:fe,refs:$,props:N,stateAttributesMapping:en}):b?W.jsxs(s.Fragment,{children:[W.jsx(gt,{ref:ge,onFocus:xe},`${R}-pre-focus-guard`),W.jsx(s.Fragment,{children:F},R),W.jsx(gt,{ref:h.context.triggerFocusTargetRef,onFocus:ve},`${R}-post-focus-guard`)]}):W.jsx(s.Fragment,{children:F},R)});function as(e,t){const n=De(),[o,i]=s.useState(!1);return ne(()=>{e&&t==="trigger-hover"?(i(!0),n.start(Lo,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),o}function cs(){const e=vt(!0),t=Ue(!0),n=Zn();return s.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function Ts({children:e,...t}){return W.jsx(ts,{...t,children:e})}function ws({className:e,...t}){return W.jsx(is,{className:je(e),...t})}function Ms({className:e,side:t="bottom",align:n="end",children:o}){return W.jsx(Vr,{children:W.jsx(qr,{side:t,align:n,children:W.jsx(Ur,{className:je("min-w-[110px] rounded-lg bg-primary-50 p-1 text-sm text-primary-900 shadow-lg outline outline-primary-900/10",e),children:o})})})}function Os({className:e,...t}){return W.jsx(Hr,{className:je("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-primary-900 hover:bg-primary-100 data-highlighted:bg-primary-100","select-none font-[450]",e),...t})}const Is=Bo((e,t)=>({currentPath:"/",viewMode:"list",sortBy:"name",sortAsc:!0,selectedFiles:new Set,editingFile:null,navigateTo:n=>{e({currentPath:n,selectedFiles:new Set})},setViewMode:n=>{e({viewMode:n})},setSortBy:n=>{const o=t().sortBy;e({sortBy:n,sortAsc:o===n?!t().sortAsc:!0})},toggleSort:()=>{e(n=>({sortAsc:!n.sortAsc}))},selectFile:n=>{e(o=>{const i=new Set(o.selectedFiles);return i.add(n),{selectedFiles:i}})},deselectFile:n=>{e(o=>{const i=new Set(o.selectedFiles);return i.delete(n),{selectedFiles:i}})},clearSelection:()=>{e({selectedFiles:new Set})},openInEditor:n=>{const o=n.includes("/")&&n.slice(0,n.lastIndexOf("/"))||"/";e({currentPath:o,editingFile:n,selectedFiles:new Set})},closeEditor:()=>{e({editingFile:null})},toggleFileSelection:n=>{const{selectedFiles:o,selectFile:i,deselectFile:r}=t();o.has(n)?r(n):i(n)}}));export{hs as A,Ho as B,Gr as C,xs as D,jo as E,jt as F,Ut as G,Ko as H,xt as I,Et as J,Kt as K,Wt as L,Ts as M,me as N,qe as O,lr as P,gs as Q,ur as R,bs as S,ms as V,Es as a,vs as b,Cs as c,Ss as d,Ir as e,Mr as f,jn as g,Rr as h,or as i,yr as j,Fr as k,sr as l,rr as m,ws as n,Ms as o,Os as p,Is as q,os as r,Rs as s,fr as t,Ke as u,ys as v,Ct as w,tn as x,Wo as y,Xe as z};
@@ -1,9 +0,0 @@
1
- import{S as no,p as Fn,l as G,s as we,m as Ct,f as Pe,o as Ce,q as On,t as so,v as Nt,x as io,y as ro,z as Bn,n as li,r as m,i as ci,u as oo,j as Q,A as ui}from"./main-CkIF0soY.js";import{u as ao,a5 as lo,f as co,a9 as uo,af as jn}from"./button-Il3CHIzX.js";var ho=class extends no{constructor(t,e){super(),this.options=e,this.#n=t,this.#i=null,this.#s=Fn(),this.bindMethods(),this.setOptions(e)}#n;#t=void 0;#p=void 0;#e=void 0;#o;#u;#s;#i;#m;#h;#f;#a;#l;#r;#d=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Nn(this.#t,this.options)?this.#c():this.updateResult(),this.#T())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ae(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ae(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#b(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#n.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof G(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),e._defaulted&&!we(this.options,e)&&this.#n.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&Un(this.#t,n,this.options,e)&&this.#c(),this.updateResult(),s&&(this.#t!==n||G(this.options.enabled,this.#t)!==G(e.enabled,this.#t)||Ct(this.options.staleTime,this.#t)!==Ct(e.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||G(this.options.enabled,this.#t)!==G(e.enabled,this.#t)||i!==this.#r)&&this.#v(i)}getOptimisticResult(t){const e=this.#n.getQueryCache().build(this.#n,t),n=this.createResult(e,t);return po(this,n)&&(this.#e=n,this.#u=this.options,this.#o=this.#t.state),n}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),e?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){this.#d.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#n.defaultQueryOptions(t),n=this.#n.getQueryCache().build(this.#n,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#c({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#c(t){this.#S();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(Pe)),e}#g(){this.#x();const t=Ct(this.options.staleTime,this.#t);if(Ce||this.#e.isStale||!On(t))return;const n=so(this.#e.dataUpdatedAt,t)+1;this.#a=Nt.setTimeout(()=>{this.#e.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#b(),this.#r=t,!(Ce||G(this.options.enabled,this.#t)===!1||!On(this.#r)||this.#r===0)&&(this.#l=Nt.setInterval(()=>{(this.options.refetchIntervalInBackground||io.isFocused())&&this.#c()},this.#r))}#T(){this.#g(),this.#v(this.#y())}#x(){this.#a&&(Nt.clearTimeout(this.#a),this.#a=void 0)}#b(){this.#l&&(Nt.clearInterval(this.#l),this.#l=void 0)}createResult(t,e){const n=this.#t,s=this.options,i=this.#e,o=this.#o,r=this.#u,l=t!==n?t.state:this.#p,{state:u}=t;let c={...u},f=!1,h;if(e._optimisticResults){const w=this.hasListeners(),C=!w&&Nn(t,e),R=w&&Un(t,n,e,s);(C||R)&&(c={...c,...ro(u.data,t.options)}),e._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:g}=c;h=c.data;let T=!1;if(e.placeholderData!==void 0&&h===void 0&&g==="pending"){let w;i?.isPlaceholderData&&e.placeholderData===r?.placeholderData?(w=i.data,T=!0):w=typeof e.placeholderData=="function"?e.placeholderData(this.#f?.state.data,this.#f):e.placeholderData,w!==void 0&&(g="success",h=Bn(i?.data,w,e),f=!0)}if(e.select&&h!==void 0&&!T)if(i&&h===o?.data&&e.select===this.#m)h=this.#h;else try{this.#m=e.select,h=e.select(h),h=Bn(i?.data,h,e),this.#h=h,this.#i=null}catch(w){this.#i=w}this.#i&&(d=this.#i,h=this.#h,p=Date.now(),g="error");const x=c.fetchStatus==="fetching",S=g==="pending",y=g==="error",v=S&&x,P=h!==void 0,V={status:g,fetchStatus:c.fetchStatus,isPending:S,isSuccess:g==="success",isError:y,isInitialLoading:v,isLoading:v,data:h,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:x,isRefetching:x&&!S,isLoadingError:y&&!P,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:y&&P,isStale:qe(t,e),refetch:this.refetch,promise:this.#s,isEnabled:G(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const w=V.data!==void 0,C=V.status==="error"&&!w,R=J=>{C?J.reject(V.error):w&&J.resolve(V.data)},N=()=>{const J=this.#s=V.promise=Fn();R(J)},z=this.#s;switch(z.status){case"pending":t.queryHash===n.queryHash&&R(z);break;case"fulfilled":(C||V.data!==z.value)&&N();break;case"rejected":(!C||V.error!==z.reason)&&N();break}}return V}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#u=this.options,this.#o.data!==void 0&&(this.#f=this.#t),we(e,t))return;this.#e=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#d.size)return!0;const o=new Set(i??this.#d);return this.options.throwOnError&&o.add("error"),Object.keys(this.#e).some(r=>{const a=r;return this.#e[a]!==t[a]&&o.has(a)})};this.#w({listeners:n()})}#S(){const t=this.#n.getQueryCache().build(this.#n,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#T()}#w(t){li.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#n.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function fo(t,e){return G(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Nn(t,e){return fo(t,e)||t.state.data!==void 0&&Ae(t,e,e.refetchOnMount)}function Ae(t,e,n){if(G(e.enabled,t)!==!1&&Ct(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&qe(t,e)}return!1}function Un(t,e,n,s){return(t!==e||G(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&qe(t,n)}function qe(t,e){return G(e.enabled,t)!==!1&&t.isStaleByTime(Ct(e.staleTime,t))}function po(t,e){return!we(t.getCurrentResult(),e)}var hi=m.createContext(!1),mo=()=>m.useContext(hi);hi.Provider;function go(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var yo=m.createContext(go()),vo=()=>m.useContext(yo),To=(t,e,n)=>{const s=n?.state.error&&typeof t.throwOnError=="function"?ci(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},xo=t=>{m.useEffect(()=>{t.clearReset()},[t])},bo=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(i&&t.data===void 0||ci(n,[t.error,s])),So=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},wo=(t,e)=>t.isLoading&&t.isFetching&&!e,Po=(t,e)=>t?.suspense&&e.isPending,Wn=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Co(t,e,n){const s=mo(),i=vo(),o=oo(),r=o.defaultQueryOptions(t);o.getDefaultOptions().queries?._experimental_beforeQuery?.(r);const a=o.getQueryCache().get(r.queryHash);r._optimisticResults=s?"isRestoring":"optimistic",So(r),To(r,i,a),xo(i);const l=!o.getQueryCache().get(r.queryHash),[u]=m.useState(()=>new e(o,r)),c=u.getOptimisticResult(r),f=!s&&t.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(h=>{const d=f?u.subscribe(li.batchCalls(h)):Pe;return u.updateResult(),d},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),m.useEffect(()=>{u.setOptions(r)},[r,u]),Po(r,c))throw Wn(r,u,i);if(bo({result:c,errorResetBoundary:i,throwOnError:r.throwOnError,query:a,suspense:r.suspense}))throw c.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(r,c),r.experimental_prefetchInRender&&!Ce&&wo(c,s)&&(l?Wn(r,u,i):a?.promise)?.catch(Pe).finally(()=>{u.updateResult()}),r.notifyOnChangeProps?c:u.trackResult(c)}function Ih(t,e){return Co(t,ho)}const Ze=m.createContext({});function Je(t){const e=m.useRef(null);return e.current===null&&(e.current=t()),e.current}const fi=typeof window<"u",di=fi?m.useLayoutEffect:m.useEffect,ee=m.createContext(null);function tn(t,e){t.indexOf(e)===-1&&t.push(e)}function en(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Y=(t,e,n)=>n>e?e:n<t?t:n;let nn=()=>{};const Z={},pi=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function mi(t){return typeof t=="object"&&t!==null}const gi=t=>/^0[^.\s]+$/u.test(t);function sn(t){let e;return()=>(e===void 0&&(e=t()),e)}const $=t=>t,Ao=(t,e)=>n=>e(t(n)),Ft=(...t)=>t.reduce(Ao),Mt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class rn{constructor(){this.subscriptions=[]}add(e){return tn(this.subscriptions,e),()=>en(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const q=t=>t*1e3,K=t=>t/1e3;function yi(t,e){return e?t*(1e3/e):0}const vi=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Vo=1e-7,Do=12;function Ro(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=vi(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Vo&&++a<Do);return r}function Ot(t,e,n,s){if(t===e&&n===s)return $;const i=o=>Ro(o,0,1,t,n);return o=>o===0||o===1?o:vi(i(o),e,s)}const Ti=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xi=t=>e=>1-t(1-e),bi=Ot(.33,1.53,.69,.99),on=xi(bi),Si=Ti(on),wi=t=>(t*=2)<1?.5*on(t):.5*(2-Math.pow(2,-10*(t-1))),an=t=>1-Math.sin(Math.acos(t)),Pi=xi(an),Ci=Ti(an),Mo=Ot(.42,0,1,1),Eo=Ot(0,0,.58,1),Ai=Ot(.42,0,.58,1),Lo=t=>Array.isArray(t)&&typeof t[0]!="number",Vi=t=>Array.isArray(t)&&typeof t[0]=="number",ko={linear:$,easeIn:Mo,easeInOut:Ai,easeOut:Eo,circIn:an,circInOut:Ci,circOut:Pi,backIn:on,backInOut:Si,backOut:bi,anticipate:wi},Io=t=>typeof t=="string",Kn=t=>{if(Vi(t)){nn(t.length===4);const[e,n,s,i]=t;return Ot(e,n,s,i)}else if(Io(t))return ko[t];return t},Ut=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Fo(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){r.has(c)&&(u.schedule(c),t()),c(a)}const u={schedule:(c,f=!1,h=!1)=>{const p=h&&i?n:s;return f&&r.add(c),p.has(c)||p.add(c),c},cancel:c=>{s.delete(c),r.delete(c)},process:c=>{if(a=c,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,o&&(o=!1,u.process(c))}};return u}const Oo=40;function Di(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Ut.reduce((y,v)=>(y[v]=Fo(o),y),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:f,preRender:h,render:d,postRender:p}=r,g=()=>{const y=Z.useManualTiming?i.timestamp:performance.now();n=!1,Z.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,Oo),1)),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),f.process(i),h.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},T=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:Ut.reduce((y,v)=>{const P=r[v];return y[v]=(A,V=!1,w=!1)=>(n||T(),P.schedule(A,V,w)),y},{}),cancel:y=>{for(let v=0;v<Ut.length;v++)r[Ut[v]].cancel(y)},state:i,steps:r}}const{schedule:D,cancel:nt,state:F,steps:oe}=Di(typeof requestAnimationFrame<"u"?requestAnimationFrame:$,!0);let _t;function Bo(){_t=void 0}const B={now:()=>(_t===void 0&&B.set(F.isProcessing||Z.useManualTiming?F.timestamp:performance.now()),_t),set:t=>{_t=t,queueMicrotask(Bo)}},Ri=t=>e=>typeof e=="string"&&e.startsWith(t),Mi=Ri("--"),jo=Ri("var(--"),ln=t=>jo(t)?No.test(t.split("/*")[0].trim()):!1,No=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function $n(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const vt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Et={...vt,transform:t=>Y(0,1,t)},Wt={...vt,default:1},At=t=>Math.round(t*1e5)/1e5,cn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Uo(t){return t==null}const Wo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,un=(t,e)=>n=>!!(typeof n=="string"&&Wo.test(n)&&n.startsWith(t)||e&&!Uo(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ei=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(cn);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},Ko=t=>Y(0,255,t),ae={...vt,transform:t=>Math.round(Ko(t))},lt={test:un("rgb","red"),parse:Ei("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ae.transform(t)+", "+ae.transform(e)+", "+ae.transform(n)+", "+At(Et.transform(s))+")"};function $o(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Ve={test:un("#"),parse:$o,transform:lt.transform},Bt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),tt=Bt("deg"),X=Bt("%"),b=Bt("px"),_o=Bt("vh"),Ho=Bt("vw"),_n={...X,parse:t=>X.parse(t)/100,transform:t=>X.transform(t*100)},ft={test:un("hsl","hue"),parse:Ei("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+X.transform(At(e))+", "+X.transform(At(n))+", "+At(Et.transform(s))+")"},L={test:t=>lt.test(t)||Ve.test(t)||ft.test(t),parse:t=>lt.test(t)?lt.parse(t):ft.test(t)?ft.parse(t):Ve.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?lt.transform(t):ft.transform(t),getAnimatableNone:t=>{const e=L.parse(t);return e.alpha=0,L.transform(e)}},Go=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function zo(t){return isNaN(t)&&typeof t=="string"&&(t.match(cn)?.length||0)+(t.match(Go)?.length||0)>0}const Li="number",ki="color",Xo="var",Yo="var(",Hn="${}",Qo=/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+)/giu;function Lt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(Qo,l=>(L.test(l)?(s.color.push(o),i.push(ki),n.push(L.parse(l))):l.startsWith(Yo)?(s.var.push(o),i.push(Xo),n.push(l)):(s.number.push(o),i.push(Li),n.push(parseFloat(l))),++o,Hn)).split(Hn);return{values:n,split:a,indexes:s,types:i}}function Ii(t){return Lt(t).values}function Fi(t){const{split:e,types:n}=Lt(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===Li?o+=At(i[r]):a===ki?o+=L.transform(i[r]):o+=i[r]}return o}}const qo=t=>typeof t=="number"?0:L.test(t)?L.getAnimatableNone(t):t;function Zo(t){const e=Ii(t);return Fi(t)(e.map(qo))}const st={test:zo,parse:Ii,createTransformer:Fi,getAnimatableNone:Zo};function le(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Jo({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=le(l,a,t+1/3),o=le(l,a,t),r=le(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Xt(t,e){return n=>n>0?e:t}const M=(t,e,n)=>t+(e-t)*n,ce=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ta=[Ve,lt,ft],ea=t=>ta.find(e=>e.test(t));function Gn(t){const e=ea(t);if(!e)return!1;let n=e.parse(t);return e===ft&&(n=Jo(n)),n}const zn=(t,e)=>{const n=Gn(t),s=Gn(e);if(!n||!s)return Xt(t,e);const i={...n};return o=>(i.red=ce(n.red,s.red,o),i.green=ce(n.green,s.green,o),i.blue=ce(n.blue,s.blue,o),i.alpha=M(n.alpha,s.alpha,o),lt.transform(i))},De=new Set(["none","hidden"]);function na(t,e){return De.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function sa(t,e){return n=>M(t,e,n)}function hn(t){return typeof t=="number"?sa:typeof t=="string"?ln(t)?Xt:L.test(t)?zn:oa:Array.isArray(t)?Oi:typeof t=="object"?L.test(t)?zn:ia:Xt}function Oi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>hn(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function ia(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=hn(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function ra(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const oa=(t,e)=>{const n=st.createTransformer(e),s=Lt(t),i=Lt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?De.has(t)&&!i.values.length||De.has(e)&&!s.values.length?na(t,e):Ft(Oi(ra(s,i),i.values),n):Xt(t,e)};function Bi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?M(t,e,n):hn(t)(t,e)}const aa=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>D.update(e,n),stop:()=>nt(e),now:()=>F.isProcessing?F.timestamp:B.now()}},ji=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=Math.round(t(o/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Yt=2e4;function fn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Yt;)e+=n,s=t.next(e);return e>=Yt?1/0:e}function la(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(fn(s),Yt);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:K(i)}}const ca=5;function Ni(t,e,n){const s=Math.max(e-ca,0);return yi(n-t(s),e-s)}const E={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ue=.001;function ua({duration:t=E.duration,bounce:e=E.bounce,velocity:n=E.velocity,mass:s=E.mass}){let i,o,r=1-e;r=Y(E.minDamping,E.maxDamping,r),t=Y(E.minDuration,E.maxDuration,K(t)),r<1?(i=u=>{const c=u*r,f=c*t,h=c-n,d=Re(u,r),p=Math.exp(-f);return ue-h/d*p},o=u=>{const f=u*r*t,h=f*n+n,d=Math.pow(r,2)*Math.pow(u,2)*t,p=Math.exp(-f),g=Re(Math.pow(u,2),r);return(-i(u)+ue>0?-1:1)*((h-d)*p)/g}):(i=u=>{const c=Math.exp(-u*t),f=(u-n)*t+1;return-ue+c*f},o=u=>{const c=Math.exp(-u*t),f=(n-u)*(t*t);return c*f});const a=5/t,l=fa(i,o,a);if(t=q(t),isNaN(l))return{stiffness:E.stiffness,damping:E.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const ha=12;function fa(t,e,n){let s=n;for(let i=1;i<ha;i++)s=s-t(s)/e(s);return s}function Re(t,e){return t*Math.sqrt(1-e*e)}const da=["duration","bounce"],pa=["stiffness","damping","mass"];function Xn(t,e){return e.some(n=>t[n]!==void 0)}function ma(t){let e={velocity:E.velocity,stiffness:E.stiffness,damping:E.damping,mass:E.mass,isResolvedFromDuration:!1,...t};if(!Xn(t,pa)&&Xn(t,da))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*Y(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:E.mass,stiffness:i,damping:o}}else{const n=ua(t);e={...e,...n,mass:E.mass},e.isResolvedFromDuration=!0}return e}function Qt(t=E.visualDuration,e=E.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:f,velocity:h,isResolvedFromDuration:d}=ma({...n,velocity:-K(n.velocity||0)}),p=h||0,g=u/(2*Math.sqrt(l*c)),T=r-o,x=K(Math.sqrt(l/c)),S=Math.abs(T)<5;s||(s=S?E.restSpeed.granular:E.restSpeed.default),i||(i=S?E.restDelta.granular:E.restDelta.default);let y;if(g<1){const P=Re(x,g);y=A=>{const V=Math.exp(-g*x*A);return r-V*((p+g*x*T)/P*Math.sin(P*A)+T*Math.cos(P*A))}}else if(g===1)y=P=>r-Math.exp(-x*P)*(T+(p+x*T)*P);else{const P=x*Math.sqrt(g*g-1);y=A=>{const V=Math.exp(-g*x*A),w=Math.min(P*A,300);return r-V*((p+g*x*T)*Math.sinh(w)+P*T*Math.cosh(w))/P}}const v={calculatedDuration:d&&f||null,next:P=>{const A=y(P);if(d)a.done=P>=f;else{let V=P===0?p:0;g<1&&(V=P===0?q(p):Ni(y,P,A));const w=Math.abs(V)<=s,C=Math.abs(r-A)<=i;a.done=w&&C}return a.value=a.done?r:A,a},toString:()=>{const P=Math.min(fn(v),Yt),A=ji(V=>v.next(P*V).value,P,30);return P+"ms "+A},toTransition:()=>{}};return v}Qt.applyToOptions=t=>{const e=la(t,100,Qt);return t.ease=e.ease,t.duration=q(e.duration),t.type="keyframes",t};function Me({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=t[0],h={done:!1,value:f},d=w=>a!==void 0&&w<a||l!==void 0&&w>l,p=w=>a===void 0?l:l===void 0||Math.abs(a-w)<Math.abs(l-w)?a:l;let g=n*e;const T=f+g,x=r===void 0?T:r(T);x!==T&&(g=x-f);const S=w=>-g*Math.exp(-w/s),y=w=>x+S(w),v=w=>{const C=S(w),R=y(w);h.done=Math.abs(C)<=u,h.value=h.done?x:R};let P,A;const V=w=>{d(h.value)&&(P=w,A=Qt({keyframes:[h.value,p(h.value)],velocity:Ni(y,w,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return V(0),{calculatedDuration:null,next:w=>{let C=!1;return!A&&P===void 0&&(C=!0,v(w),V(w)),P!==void 0&&w>=P?A.next(w-P):(!C&&v(w),h)}}}function ga(t,e,n){const s=[],i=n||Z.mix||Bi,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||$:e;a=Ft(l,a)}s.push(a)}return s}function ya(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(nn(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=ga(e,s,i),l=a.length,u=c=>{if(r&&c<t[0])return e[0];let f=0;if(l>1)for(;f<t.length-2&&!(c<t[f+1]);f++);const h=Mt(t[f],t[f+1],c);return a[f](h)};return n?c=>u(Y(t[0],t[o-1],c)):u}function va(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Mt(0,e,s);t.push(M(n,1,i))}}function Ta(t){const e=[0];return va(e,t.length-1),e}function xa(t,e){return t.map(n=>n*e)}function ba(t,e){return t.map(()=>e||Ai).splice(0,t.length-1)}function Vt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Lo(s)?s.map(Kn):Kn(s),o={done:!1,value:e[0]},r=xa(n&&n.length===e.length?n:Ta(e),t),a=ya(r,e,{ease:Array.isArray(i)?i:ba(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Sa=t=>t!==null;function dn(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(Sa),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const wa={decay:Me,inertia:Me,tween:Vt,keyframes:Vt,spring:Qt};function Ui(t){typeof t.type=="string"&&(t.type=wa[t.type])}class pn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Pa=t=>t/100;class mn extends pn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==B.now()&&this.tick(B.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ui(e);const{type:n=Vt,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const l=n||Vt;l!==Vt&&typeof a[0]!="number"&&(this.mixKeyframes=Ft(Pa,Bi(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=fn(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:f,repeatType:h,repeatDelay:d,type:p,onUpdate:g,finalKeyframe:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const x=this.currentTime-u*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?x<0:x>i;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let y=this.currentTime,v=s;if(f){const w=Math.min(this.currentTime,i)/a;let C=Math.floor(w),R=w%1;!R&&w>=1&&(R=1),R===1&&C--,C=Math.min(C,f+1),C%2&&(h==="reverse"?(R=1-R,d&&(R-=d/a)):h==="mirror"&&(v=r)),y=Y(0,1,R)*a}const P=S?{done:!1,value:c[0]}:v.next(y);o&&(P.value=o(P.value));let{done:A}=P;!S&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return V&&p!==Me&&(P.value=dn(c,this.options,T,this.speed)),g&&g(P.value),V&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return K(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(this.currentTime)}set time(e){e=q(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?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(B.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=K(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=aa,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),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(B.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.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}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)}}function Ca(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ct=t=>t*180/Math.PI,Ee=t=>{const e=ct(Math.atan2(t[1],t[0]));return Le(e)},Aa={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ee,rotateZ:Ee,skewX:t=>ct(Math.atan(t[1])),skewY:t=>ct(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Le=t=>(t=t%360,t<0&&(t+=360),t),Yn=Ee,Qn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),qn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Va={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Qn,scaleY:qn,scale:t=>(Qn(t)+qn(t))/2,rotateX:t=>Le(ct(Math.atan2(t[6],t[5]))),rotateY:t=>Le(ct(Math.atan2(-t[2],t[0]))),rotateZ:Yn,rotate:Yn,skewX:t=>ct(Math.atan(t[4])),skewY:t=>ct(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ke(t){return t.includes("scale")?1:0}function Ie(t,e){if(!t||t==="none")return ke(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Va,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Aa,i=a}if(!i)return ke(e);const o=s[e],r=i[1].split(",").map(Ra);return typeof o=="function"?o(r):r[o]}const Da=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ie(n,e)};function Ra(t){return parseFloat(t.trim())}const Tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xt=new Set(Tt),Zn=t=>t===vt||t===b,Ma=new Set(["x","y","z"]),Ea=Tt.filter(t=>!Ma.has(t));function La(t){const e=[];return Ea.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const et={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ie(e,"x"),y:(t,{transform:e})=>Ie(e,"y")};et.translateX=et.x;et.translateY=et.y;const ut=new Set;let Fe=!1,Oe=!1,Be=!1;function Wi(){if(Oe){const t=Array.from(ut).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=La(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{s.getValue(o)?.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Oe=!1,Fe=!1,ut.forEach(t=>t.complete(Be)),ut.clear()}function Ki(){ut.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Oe=!0)})}function ka(){Be=!0,Ki(),Wi(),Be=!1}class gn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ut.add(this),Fe||(Fe=!0,D.read(Ki),D.resolveKeyframes(Wi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i?.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}Ca(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ut.delete(this)}cancel(){this.state==="scheduled"&&(ut.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ia=t=>t.startsWith("--");function Fa(t,e,n){Ia(e)?t.style.setProperty(e,n):t.style[e]=n}const Oa=sn(()=>window.ScrollTimeline!==void 0),Ba={};function ja(t,e){const n=sn(t);return()=>Ba[e]??n()}const $i=ja(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wt([0,.65,.55,1]),circOut:wt([.55,0,1,.45]),backIn:wt([.31,.01,.66,-.59]),backOut:wt([.33,1.53,.69,.99])};function _i(t,e){if(t)return typeof t=="function"?$i()?ji(t,e):"ease-out":Vi(t)?wt(t):Array.isArray(t)?t.map(n=>_i(n,e)||Jn.easeOut):Jn[t]}function Na(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const f=_i(a,i);Array.isArray(f)&&(c.easing=f);const h={delay:s,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),t.animate(c,h)}function Hi(t){return typeof t=="function"&&"applyToOptions"in t}function Ua({type:t,...e}){return Hi(t)&&$i()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Wa extends pn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,nn(typeof e.type!="string");const u=Ua(e);this.animation=Na(n,s,i,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=dn(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):Fa(n,s,c),this.animation.cancel()}l?.(),this.notifyFinished()}}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(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return K(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=q(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Oa()?(this.animation.timeline=e,$):n(this)}}const Gi={anticipate:wi,backInOut:Si,circInOut:Ci};function Ka(t){return t in Gi}function $a(t){typeof t.ease=="string"&&Ka(t.ease)&&(t.ease=Gi[t.ease])}const he=10;class _a extends Wa{constructor(e){$a(e),Ui(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new mn({...r,autoplay:!1}),l=Math.max(he,B.now()-this.startTime),u=Y(0,he,l-he);n.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const ts=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(st.test(t)||t==="0")&&!t.startsWith("url("));function Ha(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Ga(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=ts(i,e),a=ts(o,e);return!r||!a?!1:Ha(t)||(n==="spring"||Hi(n))&&s}function je(t){t.duration=0,t.type="keyframes"}const za=new Set(["opacity","clipPath","filter","transform"]),Xa=sn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ya(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return Xa()&&n&&za.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const Qa=40;class qa extends pn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:l,motionValue:u,element:c,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=B.now();const h={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:l,motionValue:u,element:c,...f},d=c?.KeyframeResolver||gn;this.keyframeResolver=new d(a,(p,g,T)=>this.onKeyframesResolved(p,g,h,!T),l,u,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=B.now(),Ga(e,o,r,a)||((Z.instantAnimations||!l)&&c?.(dn(e,s,n)),e[0]=e[e.length-1],je(s),s.repeat=0);const h={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Qa?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&Ya(h),p=h.motionValue?.owner?.current,g=d?new _a({...h,element:p}):new mn(h);g.finished.then(()=>{this.notifyFinished()}).catch($),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ka()),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&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function zi(t,e,n,s=0,i=1){const o=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const Za=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ja(t){const e=Za.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Xi(t,e,n=1){const[s,i]=Ja(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return pi(r)?parseFloat(r):r}return ln(i)?Xi(i,e,n+1):i}const tl={type:"spring",stiffness:500,damping:25,restSpeed:10},el=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),nl={type:"keyframes",duration:.8},sl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},il=(t,{keyframes:e})=>e.length>2?nl:xt.has(t)?t.startsWith("scale")?el(e[1]):tl:sl,rl=t=>t!==null;function ol(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(rl),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[o]}function yn(t,e){return t?.[e]??t?.default??t}function al({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const vn=(t,e,n,s={},i,o)=>r=>{const a=yn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-q(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};al(a)||Object.assign(c,il(t,c)),c.duration&&(c.duration=q(c.duration)),c.repeatDelay&&(c.repeatDelay=q(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(je(c),c.delay===0&&(f=!0)),(Z.instantAnimations||Z.skipAnimations)&&(f=!0,je(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,f&&!o&&e.get()!==void 0){const h=ol(c.keyframes,a);if(h!==void 0){D.update(()=>{c.onUpdate(h),c.onComplete()});return}}return a.isSync?new mn(c):new qa(c)};function es(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Tn(t,e,n,s){if(typeof e=="function"){const[i,o]=es(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=es(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function gt(t,e,n){const s=t.getProps();return Tn(s,e,n!==void 0?n:s.custom,t)}const Yi=new Set(["width","height","top","left","right","bottom",...Tt]),ns=30,ll=t=>!isNaN(parseFloat(t));class cl{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=B.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=B.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ll(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new rn);const s=this.events[e].add(n);return e==="change"?()=>{s(),D.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=B.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>ns)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ns);return yi(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yt(t,e){return new cl(t,e)}const Ne=t=>Array.isArray(t);function ul(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yt(n))}function hl(t){return Ne(t)?t[t.length-1]||0:t}function fl(t,e){const n=gt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=hl(o[r]);ul(t,r,a)}}const O=t=>!!(t&&t.getVelocity);function dl(t){return!!(O(t)&&t.add)}function Ue(t,e){const n=t.getValue("willChange");if(dl(n))return n.add(e);if(!n&&Z.WillChange){const s=new Z.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function xn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const pl="framerAppearId",Qi="data-"+xn(pl);function qi(t){return t.props[Qi]}function ml({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Zi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;const l=o?.reduceMotion;s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const h=t.getValue(f,t.latestValues[f]??null),d=a[f];if(d===void 0||c&&ml(c,f))continue;const p={delay:n,...yn(o||{},f)},g=h.get();if(g!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===g&&!p.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const y=qi(t);if(y){const v=window.MotionHandoffAnimation(y,f,D);v!==null&&(p.startTime=v,T=!0)}}Ue(t,f);const x=l??t.shouldReduceMotion;h.start(vn(f,h,d,x&&Yi.has(f)?{type:!1}:p,t,T));const S=h.animation;S&&u.push(S)}return r&&Promise.all(u).then(()=>{D.update(()=>{r&&fl(t,r)})}),u}function We(t,e,n={}){const s=gt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Zi(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:f}=i;return gl(t,e,l,u,c,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[o,r]:[r,o];return l().then(()=>u())}else return Promise.all([o(),r(n.delay)])}function gl(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(We(l,e,{...r,delay:n+(typeof s=="function"?0:s)+zi(t.variantChildren,l,s,i,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function yl(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>We(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=We(t,e,n);else{const i=typeof e=="function"?gt(t,e,n.custom):e;s=Promise.all(Zi(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const vl={test:t=>t==="auto",parse:t=>t},Ji=t=>e=>e.test(t),tr=[vt,b,X,tt,Ho,_o,vl],ss=t=>tr.find(Ji(t));function Tl(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||gi(t):!0}const xl=new Set(["brightness","contrast","saturate","opacity"]);function bl(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(cn)||[];if(!s)return t;const i=n.replace(s,"");let o=xl.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Sl=/\b([a-z-]*)\(.*?\)/gu,Ke={...st,getAnimatableNone:t=>{const e=t.match(Sl);return e?e.map(bl).join(" "):t}},is={...vt,transform:Math.round},wl={rotate:tt,rotateX:tt,rotateY:tt,rotateZ:tt,scale:Wt,scaleX:Wt,scaleY:Wt,scaleZ:Wt,skew:tt,skewX:tt,skewY:tt,distance:b,translateX:b,translateY:b,translateZ:b,x:b,y:b,z:b,perspective:b,transformPerspective:b,opacity:Et,originX:_n,originY:_n,originZ:b},bn={borderWidth:b,borderTopWidth:b,borderRightWidth:b,borderBottomWidth:b,borderLeftWidth:b,borderRadius:b,borderTopLeftRadius:b,borderTopRightRadius:b,borderBottomRightRadius:b,borderBottomLeftRadius:b,width:b,maxWidth:b,height:b,maxHeight:b,top:b,right:b,bottom:b,left:b,inset:b,insetBlock:b,insetBlockStart:b,insetBlockEnd:b,insetInline:b,insetInlineStart:b,insetInlineEnd:b,padding:b,paddingTop:b,paddingRight:b,paddingBottom:b,paddingLeft:b,paddingBlock:b,paddingBlockStart:b,paddingBlockEnd:b,paddingInline:b,paddingInlineStart:b,paddingInlineEnd:b,margin:b,marginTop:b,marginRight:b,marginBottom:b,marginLeft:b,marginBlock:b,marginBlockStart:b,marginBlockEnd:b,marginInline:b,marginInlineStart:b,marginInlineEnd:b,fontSize:b,backgroundPositionX:b,backgroundPositionY:b,...wl,zIndex:is,fillOpacity:Et,strokeOpacity:Et,numOctaves:is},Pl={...bn,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:Ke,WebkitFilter:Ke},er=t=>Pl[t];function nr(t,e){let n=er(t);return n!==Ke&&(n=st),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Cl=new Set(["auto","none","0"]);function Al(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!Cl.has(o)&&Lt(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=nr(n,i)}class Vl extends gn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let f=e[c];if(typeof f=="string"&&(f=f.trim(),ln(f))){const h=Xi(f,n.current);h!==void 0&&(e[c]=h),c===e.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Yi.has(s)||e.length!==2)return;const[i,o]=e,r=ss(i),a=ss(o),l=$n(i),u=$n(o);if(l!==u&&et[s]){this.needsMeasurement=!0;return}if(r!==a)if(Zn(r)&&Zn(a))for(let c=0;c<e.length;c++){const f=e[c];typeof f=="string"&&(e[c]=parseFloat(f))}else et[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Tl(e[i]))&&s.push(i);s.length&&Al(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=et[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=et[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{e.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function Dl(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const sr=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function $e(t){return mi(t)&&"offsetHeight"in t}const{schedule:Sn}=Di(queueMicrotask,!1),H={x:!1,y:!1};function ir(){return H.x||H.y}function Rl(t){return t==="x"||t==="y"?H[t]?null:(H[t]=!0,()=>{H[t]=!1}):H.x||H.y?null:(H.x=H.y=!0,()=>{H.x=H.y=!1})}function rr(t,e){const n=Dl(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function rs(t){return!(t.pointerType==="touch"||ir())}function Ml(t,e,n={}){const[s,i,o]=rr(t,n),r=a=>{if(!rs(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=f=>{rs(f)&&(u(f),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const or=(t,e)=>e?t===e?!0:or(t,e.parentElement):!1,wn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,El=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ar(t){return El.has(t.tagName)||t.isContentEditable===!0}const Ht=new WeakSet;function os(t){return e=>{e.key==="Enter"&&t(e)}}function fe(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ll=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=os(()=>{if(Ht.has(n))return;fe(n,"down");const i=os(()=>{fe(n,"up")}),o=()=>fe(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function as(t){return wn(t)&&!ir()}function kl(t,e,n={}){const[s,i,o]=rr(t,n),r=a=>{const l=a.currentTarget;if(!as(a))return;Ht.add(l);const u=e(l,a),c=(d,p)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),Ht.has(l)&&Ht.delete(l),as(d)&&typeof u=="function"&&u(d,{success:p})},f=d=>{c(d,l===window||l===document||n.useGlobalTarget||or(l,d.target))},h=d=>{c(d,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),$e(a)&&(a.addEventListener("focus",u=>Ll(u,i)),!ar(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function lr(t){return mi(t)&&"ownerSVGElement"in t}function Il(t){return lr(t)&&t.tagName==="svg"}const Fl=[...tr,L,st],Ol=t=>Fl.find(Ji(t)),ls=()=>({translate:0,scale:1,origin:0,originPoint:0}),dt=()=>({x:ls(),y:ls()}),cs=()=>({min:0,max:0}),k=()=>({x:cs(),y:cs()}),_e={current:null},cr={current:!1},Bl=typeof window<"u";function jl(){if(cr.current=!0,!!Bl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>_e.current=t.matches;t.addEventListener("change",e),e()}else _e.current=!1}const Nl=new WeakMap;function ne(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function kt(t){return typeof t=="string"||Array.isArray(t)}const Pn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cn=["initial",...Pn];function se(t){return ne(t.animate)||Cn.some(e=>kt(t[e]))}function ur(t){return!!(se(t)||t.variants)}function Ul(t,e,n){for(const s in e){const i=e[s],o=n[s];if(O(i))t.addValue(s,i);else if(O(o))t.addValue(s,yt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,yt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const us=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let qt={};function hr(t){qt=t}function Wl(){return qt}class Kl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=gn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=()=>{const h=B.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,D.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=se(n),this.isVariantNode=ur(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const d=f[h];l[h]!==void 0&&O(d)&&d.set(l[h])}}mount(e){this.current=e,Nl.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(cr.current||jl(),this.shouldReduceMotion=_e.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),nt(this.notifyUpdate),nt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=xt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&D.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in qt){const n=qt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):k()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<us.length;s++){const i=us[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=Ul(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=yt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(pi(s)||gi(s))?s=parseFloat(s):!Ol(s)&&st.test(n)&&(s=nr(e,n)),this.setBaseTarget(e,O(s)?s.get():s)),O(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Tn(this.props,n,this.presenceContext?.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!O(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new rn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Sn.render(this.render)}}class fr extends Kl{constructor(){super(...arguments),this.KeyframeResolver=Vl}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;O(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class it{constructor(e){this.isMounted=!1,this.node=e}update(){}}function dr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function $l({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function _l(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function de(t){return t===void 0||t===1}function He({scale:t,scaleX:e,scaleY:n}){return!de(t)||!de(e)||!de(n)}function at(t){return He(t)||pr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function pr(t){return hs(t.x)||hs(t.y)}function hs(t){return t&&t!=="0%"}function Zt(t,e,n){const s=t-n,i=e*s;return n+i}function fs(t,e,n,s,i){return i!==void 0&&(t=Zt(t,i,s)),Zt(t,n,s)+e}function Ge(t,e=0,n=1,s,i){t.min=fs(t.min,e,n,s,i),t.max=fs(t.max,e,n,s,i)}function mr(t,{x:e,y:n}){Ge(t.x,e.translate,e.scale,e.originPoint),Ge(t.y,n.translate,n.scale,n.originPoint)}const ds=.999999999999,ps=1.0000000000001;function Hl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&mt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,mr(t,r)),s&&at(o.latestValues)&&mt(t,o.latestValues))}e.x<ps&&e.x>ds&&(e.x=1),e.y<ps&&e.y>ds&&(e.y=1)}function pt(t,e){t.min=t.min+e,t.max=t.max+e}function ms(t,e,n,s,i=.5){const o=M(t.min,t.max,i);Ge(t,e,n,o,s)}function mt(t,e){ms(t.x,e.x,e.scaleX,e.scale,e.originX),ms(t.y,e.y,e.scaleY,e.scale,e.originY)}function gr(t,e){return dr(_l(t.getBoundingClientRect(),e))}function Gl(t,e,n){const s=gr(t,n),{scroll:i}=e;return i&&(pt(s.x,i.offset.x),pt(s.y,i.offset.y)),s}const zl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Xl=Tt.length;function Yl(t,e,n){let s="",i=!0;for(let o=0;o<Xl;o++){const r=Tt[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(r.startsWith("scale")?1:0);else{const u=parseFloat(a);l=r.startsWith("scale")?u===1:u===0}if(!l||n){const u=sr(a,bn[r]);if(!l){i=!1;const c=zl[r]||r;s+=`${c}(${u}) `}n&&(e[r]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function An(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const u=e[l];if(xt.has(l)){r=!0;continue}else if(Mi(l)){i[l]=u;continue}else{const c=sr(u,bn[l]);l.startsWith("origin")?(a=!0,o[l]=c):s[l]=c}}if(e.transform||(r||n?s.transform=Yl(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=o;s.transformOrigin=`${l} ${u} ${c}`}}function yr(t,{style:e,vars:n},s,i){const o=t.style;let r;for(r in e)o[r]=e[r];i?.applyProjectionStyles(o,s);for(r in n)o.setProperty(r,n[r])}function gs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const St={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(b.test(t))t=parseFloat(t);else return t;const n=gs(t,e.target.x),s=gs(t,e.target.y);return`${n}% ${s}%`}},Ql={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=st.parse(t);if(i.length>5)return s;const o=st.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=M(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}},ze={borderRadius:{...St,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:St,borderTopRightRadius:St,borderBottomLeftRadius:St,borderBottomRightRadius:St,boxShadow:Ql};function vr(t,{layout:e,layoutId:n}){return xt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!ze[t]||t==="opacity")}function Vn(t,e,n){const s=t.style,i=e?.style,o={};if(!s)return o;for(const r in s)(O(s[r])||i&&O(i[r])||vr(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=s[r]);return o}function ql(t){return window.getComputedStyle(t)}class Zl extends fr{constructor(){super(...arguments),this.type="html",this.renderInstance=yr}readValueFromInstance(e,n){if(xt.has(n))return this.projection?.isProjecting?ke(n):Da(e,n);{const s=ql(e),i=(Mi(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return gr(e,n)}build(e,n,s){An(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Vn(e,n,s)}}const Jl={offset:"stroke-dashoffset",array:"stroke-dasharray"},tc={offset:"strokeDashoffset",array:"strokeDasharray"};function ec(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?Jl:tc;t[o.offset]=`${-s}`,t[o.array]=`${e} ${n}`}const nc=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Tr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},l,u,c){if(An(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:h}=t;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=c?.transformBox??"fill-box",delete f.transformBox);for(const d of nc)f[d]!==void 0&&(h[d]=f[d],delete f[d]);e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),i!==void 0&&ec(f,i,o,r,!1)}const xr=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"]),br=t=>typeof t=="string"&&t.toLowerCase()==="svg";function sc(t,e,n,s){yr(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(xr.has(i)?i:xn(i),e.attrs[i])}function Sr(t,e,n){const s=Vn(t,e,n);for(const i in t)if(O(t[i])||O(e[i])){const o=Tt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}class ic extends fr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(xt.has(n)){const s=er(n);return s&&s.default||0}return n=xr.has(n)?n:xn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Sr(e,n,s)}build(e,n,s){Tr(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){sc(e,n,s,i)}mount(e){this.isSVGTag=br(e.tagName),super.mount(e)}}const rc=Cn.length;function wr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?wr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<rc;n++){const s=Cn[n],i=t.props[s];(kt(i)||i===!1)&&(e[s]=i)}return e}function Pr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const oc=[...Pn].reverse(),ac=Pn.length;function lc(t){return e=>Promise.all(e.map(({animation:n,options:s})=>yl(t,n,s)))}function cc(t){let e=lc(t),n=ys(),s=!0;const i=l=>(u,c)=>{const f=gt(t,c,l==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:h,transitionEnd:d,...p}=f;u={...u,...p,...d}}return u};function o(l){e=l(t)}function r(l){const{props:u}=t,c=wr(t.parent)||{},f=[],h=new Set;let d={},p=1/0;for(let T=0;T<ac;T++){const x=oc[T],S=n[x],y=u[x]!==void 0?u[x]:c[x],v=kt(y),P=x===l?S.isActive:null;P===!1&&(p=T);let A=y===c[x]&&y!==u[x]&&v;if(A&&s&&t.manuallyAnimateOnMount&&(A=!1),S.protectedKeys={...d},!S.isActive&&P===null||!y&&!S.prevProp||ne(y)||typeof y=="boolean")continue;const V=uc(S.prevProp,y);let w=V||x===l&&S.isActive&&!A&&v||T>p&&v,C=!1;const R=Array.isArray(y)?y:[y];let N=R.reduce(i(x),{});P===!1&&(N={});const{prevResolvedValues:z={}}=S,J={...z,...N},kn=I=>{w=!0,h.has(I)&&(C=!0,h.delete(I)),S.needsAnimating[I]=!0;const U=t.getValue(I);U&&(U.liveStyle=!1)};for(const I in J){const U=N[I],rt=z[I];if(d.hasOwnProperty(I))continue;let ht=!1;Ne(U)&&Ne(rt)?ht=!Pr(U,rt):ht=U!==rt,ht?U!=null?kn(I):h.add(I):U!==void 0&&h.has(I)?kn(I):S.protectedKeys[I]=!0}S.prevProp=y,S.prevResolvedValues=N,S.isActive&&(d={...d,...N}),s&&t.blockInitialAnimation&&(w=!1);const In=A&&V;w&&(!In||C)&&f.push(...R.map(I=>{const U={type:x};if(typeof I=="string"&&s&&!In&&t.manuallyAnimateOnMount&&t.parent){const{parent:rt}=t,ht=gt(rt,I);if(rt.enteringChildren&&ht){const{delayChildren:eo}=ht.transition||{};U.delay=zi(rt.enteringChildren,t,eo)}}return{animation:I,options:U}}))}if(h.size){const T={};if(typeof u.initial!="boolean"){const x=gt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(T.transition=x.transition)}h.forEach(x=>{const S=t.getBaseTarget(x),y=t.getValue(x);y&&(y.liveStyle=!0),T[x]=S??null}),f.push({animation:T})}let g=!!f.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(f):Promise.resolve()}function a(l,u){if(n[l].isActive===u)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(l,u)),n[l].isActive=u;const c=r(l);for(const f in n)n[f].protectedKeys={};return c}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ys()}}}function uc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Pr(e,t):!1}function ot(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ys(){return{animate:ot(!0),whileInView:ot(),whileHover:ot(),whileTap:ot(),whileDrag:ot(),whileFocus:ot(),exit:ot()}}function vs(t,e){t.min=e.min,t.max=e.max}function _(t,e){vs(t.x,e.x),vs(t.y,e.y)}function Ts(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const Cr=1e-4,hc=1-Cr,fc=1+Cr,Ar=.01,dc=0-Ar,pc=0+Ar;function j(t){return t.max-t.min}function mc(t,e,n){return Math.abs(t-e)<=n}function xs(t,e,n,s=.5){t.origin=s,t.originPoint=M(e.min,e.max,t.origin),t.scale=j(n)/j(e),t.translate=M(n.min,n.max,t.origin)-t.originPoint,(t.scale>=hc&&t.scale<=fc||isNaN(t.scale))&&(t.scale=1),(t.translate>=dc&&t.translate<=pc||isNaN(t.translate))&&(t.translate=0)}function Dt(t,e,n,s){xs(t.x,e.x,n.x,s?s.originX:void 0),xs(t.y,e.y,n.y,s?s.originY:void 0)}function bs(t,e,n){t.min=n.min+e.min,t.max=t.min+j(e)}function gc(t,e,n){bs(t.x,e.x,n.x),bs(t.y,e.y,n.y)}function Ss(t,e,n){t.min=e.min-n.min,t.max=t.min+j(e)}function Jt(t,e,n){Ss(t.x,e.x,n.x),Ss(t.y,e.y,n.y)}function ws(t,e,n,s,i){return t-=e,t=Zt(t,1/n,s),i!==void 0&&(t=Zt(t,1/i,s)),t}function yc(t,e=0,n=1,s=.5,i,o=t,r=t){if(X.test(e)&&(e=parseFloat(e),e=M(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=M(o.min,o.max,s);t===o&&(a-=e),t.min=ws(t.min,e,n,a,i),t.max=ws(t.max,e,n,a,i)}function Ps(t,e,[n,s,i],o,r){yc(t,e[n],e[s],e[i],e.scale,o,r)}const vc=["x","scaleX","originX"],Tc=["y","scaleY","originY"];function Cs(t,e,n,s){Ps(t.x,e,vc,n?n.x:void 0,s?s.x:void 0),Ps(t.y,e,Tc,n?n.y:void 0,s?s.y:void 0)}function As(t){return t.translate===0&&t.scale===1}function Vr(t){return As(t.x)&&As(t.y)}function Vs(t,e){return t.min===e.min&&t.max===e.max}function xc(t,e){return Vs(t.x,e.x)&&Vs(t.y,e.y)}function Ds(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Dr(t,e){return Ds(t.x,e.x)&&Ds(t.y,e.y)}function Rs(t){return j(t.x)/j(t.y)}function Ms(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function W(t){return[t("x"),t("y")]}function bc(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:h,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),f&&(s+=`rotateX(${f}deg) `),h&&(s+=`rotateY(${h}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Rr=["TopLeft","TopRight","BottomLeft","BottomRight"],Sc=Rr.length,Es=t=>typeof t=="string"?parseFloat(t):t,Ls=t=>typeof t=="number"||b.test(t);function wc(t,e,n,s,i,o){i?(t.opacity=M(0,n.opacity??1,Pc(s)),t.opacityExit=M(e.opacity??1,0,Cc(s))):o&&(t.opacity=M(e.opacity??1,n.opacity??1,s));for(let r=0;r<Sc;r++){const a=`border${Rr[r]}Radius`;let l=ks(e,a),u=ks(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Ls(l)===Ls(u)?(t[a]=Math.max(M(Es(l),Es(u),s),0),(X.test(u)||X.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=M(e.rotate||0,n.rotate||0,s))}function ks(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Pc=Mr(0,.5,Pi),Cc=Mr(.5,.95,$);function Mr(t,e,n){return s=>s<t?0:s>e?1:n(Mt(t,e,s))}function Ac(t,e,n){const s=O(t)?t:yt(t);return s.start(vn("",s,e,n)),s.animation}function It(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Vc=(t,e)=>t.depth-e.depth;class Dc{constructor(){this.children=[],this.isDirty=!1}add(e){tn(this.children,e),this.isDirty=!0}remove(e){en(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Vc),this.isDirty=!1,this.children.forEach(e)}}function Rc(t,e){const n=B.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(nt(s),t(o-e))};return D.setup(s,!0),()=>nt(s)}function Gt(t){return O(t)?t.get():t}class Mc{constructor(){this.members=[]}add(e){tn(this.members,e),e.scheduleRender()}remove(e){if(en(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender();const i=s.options.layoutDependency,o=e.options.layoutDependency;i!==void 0&&o!==void 0&&i===o||(e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0));const{crossfade:a}=e.options;a===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const zt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},pe=["","X","Y","Z"],Ec=1e3;let Lc=0;function me(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Er(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=qi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",D,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Er(s)}function Lr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e?.()){this.id=Lc++,this.animationId=0,this.animationCommitId=0,this.children=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=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Fc),this.nodes.forEach(Nc),this.nodes.forEach(Uc),this.nodes.forEach(Oc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Dc)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new rn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=lr(r)&&!Il(r),this.instance=r;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,f=0;const h=()=>this.root.updateBlockedByResize=!1;D.read(()=>{f=window.innerWidth}),t(r,()=>{const d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,c&&c(),c=Rc(h,250),zt.hasAnimatedSinceResize&&(zt.hasAnimatedSinceResize=!1,this.nodes.forEach(Os)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Hc,{onLayoutAnimationStart:g,onLayoutAnimationComplete:T}=u.getProps(),x=!this.targetLayout||!Dr(this.targetLayout,d),S=!f&&h;if(this.options.layoutRoot||this.resumeFrom||S||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...yn(p,"layout"),onPlay:g,onComplete:T};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(c,S)}else f||Os(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),nt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Wc),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Er(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Is);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Fs);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(jc),this.nodes.forEach(kc),this.nodes.forEach(Ic)):this.nodes.forEach(Fs),this.clearAllSnapshots();const a=B.now();F.delta=Y(0,1e3/60,a-F.timestamp),F.timestamp=a,F.isProcessing=!0,oe.update.process(F),oe.preRender.process(F),oe.render.process(F),F.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Sn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Bc),this.sharedNodes.forEach(Kc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,D.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){D.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!j(this.snapshot.measuredBox.x)&&!j(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=k(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Vr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&this.instance&&(a||at(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Gc(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return k();const a=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(zc))){const{scroll:u}=this.root;u&&(pt(a.x,u.offset.x),pt(a.y,u.offset.y))}return a}removeElementScroll(r){const a=k();if(_(a,r),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:f}=u;u!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&_(a,r),pt(a.x,c.offset.x),pt(a.y,c.offset.y))}return a}applyTransform(r,a=!1){const l=k();_(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&mt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),at(c.latestValues)&&mt(l,c.latestValues)}return at(this.latestValues)&&mt(l,this.latestValues),l}removeTransform(r){const a=k();_(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!at(u.latestValues))continue;He(u.latestValues)&&u.updateSnapshot();const c=k(),f=u.measurePageBox();_(c,f),Cs(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return at(this.latestValues)&&Cs(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}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!==F.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:f}=this.options;if(!this.layout||!(c||f))return;this.resolvedRelativeTargetAt=F.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=k(),this.targetWithTransforms=k()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),gc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):_(this.target,this.layout.layoutBox),mr(this.target,this.targetDelta)):_(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||He(this.parent.latestValues)||pr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,a,l){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=k(),this.relativeTargetOrigin=k(),Jt(this.relativeTargetOrigin,a,l),_(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===F.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;_(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;Hl(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=k());const{target:d}=r;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ts(this.prevProjectionDelta.x,this.projectionDelta.x),Ts(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Ms(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ms(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=dt(),this.projectionDelta=dt(),this.projectionDeltaWithTransform=dt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=dt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=k(),d=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=d!==p,T=this.getStack(),x=!T||T.members.length<=1,S=!!(g&&!x&&this.options.crossfade===!0&&!this.path.some(_c));this.animationProgress=0;let y;this.mixTargetDelta=v=>{const P=v/1e3;Bs(f.x,r.x,P),Bs(f.y,r.y,P),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Jt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$c(this.relativeTarget,this.relativeTargetOrigin,h,P),y&&xc(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=k()),_(y,this.relativeTarget)),g&&(this.animationValues=c,wc(c,u,this.latestValues,P,S,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(nt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=D.update(()=>{zt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=yt(0)),this.currentAnimation=Ac(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ec),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&kr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||k();const f=j(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+f;const h=j(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+h}_(a,l),mt(a,c),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Mc),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&me("z",r,u,this.animationValues);for(let c=0;c<pe.length;c++)me(`rotate${pe[c]}`,r,u,this.animationValues),me(`skew${pe[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=Gt(a?.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=Gt(a?.pointerEvents)||""),this.hasProjected&&!at(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=bc(this.projectionDeltaWithTransform,this.treeScale,c);l&&(f=l(c,f)),r.transform=f;const{x:h,y:d}=this.projectionDelta;r.transformOrigin=`${h.origin*100}% ${d.origin*100}% 0`,u.animationValues?r.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:r.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in ze){if(c[p]===void 0)continue;const{correct:g,applyTo:T,isCSSVariable:x}=ze[p],S=f==="none"?c[p]:g(c[p],u);if(T){const y=T.length;for(let v=0;v<y;v++)r[T[v]]=S}else x?this.options.visualElement.renderState.vars[p]=S:r[p]=S}this.options.layoutId&&(r.pointerEvents=u===this?Gt(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(Is),this.root.sharedNodes.clear()}}}function kc(t){t.updateLayout()}function Ic(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;i==="size"?W(c=>{const f=o?e.measuredBox[c]:e.layoutBox[c],h=j(f);f.min=n[c].min,f.max=f.min+h}):kr(i,e.layoutBox,n)&&W(c=>{const f=o?e.measuredBox[c]:e.layoutBox[c],h=j(n[c]);f.max=f.min+h,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+h)});const r=dt();Dt(r,n,e.layoutBox);const a=dt();o?Dt(a,t.applyTransform(s,!0),e.measuredBox):Dt(a,n,e.layoutBox);const l=!Vr(r);let u=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:f,layout:h}=c;if(f&&h){const d=k();Jt(d,e.layoutBox,f.layoutBox);const p=k();Jt(p,n,h.layoutBox),Dr(d,p)||(u=!0),c.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=d,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Fc(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Oc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Bc(t){t.clearSnapshot()}function Is(t){t.clearMeasurements()}function Fs(t){t.isLayoutDirty=!1}function jc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Os(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Nc(t){t.resolveTargetDelta()}function Uc(t){t.calcProjection()}function Wc(t){t.resetSkewAndRotation()}function Kc(t){t.removeLeadSnapshot()}function Bs(t,e,n){t.translate=M(e.translate,0,n),t.scale=M(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function js(t,e,n,s){t.min=M(e.min,n.min,s),t.max=M(e.max,n.max,s)}function $c(t,e,n,s){js(t.x,e.x,n.x,s),js(t.y,e.y,n.y,s)}function _c(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Hc={duration:.45,ease:[.4,0,.1,1]},Ns=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Us=Ns("applewebkit/")&&!Ns("chrome/")?Math.round:$;function Ws(t){t.min=Us(t.min),t.max=Us(t.max)}function Gc(t){Ws(t.x),Ws(t.y)}function kr(t,e,n){return t==="position"||t==="preserve-aspect"&&!mc(Rs(e),Rs(n),.2)}function zc(t){return t!==t.root&&t.scroll?.wasRoot}const Xc=Lr({attachResizeListener:(t,e)=>It(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ge={current:void 0},Ir=Lr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ge.current){const t=new Xc({});t.mount(window),t.setOptions({layoutScroll:!0}),ge.current=t}return ge.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Dn=m.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ks(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Yc(...t){return e=>{let n=!1;const s=t.map(i=>{const o=Ks(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<s.length;i++){const o=s[i];typeof o=="function"?o():Ks(t[i],null)}}}}function Qc(...t){return m.useCallback(Yc(...t),t)}class qc extends m.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=$e(s)&&s.offsetWidth||0,o=$e(s)&&s.offsetHeight||0,r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft,r.right=i-r.width-r.left,r.bottom=o-r.height-r.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Zc({children:t,isPresent:e,anchorX:n,anchorY:s,root:i}){const o=m.useId(),r=m.useRef(null),a=m.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:l}=m.useContext(Dn),u=t.props?.ref??t?.ref,c=Qc(r,u);return m.useInsertionEffect(()=>{const{width:f,height:h,top:d,left:p,right:g,bottom:T}=a.current;if(e||!r.current||!f||!h)return;const x=n==="left"?`left: ${p}`:`right: ${g}`,S=s==="bottom"?`bottom: ${T}`:`top: ${d}`;r.current.dataset.motionPopId=o;const y=document.createElement("style");l&&(y.nonce=l);const v=i??document.head;return v.appendChild(y),y.sheet&&y.sheet.insertRule(`
2
- [data-motion-pop-id="${o}"] {
3
- position: absolute !important;
4
- width: ${f}px !important;
5
- height: ${h}px !important;
6
- ${x}px !important;
7
- ${S}px !important;
8
- }
9
- `),()=>{v.contains(y)&&v.removeChild(y)}},[e]),Q.jsx(qc,{isPresent:e,childRef:r,sizeRef:a,children:m.cloneElement(t,{ref:c})})}const Jc=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r,anchorX:a,anchorY:l,root:u})=>{const c=Je(tu),f=m.useId();let h=!0,d=m.useMemo(()=>(h=!1,{id:f,initial:e,isPresent:n,custom:i,onExitComplete:p=>{c.set(p,!0);for(const g of c.values())if(!g)return;s&&s()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[n,c,s]);return o&&h&&(d={...d}),m.useMemo(()=>{c.forEach((p,g)=>c.set(g,!1))},[n]),m.useEffect(()=>{!n&&!c.size&&s&&s()},[n]),r==="popLayout"&&(t=Q.jsx(Zc,{isPresent:n,anchorX:a,anchorY:l,root:u,children:t})),Q.jsx(ee.Provider,{value:d,children:t})};function tu(){return new Map}function Fr(t=!0){const e=m.useContext(ee);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=m.useId();m.useEffect(()=>{if(t)return i(o)},[t]);const r=m.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Kt=t=>t.key||"";function $s(t){const e=[];return m.Children.forEach(t,n=>{m.isValidElement(n)&&e.push(n)}),e}const Oh=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[c,f]=Fr(r),h=m.useMemo(()=>$s(t),[t]),d=r&&!c?[]:h.map(Kt),p=m.useRef(!0),g=m.useRef(h),T=Je(()=>new Map),x=m.useRef(new Set),[S,y]=m.useState(h),[v,P]=m.useState(h);di(()=>{p.current=!1,g.current=h;for(let w=0;w<v.length;w++){const C=Kt(v[w]);d.includes(C)?(T.delete(C),x.current.delete(C)):T.get(C)!==!0&&T.set(C,!1)}},[v,d.length,d.join("-")]);const A=[];if(h!==S){let w=[...h];for(let C=0;C<v.length;C++){const R=v[C],N=Kt(R);d.includes(N)||(w.splice(C,0,R),A.push(R))}return o==="wait"&&A.length&&(w=A),P($s(w)),y(h),null}const{forceRender:V}=m.useContext(Ze);return Q.jsx(Q.Fragment,{children:v.map(w=>{const C=Kt(w),R=r&&!c?!1:h===v||d.includes(C),N=()=>{if(x.current.has(C))return;if(x.current.add(C),T.has(C))T.set(C,!0);else return;let z=!0;T.forEach(J=>{J||(z=!1)}),z&&(V?.(),P(g.current),r&&f?.(),s&&s())};return Q.jsx(Jc,{isPresent:R,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:o,root:u,onExitComplete:R?void 0:N,anchorX:a,anchorY:l,children:w},C)})})},Or=m.createContext({strict:!1}),_s={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],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"]};let Hs=!1;function eu(){if(Hs)return;const t={};for(const e in _s)t[e]={isEnabled:n=>_s[e].some(s=>!!n[s])};hr(t),Hs=!0}function Br(){return eu(),Wl()}function nu(t){const e=Br();for(const n in t)e[n]={...e[n],...t[n]};hr(e)}const su=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function te(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||su.has(t)}let jr=t=>!te(t);function iu(t){typeof t=="function"&&(jr=e=>e.startsWith("on")?!te(e):t(e))}try{iu(require("@emotion/is-prop-valid").default)}catch{}function ru(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(jr(i)||n===!0&&te(i)||!e&&!te(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const ie=m.createContext({});function ou(t,e){if(se(t)){const{initial:n,animate:s}=t;return{initial:n===!1||kt(n)?n:void 0,animate:kt(s)?s:void 0}}return t.inherit!==!1?e:{}}function au(t){const{initial:e,animate:n}=ou(t,m.useContext(ie));return m.useMemo(()=>({initial:e,animate:n}),[Gs(e),Gs(n)])}function Gs(t){return Array.isArray(t)?t.join(" "):t}const Rn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Nr(t,e,n){for(const s in e)!O(e[s])&&!vr(s,n)&&(t[s]=e[s])}function lu({transformTemplate:t},e){return m.useMemo(()=>{const n=Rn();return An(n,e,t),Object.assign({},n.vars,n.style)},[e])}function cu(t,e){const n=t.style||{},s={};return Nr(s,n,t),Object.assign(s,lu(t,e)),s}function uu(t,e){const n={},s=cu(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Ur=()=>({...Rn(),attrs:{}});function hu(t,e,n,s){const i=m.useMemo(()=>{const o=Ur();return Tr(o,e,br(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Nr(o,t.style,t),i.style={...o,...i.style}}return i}const fu=["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 Mn(t){return typeof t!="string"||t.includes("-")?!1:!!(fu.indexOf(t)>-1||/[A-Z]/u.test(t))}function du(t,e,n,{latestValues:s},i,o=!1,r){const l=(r??Mn(t)?hu:uu)(e,s,i,t),u=ru(e,typeof t=="string",o),c=t!==m.Fragment?{...u,...l,ref:n}:{},{children:f}=e,h=m.useMemo(()=>O(f)?f.get():f,[f]);return m.createElement(t,{...c,children:h})}function pu({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:mu(n,s,i,t),renderState:e()}}function mu(t,e,n,s){const i={},o=s(t,{});for(const h in o)i[h]=Gt(o[h]);let{initial:r,animate:a}=t;const l=se(t),u=ur(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const f=c?a:r;if(f&&typeof f!="boolean"&&!ne(f)){const h=Array.isArray(f)?f:[f];for(let d=0;d<h.length;d++){const p=Tn(t,h[d]);if(p){const{transitionEnd:g,transition:T,...x}=p;for(const S in x){let y=x[S];if(Array.isArray(y)){const v=c?y.length-1:0;y=y[v]}y!==null&&(i[S]=y)}for(const S in g)i[S]=g[S]}}}return i}const Wr=t=>(e,n)=>{const s=m.useContext(ie),i=m.useContext(ee),o=()=>pu(t,e,s,i);return n?o():Je(o)},gu=Wr({scrapeMotionValuesFromProps:Vn,createRenderState:Rn}),yu=Wr({scrapeMotionValuesFromProps:Sr,createRenderState:Ur}),vu=Symbol.for("motionComponentSymbol");function Tu(t,e,n){const s=m.useRef(n);m.useInsertionEffect(()=>{s.current=n});const i=m.useRef(null);return m.useCallback(o=>{o&&t.onMount?.(o),e&&(o?e.mount(o):e.unmount());const r=s.current;if(typeof r=="function")if(o){const a=r(o);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):r(o);else r&&(r.current=o)},[e])}const Kr=m.createContext({});function Pt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function xu(t,e,n,s,i,o){const{visualElement:r}=m.useContext(ie),a=m.useContext(Or),l=m.useContext(ee),u=m.useContext(Dn).reducedMotion,c=m.useRef(null),f=m.useRef(!1);s=s||a.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:r,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,isSVG:o}),f.current&&c.current&&(c.current.manuallyAnimateOnMount=!0));const h=c.current,d=m.useContext(Kr);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&bu(c.current,n,i,d);const p=m.useRef(!1);m.useInsertionEffect(()=>{h&&p.current&&h.update(n,l)});const g=n[Qi],T=m.useRef(!!g&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return di(()=>{f.current=!0,h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),T.current&&h.animationState&&h.animationState.animateChanges())}),m.useEffect(()=>{h&&(!T.current&&h.animationState&&h.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),T.current=!1),h.enteringChildren=void 0)}),h}function bu(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:$r(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&Pt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function $r(t){if(t)return t.options.allowProjection!==!1?t.projection:$r(t.parent)}function ye(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&nu(s);const o=n?n==="svg":Mn(t),r=o?yu:gu;function a(u,c){let f;const h={...m.useContext(Dn),...u,layoutId:Su(u)},{isStatic:d}=h,p=au(u),g=r(u,d);if(!d&&fi){wu();const T=Pu(h);f=T.MeasureLayout,p.visualElement=xu(t,g,h,i,T.ProjectionNode,o)}return Q.jsxs(ie.Provider,{value:p,children:[f&&p.visualElement?Q.jsx(f,{visualElement:p.visualElement,...h}):null,du(t,u,Tu(g,p.visualElement,c),g,d,e,o)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=m.forwardRef(a);return l[vu]=t,l}function Su({layoutId:t}){const e=m.useContext(Ze).id;return e&&t!==void 0?e+"-"+t:t}function wu(t,e){m.useContext(Or).strict}function Pu(t){const e=Br(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Cu(t,e){if(typeof Proxy>"u")return ye;const n=new Map,s=(o,r)=>ye(o,r,t,e),i=(o,r)=>s(o,r);return new Proxy(i,{get:(o,r)=>r==="create"?s:(n.has(r)||n.set(r,ye(r,void 0,t,e)),n.get(r))})}const Au=(t,e)=>e.isSVG??Mn(t)?new ic(e):new Zl(e,{allowProjection:t!==m.Fragment});class Vu extends it{constructor(e){super(e),e.animationState||(e.animationState=cc(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ne(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Du=0;class Ru extends it{constructor(){super(...arguments),this.id=Du++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Mu={animation:{Feature:Vu},exit:{Feature:Ru}};function jt(t){return{point:{x:t.pageX,y:t.pageY}}}const Eu=t=>e=>wn(e)&&t(e,jt(e));function Rt(t,e,n,s){return It(t,e,Eu(n),s)}const _r=({current:t})=>t?t.ownerDocument.defaultView:null,zs=(t,e)=>Math.abs(t-e);function Lu(t,e){const n=zs(t.x,e.x),s=zs(t.y,e.y);return Math.sqrt(n**2+s**2)}const Xs=new Set(["auto","scroll"]);class Hr{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Te(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=Lu(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:T}=d,{timestamp:x}=F;this.history.push({...T,timestamp:x});const{onStart:S,onMove:y}=this.handlers;p||(S&&S(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=ve(p,this.transformPagePoint),D.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:g,onSessionEnd:T,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=Te(d.type==="pointercancel"?this.lastMoveEventInfo:ve(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,S),T&&T(d,S)},!wn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const l=jt(e),u=ve(l,this.transformPagePoint),{point:c}=u,{timestamp:f}=F;this.history=[{...c,timestamp:f}];const{onSessionStart:h}=n;h&&h(e,Te(u,this.history)),this.removeListeners=Ft(Rt(this.contextWindow,"pointermove",this.handlePointerMove),Rt(this.contextWindow,"pointerup",this.handlePointerUp),Rt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Xs.has(s.overflowX)||Xs.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:i.x-n.x,y:i.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,i),D.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),nt(this.updatePoint)}}function ve(t,e){return e?{point:e(t.point)}:t}function Ys(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Te({point:t},e){return{point:t,delta:Ys(t,Gr(e)),offset:Ys(t,ku(e)),velocity:Iu(e,.1)}}function ku(t){return t[0]}function Gr(t){return t[t.length-1]}function Iu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Gr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>q(e)));)n--;if(!s)return{x:0,y:0};const o=K(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Fu(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?M(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?M(n,t,s.max):Math.min(t,n)),t}function Qs(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Ou(t,{top:e,left:n,bottom:s,right:i}){return{x:Qs(t.x,n,i),y:Qs(t.y,e,s)}}function qs(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Bu(t,e){return{x:qs(t.x,e.x),y:qs(t.y,e.y)}}function ju(t,e){let n=.5;const s=j(t),i=j(e);return i>s?n=Mt(e.min,e.max-s,t.min):s>i&&(n=Mt(t.min,t.max-i,e.min)),Y(0,1,n)}function Nu(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Xe=.35;function Uu(t=Xe){return t===!1?t=0:t===!0&&(t=Xe),{x:Zs(t,"left","right"),y:Zs(t,"top","bottom")}}function Zs(t,e,n){return{min:Js(t,e),max:Js(t,n)}}function Js(t,e){return typeof t=="number"?t:t[e]||0}const Wu=new WeakMap;class Ku{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=k(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=f=>{n?(this.stopAnimation(),this.snapToCursor(jt(f).point)):this.pauseAnimation()},r=(f,h)=>{this.stopAnimation();const{drag:d,dragPropagation:p,onDragStart:g}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Rl(d),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),W(x=>{let S=this.getAxisMotionValue(x).get()||0;if(X.test(S)){const{projection:y}=this.visualElement;if(y&&y.layout){const v=y.layout.layoutBox[x];v&&(S=j(v)*(parseFloat(S)/100))}}this.originPoint[x]=S}),g&&D.postRender(()=>g(f,h)),Ue(this.visualElement,"transform");const{animationState:T}=this.visualElement;T&&T.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:g,onDrag:T}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:x}=h;if(p&&this.currentDirection===null){this.currentDirection=$u(x),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),T&&T(f,h)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>W(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Hr(e,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:_r(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!s)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&D.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!$t(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=Fu(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&Pt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=Ou(s.layoutBox,e):this.constraints=!1,this.elastic=Uu(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&W(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Nu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Pt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Gl(s,i.root,this.visualElement.getTransformPagePoint());let r=Bu(i.layout.layoutBox,o);if(n){const a=n($l(r));this.hasMutatedConstraints=!!a,a&&(r=dr(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=W(c=>{if(!$t(c,n,this.currentDirection))return;let f=l&&l[c]||{};r&&(f={min:0,max:0});const h=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[c]:0,bounceStiffness:h,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Ue(this.visualElement,e),s.start(vn(e,s,0,n,this.visualElement,!1))}stopAnimation(){W(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){W(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){W(n=>{const{drag:s}=this.getProps();if(!$t(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n],l=o.get()||0;o.set(e[n]-M(r,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Pt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};W(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=ju({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),W(r=>{if(!$t(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(M(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;Wu.set(this.visualElement,this);const e=this.visualElement.current,n=Rt(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps(),f=l.target,h=f!==e&&ar(f);u&&c&&!h&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();Pt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),D.read(s);const r=It(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(W(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())}));return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=Xe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function $t(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function $u(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class _u extends it{constructor(e){super(e),this.removeGroupControls=$,this.removeListeners=$,this.controls=new Ku(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||$}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const ti=t=>(e,n)=>{t&&D.postRender(()=>t(e,n))};class Hu extends it{constructor(){super(...arguments),this.removePointerDownListener=$}onPointerDown(e){this.session=new Hr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:_r(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:ti(e),onStart:ti(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&D.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Rt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let xe=!1;class Gu extends m.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),xe&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),zt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,e.layoutDependency!==n&&r.setOptions({...r.options,layoutDependency:n}),xe=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||D.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Sn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;xe=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function zr(t){const[e,n]=Fr(),s=m.useContext(Ze);return Q.jsx(Gu,{...t,layoutGroup:s,switchLayoutGroup:m.useContext(Kr),isPresent:e,safeToRemove:n})}const zu={pan:{Feature:Hu},drag:{Feature:_u,ProjectionNode:Ir,MeasureLayout:zr}};function ei(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&D.postRender(()=>o(e,jt(e)))}class Xu extends it{mount(){const{current:e}=this.node;e&&(this.unmount=Ml(e,(n,s)=>(ei(this.node,s,"Start"),i=>ei(this.node,i,"End"))))}unmount(){}}class Yu extends it{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=Ft(It(this.node.current,"focus",()=>this.onFocus()),It(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ni(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&D.postRender(()=>o(e,jt(e)))}class Qu extends it{mount(){const{current:e}=this.node;e&&(this.unmount=kl(e,(n,s)=>(ni(this.node,s,"Start"),(i,{success:o})=>ni(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ye=new WeakMap,be=new WeakMap,qu=t=>{const e=Ye.get(t.target);e&&e(t)},Zu=t=>{t.forEach(qu)};function Ju({root:t,...e}){const n=t||document;be.has(n)||be.set(n,{});const s=be.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Zu,{root:t,...e})),s[i]}function th(t,e,n){const s=Ju(e);return Ye.set(t,n),s.observe(t),()=>{Ye.delete(t),s.unobserve(t)}}const eh={some:0,all:1};class nh extends it{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:eh[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),h=u?c:f;h&&h(l)};return th(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(sh(e,n))&&this.startObserver()}unmount(){}}function sh({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ih={inView:{Feature:nh},tap:{Feature:Qu},focus:{Feature:Yu},hover:{Feature:Xu}},rh={layout:{ProjectionNode:Ir,MeasureLayout:zr}},oh={...Mu,...ih,...zu,...rh},Bh=Cu(oh,Au),ah=()=>{},lh=typeof document<"u"?m.useLayoutEffect:ah;function re(){return typeof window<"u"}function En(t){return Xr(t)?(t.nodeName||"").toLowerCase():"#document"}function bt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ch(t){var e;return(e=(Xr(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xr(t){return re()?t instanceof Node||t instanceof bt(t).Node:!1}function Yr(t){return re()?t instanceof Element||t instanceof bt(t).Element:!1}function Ln(t){return re()?t instanceof HTMLElement||t instanceof bt(t).HTMLElement:!1}function si(t){return!re()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof bt(t).ShadowRoot}const uh=new Set(["inline","contents"]);function Qr(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=Zr(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&!uh.has(i)}const hh=new Set(["table","td","th"]);function jh(t){return hh.has(En(t))}const fh=[":popover-open",":modal"];function dh(t){return fh.some(e=>{try{return t.matches(e)}catch{return!1}})}const ph=["transform","translate","scale","rotate","perspective"],mh=["transform","translate","scale","rotate","perspective","filter"],gh=["paint","layout","strict","content"];function yh(t){const e=vh(),n=Yr(t)?Zr(t):t;return ph.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||mh.some(s=>(n.willChange||"").includes(s))||gh.some(s=>(n.contain||"").includes(s))}function Nh(t){let e=Qe(t);for(;Ln(e)&&!qr(e);){if(yh(e))return e;if(dh(e))return null;e=Qe(e)}return null}function vh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Th=new Set(["html","body","#document"]);function qr(t){return Th.has(En(t))}function Zr(t){return bt(t).getComputedStyle(t)}function Uh(t){return Yr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Qe(t){if(En(t)==="html")return t;const e=t.assignedSlot||t.parentNode||si(t)&&t.host||ch(t);return si(e)?e.host:e}function Jr(t){const e=Qe(t);return qr(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ln(e)&&Qr(e)?e:Jr(e)}function ii(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Jr(t),o=i===((s=t.ownerDocument)==null?void 0:s.body),r=bt(i);if(o){const a=xh(r);return e.concat(r,r.visualViewport||[],Qr(i)?i:[],a&&n?ii(a):[])}return e.concat(i,ii(i,[],n))}function xh(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const Se=ui[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],bh=Se&&Se!==m.useLayoutEffect?Se:t=>t();function ri(t){const e=ao(Sh).current;return e.next=t,bh(e.effect),e.trampoline}function Sh(){const t={next:void 0,callback:wh,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function wh(){}const Ph={...ui};let oi=0;function Ch(t,e="mui"){const[n,s]=m.useState(t),i=t||n;return m.useEffect(()=>{n==null&&(oi+=1,s(`${e}-${oi}`))},[n,e]),i}const ai=Ph.useId;function Ah(t,e){if(ai!==void 0){const n=ai();return t??(e?`${e}-${n}`:n)}return Ch(t,e)}const Wh="none",Kh="trigger-press",$h="trigger-hover",_h="trigger-focus",Hh="outside-press",Gh="item-press",zh="close-press",Xh="focus-out",Yh="escape-key",Qh="list-navigation",qh="cancel-open",Zh="sibling-open",Jh="disabled",tf="imperative-action";function ef(t,e,n,s){let i=!1,o=!1;const r=s??lo;return{reason:t,event:e??new Event("base-ui"),cancel(){i=!0},allowPropagation(){o=!0},get isCanceled(){return i},get isPropagationAllowed(){return o},trigger:n,...r}}const to={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},nf={...to,position:"fixed",top:0,left:0},sf={...to,position:"absolute"};function rf(t){return Ah(t,"base-ui")}const Vh=m.createContext(void 0);function Dh(t=!1){const e=m.useContext(Vh);if(e===void 0&&!t)throw new Error(co(16));return e}function Rh(t){const{focusableWhenDisabled:e,disabled:n,composite:s=!1,tabIndex:i=0,isNativeButton:o}=t,r=s&&e!==!1,a=s&&e===!1;return{props:m.useMemo(()=>{const u={onKeyDown(c){n&&e&&c.key!=="Tab"&&c.preventDefault()}};return s||(u.tabIndex=i,!o&&n&&(u.tabIndex=e?i:-1)),(o&&(e||r)||!o&&n)&&(u["aria-disabled"]=n),o&&(!e||a)&&(u.disabled=n),u},[s,n,e,r,a,o,i])}}function of(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=t,o=m.useRef(null),r=Dh(!0)!==void 0,a=ri(()=>{const h=o.current;return!!(h?.tagName==="A"&&h?.href)}),{props:l}=Rh({focusableWhenDisabled:n,disabled:e,composite:r,tabIndex:s,isNativeButton:i}),u=m.useCallback(()=>{const h=o.current;Mh(h)&&r&&e&&l.disabled===void 0&&h.disabled&&(h.disabled=!1)},[e,l.disabled,r]);lh(u,[u]);const c=m.useCallback((h={})=>{const{onClick:d,onMouseDown:p,onKeyUp:g,onKeyDown:T,onPointerDown:x,...S}=h;return uo({type:i?"button":void 0,onClick(v){if(e){v.preventDefault();return}d?.(v)},onMouseDown(v){e||p?.(v)},onKeyDown(v){if(e||(jn(v),T?.(v)),v.baseUIHandlerPrevented)return;const P=v.target===v.currentTarget&&!i&&!a()&&!e,A=v.key==="Enter",V=v.key===" ";P&&((V||A)&&v.preventDefault(),A&&d?.(v))},onKeyUp(v){e||(jn(v),g?.(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!i&&!e&&v.key===" "&&d?.(v)},onPointerDown(v){if(e){v.preventDefault();return}x?.(v)}},i?void 0:{role:"button"},l,S)},[e,l,i,a]),f=ri(h=>{o.current=h,u()});return{getButtonProps:c,buttonRef:f}}function Mh(t){return Ln(t)&&t.tagName==="BUTTON"}export{Oh as A,Dh as B,qr as C,Qe as D,qh as E,si as F,Xr as G,ii as H,Yr as I,ch as J,xh as K,vh as L,dh as M,jh as N,yh as O,Nh as P,Uh as Q,Jh as R,Vh as S,sf as T,ri as a,lh as b,ef as c,of as d,Ih as e,$h as f,En as g,Xh as h,Ln as i,bt as j,Zr as k,Qh as l,Bh as m,Wh as n,Hh as o,Ah as p,zh as q,Qr as r,tf as s,Kh as t,rf as u,nf as v,Gh as w,Zh as x,_h as y,Yh as z};
@@ -1,4 +0,0 @@
1
- const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "/home/runner/work/opencami/opencami/src/routes/__root.tsx", "children": ["/", "/agents", "/bots", "/connect", "/files", "/new", "/api/agents", "/api/cron", "/api/follow-ups", "/api/history", "/api/llm-features", "/api/models", "/api/paths", "/api/personas", "/api/ping", "/api/send", "/api/sessions", "/api/stream", "/api/stt", "/api/tts", "/chat/$sessionKey", "/api/files/delete", "/api/files/download", "/api/files/info", "/api/files/list", "/api/files/mkdir", "/api/files/read", "/api/files/rename", "/api/files/save", "/api/files/upload"], "preloads": ["/assets/main-CkIF0soY.js"], "assets": [] }, "/": { "filePath": "/home/runner/work/opencami/opencami/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-ByIsZcHh.js"] }, "/agents": { "filePath": "/home/runner/work/opencami/opencami/src/routes/agents.tsx", "assets": [], "preloads": ["/assets/agents-LFrWe-HX.js"] }, "/bots": { "filePath": "/home/runner/work/opencami/opencami/src/routes/bots.tsx", "assets": [], "preloads": ["/assets/bots-CxDwf_WK.js"] }, "/connect": { "filePath": "/home/runner/work/opencami/opencami/src/routes/connect.tsx", "assets": [], "preloads": ["/assets/connect-D3baVDFL.js", "/assets/index-CVV4XiZo.js", "/assets/button-Il3CHIzX.js", "/assets/react-BhVdgA5r.js"] }, "/files": { "filePath": "/home/runner/work/opencami/opencami/src/routes/files.tsx", "assets": [], "preloads": ["/assets/files-DMemuq9D.js"] }, "/new": { "filePath": "/home/runner/work/opencami/opencami/src/routes/new.tsx", "assets": [], "preloads": ["/assets/new-DLlBm66g.js"] }, "/api/agents": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/agents.ts" }, "/api/cron": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/cron.ts" }, "/api/follow-ups": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/follow-ups.ts" }, "/api/history": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/history.ts" }, "/api/llm-features": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/llm-features.ts" }, "/api/models": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/models.ts" }, "/api/paths": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/paths.ts" }, "/api/personas": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/personas.ts" }, "/api/ping": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/ping.ts" }, "/api/send": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/send.ts" }, "/api/sessions": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/sessions.ts" }, "/api/stream": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/stream.ts" }, "/api/stt": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/stt.ts" }, "/api/tts": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/tts.ts" }, "/chat/$sessionKey": { "filePath": "/home/runner/work/opencami/opencami/src/routes/chat/$sessionKey.tsx", "assets": [], "preloads": ["/assets/_sessionKey-DB95zj1L.js", "/assets/useButton-9VAzplAB.js", "/assets/tooltip-j_viC_EE.js", "/assets/button-Il3CHIzX.js", "/assets/use-file-explorer-state-BUH-u7Jv.js", "/assets/useControlled-Y306krcC.js", "/assets/useMutation-0WgW4xQJ.js", "/assets/opencami-logo-CIxSO1oo.js", "/assets/index-CVV4XiZo.js", "/assets/react-BhVdgA5r.js"] }, "/api/files/delete": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/delete.ts" }, "/api/files/download": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/download.ts" }, "/api/files/info": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/info.ts" }, "/api/files/list": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/list.ts" }, "/api/files/mkdir": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/mkdir.ts" }, "/api/files/read": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/read.ts" }, "/api/files/rename": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/rename.ts" }, "/api/files/save": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/save.ts" }, "/api/files/upload": { "filePath": "/home/runner/work/opencami/opencami/src/routes/api/files/upload.ts" } }, "clientEntry": "/assets/main-CkIF0soY.js" });
2
- export {
3
- tsrStartManifest
4
- };