ryugi-artifacts 1.96.0 → 1.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +4 -4
- package/dist/server.cjs +1 -1
- package/dist/viewer/{ActionBar-CBg5Lbhq.js → ActionBar-BEJ066Ej.js} +1 -1
- package/dist/viewer/{ActionIcon-Cc4tIoPf.js → ActionIcon-CelD6ljd.js} +1 -1
- package/dist/viewer/{AgentStatusPill-D0Rec9af.js → AgentStatusPill-B2LrXApc.js} +1 -1
- package/dist/viewer/{ArtboardLayout-C5pqwr8S.js → ArtboardLayout-DuPhmI2p.js} +1 -1
- package/dist/viewer/{ArtifactList-CXK1wKgO.js → ArtifactList-Cp_4E7tp.js} +1 -1
- package/dist/viewer/{ArtifactModal-DtAhWCXJ.js → ArtifactModal-D3ScY6_n.js} +1 -1
- package/dist/viewer/{Avatar-BkXEFoPL.js → Avatar-Bl67MCxf.js} +1 -1
- package/dist/viewer/{BottomSheet-BQW1npWE.js → BottomSheet-7r3g6yRy.js} +1 -1
- package/dist/viewer/{Canvas-BvgS7RZe.js → Canvas-BaCiqx37.js} +1 -1
- package/dist/viewer/{CloudLegalNotice-DqoeWQE4.js → CloudLegalNotice-C-lwr2NX.js} +1 -1
- package/dist/viewer/{Composer-t4_HrD_Y.js → Composer-DtmsJM8R.js} +1 -1
- package/dist/viewer/{CompositeItem-CPyga1ao.js → CompositeItem-r7w86f_k.js} +1 -1
- package/dist/viewer/{DocumentExportMenu-ChgnP6GL.js → DocumentExportMenu-DHSPKzzP.js} +1 -1
- package/dist/viewer/DocumentLayout-CJoYGdTu.js +2 -0
- package/dist/viewer/DocumentPage-CTXWOPjh.js +3 -0
- package/dist/viewer/{DraggablePanel-9ifKjt_G.js → DraggablePanel-DZLHeUmg.js} +1 -1
- package/dist/viewer/{DropdownMenu-COqNosvu.js → DropdownMenu-CJwUBLlC.js} +1 -1
- package/dist/viewer/{FieldControl-DGCh5UaB.js → FieldControl-CHQD9IDx.js} +1 -1
- package/dist/viewer/{GroupVerdict-CRdehNar.js → GroupVerdict-YCGvEg4H.js} +1 -1
- package/dist/viewer/{HtmlLayout-BtGbMait.js → HtmlLayout-L2YY8RF2.js} +1 -1
- package/dist/viewer/{Input-CbJjyKLA.js → Input-C4lfMDT0.js} +1 -1
- package/dist/viewer/{MenuTrigger-DeOY467Q.js → MenuTrigger-BP8vj2dt.js} +1 -1
- package/dist/viewer/{PhoneArtboardBar-D_NFOSi-.js → PhoneArtboardBar-BZpLfQYf.js} +1 -1
- package/dist/viewer/{PhoneSheet-hPziEorx.js → PhoneSheet-Dyg85WID.js} +1 -1
- package/dist/viewer/{Popover-mA0ZatAs.js → Popover-B_c2R3tb.js} +1 -1
- package/dist/viewer/{PreviewLayout-D6i9jAsH.js → PreviewLayout-Z9Q--w6E.js} +2 -2
- package/dist/viewer/{PublishMenu-VLSbq_cl.js → PublishMenu-eV9uW7Kg.js} +1 -1
- package/dist/viewer/{ReportLayout-TkIi9O3f.js → ReportLayout-DjlI-WU4.js} +1 -1
- package/dist/viewer/{Segmented-BqrFveQI.js → Segmented-xJdCLm-b.js} +1 -1
- package/dist/viewer/{Select-DOC2P1EA.js → Select-TB8D_2Ak.js} +1 -1
- package/dist/viewer/{SlidesLayout-Bgur5-Ez.js → SlidesLayout-DrnbCy4l.js} +3 -3
- package/dist/viewer/{SnapshotDocument-C0rk-m6N.js → SnapshotDocument-DeGHYbT2.js} +1 -1
- package/dist/viewer/{SplitFrame-CFXC7W03.js → SplitFrame-C8XTBMoN.js} +1 -1
- package/dist/viewer/{ThreadView-SodgS7UN.js → ThreadView-De_p-Sr1.js} +1 -1
- package/dist/viewer/{VerifyLayout-MN-8cJN7.js → VerifyLayout-Calc3qn5.js} +1 -1
- package/dist/viewer/{VirtualizedEditor-uWe43zaI-C1g9cCyX.js → VirtualizedEditor-uWe43zaI-CBFaNcDc.js} +1 -1
- package/dist/viewer/{VirtualizedRenderer-C_d95FXi-CiVdUIgQ.js → VirtualizedRenderer-C_d95FXi-Cg_8Iwar.js} +1 -1
- package/dist/viewer/{WarningsBadge-CFeZv8N3.js → WarningsBadge-BXOR30h4.js} +1 -1
- package/dist/viewer/{WhiteboardEditor-cZ32fLqJ-BHWo4yCF.js → WhiteboardEditor-cZ32fLqJ-BAVFcyMv.js} +1 -1
- package/dist/viewer/{WhiteboardLayout-Q-bMT-_q.js → WhiteboardLayout-CAcGLV3D.js} +1 -1
- package/dist/viewer/{WritingCursor-BDXPMRMS.js → WritingCursor-Bcmcf9RW.js} +1 -1
- package/dist/viewer/{api-DFo4Oqef.js → api-BCnpPU7U.js} +1 -1
- package/dist/viewer/{artifact-list-BWgn_fzw.js → artifact-list-BgZnDmry.js} +1 -1
- package/dist/viewer/{auto-publish-DHavv7el.js → auto-publish-CPtZZlz2.js} +1 -1
- package/dist/viewer/{channel-Cpar5IxH.js → channel-DM-J4UvB.js} +3 -3
- package/dist/viewer/{dist-rgEZOa2B.js → dist-0G4T7khJ.js} +1 -1
- package/dist/viewer/{dist-Bx1NxgVp.js → dist-B078fYsG.js} +1 -1
- package/dist/viewer/{dist-CQntsSqO.js → dist-B2eKRzdt.js} +1 -1
- package/dist/viewer/{dist-Xr1petIf.js → dist-BBkRo6YU.js} +1 -1
- package/dist/viewer/{dist-Du-e0WIr.js → dist-BKu_xDQJ.js} +1 -1
- package/dist/viewer/{dist-BZN2zA0y.js → dist-BQ9e4trY.js} +1 -1
- package/dist/viewer/{dist-CXUXyLWP.js → dist-BhEA0j6b.js} +1 -1
- package/dist/viewer/{dist-B9SEPjM9.js → dist-C5cT_f2R.js} +1 -1
- package/dist/viewer/{dist-C1vS2Suq.js → dist-CCL9krh0.js} +1 -1
- package/dist/viewer/{dist-DzarOfqM.js → dist-CFZeMEUu.js} +1 -1
- package/dist/viewer/{dist-DSX_HUxH.js → dist-CSznh8aj.js} +1 -1
- package/dist/viewer/{dist-DdZ3SfkZ.js → dist-CUM1f5sU.js} +1 -1
- package/dist/viewer/{dist-FYz4i8cO.js → dist-D4wETyt-.js} +2 -2
- package/dist/viewer/{dist-wKW8P0Oo.js → dist-D9vKXn61.js} +1 -1
- package/dist/viewer/{dist-CIwGvFo3.js → dist-DBdwPP9-.js} +1 -1
- package/dist/viewer/{dist-Cz69vRDy.js → dist-DE3_RTOy.js} +1 -1
- package/dist/viewer/{dist-DGge8ohf.js → dist-DJseCf4V.js} +1 -1
- package/dist/viewer/{dist-CQrf_3of.js → dist-DNArnIBh.js} +1 -1
- package/dist/viewer/{dist-CpL5hsD6.js → dist-DREvUDL0.js} +1 -1
- package/dist/viewer/{dist-Bpl4yhU-.js → dist-DkQsTfmV.js} +1 -1
- package/dist/viewer/{dist-bweeVyVC.js → dist-DtW-Vysc.js} +1 -1
- package/dist/viewer/{dist-DcDXtIp4.js → dist-DxWVxZGy.js} +1 -1
- package/dist/viewer/{dist-BXpWiPzV.js → dist-Dym_bxcg.js} +1 -1
- package/dist/viewer/{dist-BM4VNWsZ.js → dist-anZFdtZb.js} +1 -1
- package/dist/viewer/{editor-CkCjGIni.js → editor-CcqMiLz3.js} +4 -4
- package/dist/viewer/{icons-CvaVFQTZ.js → icons-DrkFjhmy.js} +1 -1
- package/dist/viewer/index.html +3 -3
- package/dist/viewer/index.js +2 -2
- package/dist/viewer/{local-split-host-1U6JgPrf.js → local-split-host-Dl9rlSsp.js} +1 -1
- package/dist/viewer/preview.html +5 -5
- package/dist/viewer/preview.js +1 -1
- package/dist/viewer/{printDocument-m74qXcoZ.js → printDocument-UiN1Tkyp.js} +1 -1
- package/dist/viewer/{read-resolutions-UVCd7r_y.js → read-resolutions-CyYzExQ1.js} +1 -1
- package/dist/viewer/{ref-Bu4VUCqZ.js → ref-CVmDwuKG.js} +1 -1
- package/dist/viewer/{route-GGJyt0jy.js → route-CBDn8aA_.js} +2 -2
- package/dist/viewer/{route-messages-C6xnnJlF.js → route-messages-hJ8pJxir.js} +1 -1
- package/dist/viewer/{settings-BVzw2sWx.js → settings-CnSJna4w.js} +1 -1
- package/dist/viewer/{snap-Bt8K5ih5.js → snap-BpI2bGh5.js} +1 -1
- package/dist/viewer/{split-BVOyh9Pb.js → split-B6eupXjE.js} +2 -2
- package/dist/viewer/{tokens.stylex-B10cCmJn.js → tokens.stylex-4hFgkDcQ.js} +1 -1
- package/dist/viewer/{url-DUdroRW6.js → url-D2nInhsE.js} +1 -1
- package/dist/viewer/{useArtifactFeed-ByaH7dmh.js → useArtifactFeed-r3p9_j2-.js} +1 -1
- package/dist/viewer/{useCloudStatus-Dt6-7IpT.js → useCloudStatus-_QzffzLo.js} +1 -1
- package/dist/viewer/{useScrollLock-KLGnvBoH.js → useScrollLock-DQ9j79Pm.js} +1 -1
- package/dist/viewer/{useTranslation-EB04DdQ1.js → useTranslation-UGm7Uo4m.js} +1 -1
- package/dist/viewer/{useTriggerFocusGuards-BeyIvwv6.js → useTriggerFocusGuards-qc8VJB2K.js} +1 -1
- package/dist/viewer/{view-DbJjmh_I.js → view-BVogu64x.js} +1 -1
- package/dist/viewer/{viewport-CFJHn_Y6-CLkou4bB.js → viewport-CFJHn_Y6-C9yC5trU.js} +1 -1
- package/package.json +1 -1
- package/dist/viewer/DocumentLayout-Deg-ZGA1.js +0 -2
- package/dist/viewer/DocumentPage-DhlG_hX7.js +0 -3
package/dist/viewer/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AgentStatusPill-
|
|
2
|
-
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{_ as n,b as r,m as i,n as a,o,p as s,t as c,v as l,w as u,y as d}from"./route-GGJyt0jy.js";/* empty css */import{$ as f,$t as p,At as m,B as h,Bt as g,Cr as _,Dt as v,Et as y,Ft as b,Gn as x,Gt as S,Ht as C,It as w,Jt as T,Kn as E,Kt as D,Lt as O,Mt as k,Nn as A,Or as j,Pt as ee,Q as te,Qt as ne,Rt as M,S as re,Sr as ie,Ut as N,V as ae,Vt as oe,Wt as se,X as ce,Xt as le,Y as ue,Yt as de,Z as P,Zt as fe,_t as pe,an as me,br as he,bt as ge,dn as _e,en as ve,et as ye,fn as be,ft as xe,gn as Se,gt as Ce,h as we,hn as Te,ht as Ee,in as De,it as Oe,jt as F,kt as ke,l as Ae,ln as je,lt as Me,m as Ne,mn as Pe,nn as Fe,nr as Ie,nt as Le,on as Re,pn as I,pt as ze,qt as Be,r as Ve,rn as He,rt as Ue,sn as We,tn as Ge,tt as Ke,un as qe,w as Je,xr as Ye,yr as Xe,yt as Ze,z as Qe,zt as $e}from"./url-DUdroRW6.js";import{G as et,H as tt,Q as nt,Z as rt,at as L,c as it,ct as at,it as ot,l as st,nt as ct,o as lt,ot as R,r as ut,rt as dt,s as ft}from"./mergeRefs-DM4719JU.js";import{Dn as pt,Ft as mt,J as ht,Jn as gt,Mt as _t,Nt as vt,Q as yt,Rn as bt,Tn as xt,Vt as St,an as Ct,b as wt,bn as Tt,g as Et,h as Dt,in as Ot,m as kt,on as At,rn as jt,wn as Mt,x as Nt}from"./useScrollLock-KLGnvBoH.js";import{n as Pt,r as Ft,t as z}from"./clsx-DRUh9g2d.js";import{t as It}from"./react-DlmbjZJV.js";import{t as Lt}from"./jsx-runtime-LKYXHABd.js";import{$ as Rt,B as zt,Ct as Bt,G as Vt,I as Ht,J as Ut,M as Wt,N as Gt,P as Kt,St as qt,Tt as Jt,U as B,W as V,_t as Yt,a as Xt,bt as Zt,c as Qt,ct as $t,d as en,dt as H,et as tn,gt as nn,h as rn,ht as an,i as on,l as sn,m as cn,mt as ln,o as un,p as dn,r as fn,s as pn,st as mn,t as hn,u as gn,ut as _n,wt as vn,xt as yn}from"./MotionConfigContext-B3czw3wn.js";import{$ as bn,$n as xn,$t as Sn,A as Cn,An as wn,At as Tn,B as En,Bn as Dn,Bt as On,C as kn,Cn as An,Cr as jn,Ct as Mn,D as Nn,Dn as Pn,Dt as Fn,E as In,En as Ln,Et as Rn,F as zn,Fn as Bn,Ft as Vn,G as Hn,Gn as Un,Gt as Wn,H as Gn,Hn as Kn,Ht as qn,I as Jn,In as Yn,It as Xn,J as Zn,Jn as Qn,Jt as $n,K as er,Kn as tr,Kt as nr,L as rr,Ln as ir,Lt as ar,M as or,Mn as sr,Mt as cr,N as lr,Nn as ur,Nt as dr,O as fr,On as pr,Ot as mr,P as hr,Pn as gr,Pt as _r,Q as vr,Qn as yr,Qt as br,R as xr,Rn as Sr,Rt as Cr,S as wr,Sn as Tr,Sr as Er,St as Dr,T as Or,Tn as kr,Tr as Ar,Tt as jr,U as Mr,Un as Nr,Ut as Pr,V as Fr,Vn as Ir,Vt as Lr,W as Rr,Wn as zr,Wt as Br,X as Vr,Xn as Hr,Xt as Ur,Y as Wr,Yn as Gr,Yt as Kr,Z as qr,Zn as Jr,Zt as Yr,_ as Xr,_n as Zr,_r as Qr,_t as $r,a as ei,an as ti,ar as ni,at as ri,b as ii,bn as ai,br as U,bt as oi,c as si,cn as ci,cr as li,ct as ui,d as di,dn as fi,dr as pi,dt as mi,en as hi,er as gi,et as _i,f as vi,fn as yi,fr as bi,ft as xi,g as Si,gn as Ci,gr as wi,gt as Ti,h as Ei,hn as Di,ht as Oi,i as ki,in as Ai,ir as ji,it as Mi,j as Ni,jn as Pi,jt as Fi,k as Ii,kn as Li,kt as Ri,l as zi,ln as Bi,lr as Vi,lt as Hi,m as Ui,mn as Wi,mt as Gi,n as Ki,nn as qi,nr as Ji,nt as Yi,o as Xi,on as Zi,or as Qi,ot as $i,p as ea,pn as ta,pt as na,q as ra,qn as ia,qt as aa,r as oa,rn as sa,rr as ca,rt as la,s as ua,sn as da,sr as fa,st as pa,t as ma,tn as ha,tr as ga,tt as _a,u as va,un as ya,ur as ba,ut as xa,v as Sa,vn as Ca,vr as wa,vt as Ta,w as Ea,wn as Da,wr as Oa,wt as ka,x as Aa,xn as ja,xr as Ma,xt as Na,y as Pa,yn as Fa,yr as Ia,yt as La,z as Ra,zn as za,zt as Ba}from"./elements-Coqr6-Yv.js";var Va={name:`circle-check-big`,size:24,node:[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-circle`]};Va.node;var Ha=Jt(Va),Ua={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};Ua.node;var Wa=Jt(Ua);function Ga(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function Ka(e,t,n){return Ar(e.getProps(),t,n,e)}var qa=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Ja=e=>Array.isArray(e);function Ya(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,cn(n))}function Xa(e){return Ja(e)?e[e.length-1]||0:e}function Za(e,t){let{transitionEnd:n={},transition:r={},...i}=Ka(e,t)||{};i={...i,...n};for(let t in i)Ya(e,t,Xa(i[t]))}function Qa(e){return!!(en(e)&&e.add)}function $a(e,t){let n=e.getValue(`willChange`);if(Qa(n))return n.add(t);if(!n&&Zt.WillChange){let n=new Zt.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function eo(e){return e.props[Oa]}var to=typeof window<`u`;function no({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function ro(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?We(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&no(f,t))continue;let o={delay:n,...Re(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){V.update(()=>r.set(i));continue}let p=!1;if(to&&window.MotionHandoffAnimation){let n=eo(e);if(n){let e=window.MotionHandoffAnimation(n,t,V);e!==null&&(o.startTime=e,p=!0)}}$a(e,t);let m=l??e.shouldReduceMotion;r.run(me(t,r,i,m&&He.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>V.update(()=>{o&&Za(e,o)});d.length?Promise.all(d).then(t):t()}return d}function io(e,t,n={}){let r=Ka(e,t,qa(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?ro(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(io(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Ga(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function ao(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>io(e,t,n))):typeof t==`string`?io(e,t,n):Promise.all(ro(e,Ka(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var oo=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],so={value:null,addProjectionMetrics:null,countProjection:void 0};function co(e,t){let n=_n.now();e=p(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(B(r),e(a-t))};return V.setup(r,!0),ne(()=>B(r))}function lo(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function uo(e){return ve(e)&&e.tagName===`svg`}var fo=e=>typeof e==`number`?e:parseFloat(e),po=oo.length,mo=e=>typeof e==`number`||tn.test(e);function ho(e,t,n,r,i,a){i?(e.opacity=I(0,n.opacity??1,_o(r)),e.opacityExit=I(t.opacity??1,0,vo(r))):a&&(e.opacity=I(t.opacity??1,n.opacity??1,r));for(let i=0;i<po;i++){let a=oo[i],o=go(t,a),s=go(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||mo(o)===mo(s)?(e[a]=Math.max(I(fo(o),fo(s),r),0),(Rt.test(s)||Rt.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<N.length;i++){let a=N[i];(t[a]||n[a])&&(e[a]=I(t[a]||0,n[a]||0,r))}}function go(e,t){return e[t]===void 0?e.borderRadius:e[t]}var _o=yo(0,.5,Pe),vo=yo(.5,.95,Yt);function yo(e,t,n){return r=>r<e?0:r>t?1:n(Te(e,t,r))}var bo=(e,t,{x:n,y:r})=>{let i=e*e+t*t;return i<1?0:-1e3*(n*e+r*t)/i},xo=(e,t=300)=>{let n=yn(.25,2,t/300),{stiffness:r,damping:i}=qe({...e,duration:e.duration&&an(e.duration)});return{...e,stiffness:r,damping:i*Math.sqrt(n),mass:n}};function So(e,t){e.min=t.min,e.max=t.max}function W(e,t){So(e.x,t.x),So(e.y,t.y)}function Co(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var wo=.9999,To=1.0001,Eo=-.01,Do=.01;function G(e){return e.max-e.min}function Oo(e,t,n){return Math.abs(e-t)<=n}function ko(e,t,n,r=.5){e.origin=r,e.originPoint=I(t.min,t.max,e.origin),e.scale=G(n)/G(t),e.translate=I(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wo&&e.scale<=To||isNaN(e.scale))&&(e.scale=1),(e.translate>=Eo&&e.translate<=Do||isNaN(e.translate))&&(e.translate=0)}function Ao(e,t,n,r){ko(e.x,t.x,n.x,r?.originX),ko(e.y,t.y,n.y,r?.originY)}function jo(e,t,n,r=0){e.min=(r?I(n.min,n.max,r):n.min)+t.min,e.max=e.min+G(t)}function Mo(e,t,n,r){jo(e.x,t.x,n.x,r?.x),jo(e.y,t.y,n.y,r?.y)}function No(e,t,n,r=0){let i=r?I(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+G(t)}function Po(e,t,n,r){No(e.x,t.x,n.x,r?.x),No(e.y,t.y,n.y,r?.y)}function Fo(e,t,n,r,i){return e-=t,e=g(e,1/n,r),i!==void 0&&(e=g(e,1/i,r)),e}function Io(e,t=0,n=1,r=.5,i,a=e,o=e){if(Rt.test(t)&&(t=parseFloat(t),t=I(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=I(a.min,a.max,r);e===a&&(s-=t),e.min=Fo(e.min,t,n,s,i),e.max=Fo(e.max,t,n,s,i)}function Lo(e,t,[n,r,i],a,o){Io(e,t[n],t[r],t[i],t.scale,a,o)}var Ro=[`x`,`scaleX`,`originX`],zo=[`y`,`scaleY`,`originY`];function Bo(e,t,n,r){Lo(e.x,t,Ro,n?.x,r?.x),Lo(e.y,t,zo,n?.y,r?.y)}var Vo=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ho=Vo(`applewebkit/`)&&!Vo(`chrome/`)?Math.round:Yt;function Uo(e){e.min=Ho(e.min),e.max=Ho(e.max)}function Wo(e){Uo(e.x),Uo(e.y)}function Go(e){return e.translate===0&&e.scale===1}function Ko(e){return Go(e.x)&&Go(e.y)}function qo(e,t){return e.min===t.min&&e.max===t.max}function Jo(e,t){return qo(e.x,t.x)&&qo(e.y,t.y)}function Yo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Xo(e,t){return Yo(e.x,t.x)&&Yo(e.y,t.y)}function Zo(e){return G(e.x)/G(e.y)}function Qo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var $o=class{constructor(){this.members=[]}add(e){qt(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(vn(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(vn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function es(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var ts={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(tn.test(e))e=parseFloat(e);else return e}return`${es(e,t.target.x)}% ${es(e,t.target.y)}%`}},ns={borderRadius:Object.assign({},ts,{applyTo:oo.slice()}),borderTopLeftRadius:ts,borderTopRightRadius:ts,borderBottomLeftRadius:ts,borderBottomRightRadius:ts,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ut.parse(e);if(i.length>5)return r;let a=Ut.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=I(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function rs(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;(i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `);let s=``;if(n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<N.length;e++){let t=N[e],r=n[t];r&&(s+=`${t}(${r}deg) `),!e&&n.pathRotation&&(s+=`rotate(${n.pathRotation}deg) `)}}if(s){(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),r+=s;let n=e.x.scale*t.x,i=e.y.scale*t.y;(n!==1||i!==1)&&(r+=`scale(${n}, ${i})`)}else e.x.scale!==1||e.y.scale!==1?r+=`scale(${e.x.scale}, ${e.y.scale})`:r||t.x===1&&t.y===1||(r=`scale(1, 1)`);return r||`none`}function K(e){return[e(`x`),e(`y`)]}var is=(e,t)=>e.depth-t.depth,as=class{constructor(){this.children=[],this.isDirty=!1}add(e){qt(this.children,e),this.isDirty=!0}remove(e){vn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(e)}},os={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ss=[`z`,`skew`,`skewZ`],cs=1e3,ls=0;function us(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var ds=e=>e.instance&&rn.get(e.instance)?.demote()&&e.resetSkewAndRotation();function fs(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=eo(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,V,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&fs(r)}function ps(e){if(e)return e.options.allowProjection===!1?ps(e.parent):e.projection}function ms({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(jn,{...ns,...jn}),class{static create(e,t,n){let{layoutId:r,layout:i,drag:a,dragConstraints:o,layoutScroll:s,layoutRoot:c,layoutAnchor:l,layoutCrossfade:u}=t,d=e.projection=new this(e.latestValues,t[`data-framer-portal-id`]?void 0:ps(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&lo(o),visualElement:e,animationType:typeof i==`string`?i:`both`,initialPromotionConfig:n,crossfade:u,layoutScroll:s,layoutRoot:c,layoutAnchor:l});let f=d.getStack()?.lead;f&&!d.root.isUpdateBlocked()&&(f.willUpdate(),f.scheduleCheckAfterUnmount())}constructor(e={},n=t?.()){this.id=ls++,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.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(_s),this.nodes.forEach(Os),this.nodes.forEach(ks),this.nodes.forEach(vs),so.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new as)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new nn),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=ve(t)&&!uo(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;V.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=co(i,250),os.hasAnimatedSinceResize&&(os.hasAnimatedSinceResize=!1,this.nodes.forEach(Ds)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||Is,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!Xo(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Re(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Ds(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,B(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(As),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&fs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;ds(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,ds(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(xs),this.nodes.forEach(bs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ss);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ws),this.nodes.forEach(Ts),this.nodes.forEach(Es),this.nodes.forEach(hs),this.nodes.forEach(gs)):this.nodes.forEach(Ss),this.clearAllSnapshots();let e=_n.now();H.delta=yn(0,1e3/60,e-H.timestamp),H.timestamp=e,H.isProcessing=!0,Vt.update.process(H),Vt.preRender.process(H),Vt.render.process(H),H.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ys),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,V.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){V.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!G(this.snapshot.measuredBox.x)&&!G(this.snapshot.measuredBox.y)&&(this.snapshot=void 0),this.snapshot)){let{visualElement:e}=this.options,t=this.currentAnimation?.state===`running`,n=t&&this.animationEdges;t&&this.relativeTarget&&(this.snapshot.relativeVelocity=this.relativeVelocity?.slice()||[]);let r=n&&this.motionValue?.getVelocity()||0,i=[0,1,2,3,4,5].map(t=>(t<4?n&&(this.edgeValues?this.edgeVelocity(t):-n[t]*r/1e3):e?.getValue(t<5?`x`:`y`)?.getVelocity())||0);i.some(Boolean)&&(this.snapshot.velocity=i)}}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=U(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&ds(this);let t=this.projectionDelta&&!Ko(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Be(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Wo(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return U();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(zs))){let{scroll:e}=this.root;e&&(C(t.x,e.offset.x),C(t.y,e.offset.y))}return t}removeElementScroll(e){let t=U();if(W(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&W(t,e),C(t.x,i.offset.x),C(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||U();W(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(C(a.x,-n.scroll.offset.x),C(a.y,-n.scroll.offset.y)),Be(n.latestValues)&&oe(a,n.latestValues,n.layout?.layoutBox)}return!r&&Be(this.latestValues)&&oe(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=U();W(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Be(n.latestValues))continue;let r;n.instance&&(D(n.latestValues)&&n.updateSnapshot(),r=U(),W(r,n.measurePageBox())),Bo(t,n.latestValues,n.snapshot?.layoutBox,r)}return Be(this.latestValues)&&Bo(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==H.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=H.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=U(),this.targetWithTransforms=U()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Mo(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):W(this.target,this.layout.layoutBox),M(this.target,this.targetDelta)):W(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),so.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||D(this.parent.latestValues)||se(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=U(),this.relativeTargetOrigin=U(),Po(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),W(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===H.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;W(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;$e(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=U());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Co(this.prevProjectionDelta.x,this.projectionDelta.x),Co(this.prevProjectionDelta.y,this.projectionDelta.y)),Ao(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&Qo(this.projectionDelta.x,this.prevProjectionDelta.x)&&Qo(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),so.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ma(),this.projectionDelta=Ma(),this.projectionDeltaWithTransform=Ma()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Ma();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=U(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Fs));this.animationProgress=0;let f,p=n?.interpolateProjection(e),m=this.layout?.layoutBox,h=m&&[m.x.min,m.x.max,m.y.min,m.y.max].map((t,n)=>{let{translate:r,scale:i,originPoint:a}=e[n<2?`x`:`y`];return(t-a)*(i-1)+r});h?.every(isFinite)||(h=void 0),this.animationEdges=h,this.edgeValues=this.startVelocity=this.impulse=this.relativeVelocity=this.relativeStart=void 0;let g=r?.velocity,_=r?.relativeVelocity||g;if(_?.slice(0,4).some(Boolean)&&this.getClosestProjectingParent()&&(this.relativeStart=_),g&&h){let t=g.slice(0,4).map((e,t)=>e+(c?g[4+(t>>1)]:0));t.some(Boolean)&&(this.startVelocity=p?bo(e.x.translate,e.y.translate,{x:(t[0]+t[1])/2,y:(t[2]+t[3])/2}):t)}this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n),l=this.edgeValues;for(let t=0;t<2;t++){let r=t?`y`:`x`;l?js(o[r],e[r],this.layout.layoutBox[r],l[t*2],l[t*2+1]):Ms(o[r],e[r],n)}if(r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){Po(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);let e=this.relativeTargetOrigin,t=s;if(Ps(this.relativeTarget,e,t,n),this.isSpringLayout){let e=this.relativeTarget,t=this.impulse||0,n=this.relativeStart,r=_n.now(),i=(r-this.relativeTime)/1e3;this.relativeTime=r;let a=this.relativeVelocity||=[0,0,0,0];for(let r=0;r<4;r++){let o=r<2?`x`:`y`,s=r&1?`max`:`min`;n&&(e[o][s]+=n[r]*t),f&&i>0&&(a[r]=(e[o][s]-f[o][s])/i)}}f&&Jo(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=U(),W(f,this.relativeTarget)}c&&(this.animationValues=a,ho(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`);let t=this.isSpringLayout=e.type===`spring`;this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.resumingFrom&&(this.resumingFrom.edgeValues=void 0),this.pendingAnimation&&=(B(this.pendingAnimation),void 0),this.pendingAnimation=V.update(()=>{os.hasAnimatedSinceResize=!0,this.motionValue||=cn(0),this.motionValue.jump(0,!1);let n=this.startVelocity;this.startVelocity=void 0;let r=e,i=0;if(t){if(e.mass===`auto`){let t=this.layout?.layoutBox;r=xo(e,t&&Math.sqrt(G(t.x)*G(t.y)))}let t=this.relativeStart;if((n||t)&&!e.repeat){if(typeof n==`number`)i=n;else{let e=n&&this.animationEdges;r={...r,type:r=>{let i=[r.velocity,...n||[]].map((t,n)=>_e({...r,keyframes:n?[e[n-1],0]:r.keyframes,velocity:t})),a=i.length;t&&i.push(_e({...r,keyframes:[0,0],velocity:1e3,restDelta:.5,restSpeed:5}));let o=0,s=[],c={calculatedDuration:null,next:t=>{o=t;let n=i[0].next(t),r=n.done;for(let e=1;e<i.length;e++){let{value:n,done:o}=i[e].next(t);e<a?s[e-1]=n:this.impulse=n/1e3,r&&=o}return e&&(this.edgeValues=s),n.done=r,n}};return c.calculatedDuration=be(c),c.next(0),this.edgeVelocity=e=>i[e+1].velocity(o),c}}}}}let a=ee(this.motionValue,[0,1e3],{...r,velocity:i,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}});this.currentAnimation=a,zt(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=this.edgeValues=this.edgeVelocity=this.impulse=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.edgeValues=this.impulse=void 0,this.mixTargetDelta?.(cs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Rs(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||U(),Ls(i.x,t.x,e.x),Ls(i.y,t.y,e.y)}W(t,i),oe(t,r),Ao(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new $o),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!S(t))return;let n={};for(let t=0;t<ss.length;t++)us(ss[t],e,n,this.animationValues);for(let t=0;t<N.length;t++)us(N[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Er(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Er(t?.pointerEvents)||``),this.hasProjected&&!Be(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=rs(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in jn){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=jn[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?Er(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(bs),this.root.sharedNodes.clear()}}}function hs(e){e.updateLayout(),Cs(e)}function gs(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)K(e=>{let t=G(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;So(r[e],a[e])}else Rs(i,t.layoutBox,n)&&K(t=>{let n=G(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=Ma();Ao(c,n,t.layoutBox);let l=Ma();Ao(l,a?e.applyTransform(r,!0):n,s);let u=!Ko(c),d=!1,f=e.getClosestProjectingParent();if((!a||f?.options.layoutRoot&&e.resumeFrom?.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=U();Po(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=U();Po(l,n,i.layoutBox,s),a&&o(c,l),Xo(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function _s(e){so.countProjection?.(0),e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function vs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ys(e){e.clearSnapshot()}function bs(e){e.clearMeasurements()}function xs(e){e.isLayoutDirty=!0,e.updateLayout()}function Ss(e){e.isLayoutDirty=!1}function Cs(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;K(e=>C(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function ws(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Ts(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Es(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Ds(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Os(e){e.resolveTargetDelta()}function ks(e){e.calcProjection()}function As(e){e.resetSkewAndRotation()}function js(e,t,n,r,i){let a=n.max-n.min,o=a?Math.max(0,(a+i-r)/a):1,s=e.originPoint=t.originPoint;e.origin=t.origin,e.scale=o,e.translate=n.min+r-(s+(n.min-s)*o)}function Ms(e,t,n){e.translate=I(t.translate,0,n),e.scale=I(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ns(e,t,n,r){e.min=I(t.min,n.min,r),e.max=I(t.max,n.max,r)}function Ps(e,t,n,r){Ns(e.x,t.x,n.x,r),Ns(e.y,t.y,n.y,r)}function Fs(e){return e.animationValues?.opacityExit!==void 0}var Is={duration:.45,ease:[.4,0,.1,1]};function Ls(e,t,n){e.max=G(n)+(e.min=t.min)}function Rs(e,t,n){return e===`position`||e===`preserve-aspect`&&!Oo(Zo(t),Zo(n),.2)}function zs(e){return e!==e.root&&e.scroll?.wasRoot}function Bs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Vs=ms({attachResizeListener:(e,t)=>Bs(e,`resize`,t),measureScroll:b,checkIsScrollRoot:()=>!0}),Hs=ms({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ia.current){let e=new Vs({});e.mount(window),e.setOptions({layoutScroll:!0}),Ia.current=e}return Ia.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Us=class extends bi{constructor(){super(...arguments),this.KeyframeResolver=Fe}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;en(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ws(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Gs(e){return window.getComputedStyle(e)}var Ks=class extends Us{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ws}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Wt.has(t))return this.projection?.isProjecting?Gt(t):Kt(e,t);{let n=Gs(e),r=(mn(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return O(e,t)}build(e,t,n){gn(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return pi(e,t,n)}},qs=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Js(e){return{point:{x:e.pageX,y:e.pageY}}}var Ys=e=>t=>qs(t)&&e(t,Js(t));function Xs(e,t,n,r){return Bs(e,t,Ys(n),r)}var Zs=new WeakMap,Qs,$s=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:ve(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ec=$s(`inline`,`width`,`offsetWidth`),tc=$s(`block`,`height`,`offsetHeight`);function nc({target:e,borderBoxSize:t}){Zs.get(e)?.forEach(n=>{n(e,{get width(){return ec(e,t)},get height(){return tc(e,t)}})})}function rc(e){e.forEach(nc)}function ic(){typeof ResizeObserver<`u`&&(Qs=new ResizeObserver(rc))}function ac(e,t){Qs||ic();let n=fe(e);return n.forEach(e=>{let n=Zs.get(e);n||(n=new Set,Zs.set(e,n)),n.add(t),Qs?.observe(e)}),()=>{n.forEach(e=>{let n=Zs.get(e);n?.delete(t),n?.size||Qs?.unobserve(e)})}}var oc=new Set,sc;function cc(){sc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};oc.forEach(t=>t(e))},window.addEventListener(`resize`,sc)}function lc(e){return oc.add(e),sc||cc(),()=>{oc.delete(e),!oc.size&&typeof sc==`function`&&(window.removeEventListener(`resize`,sc),sc=void 0)}}function uc(e,t){return ne(typeof e==`function`?lc(e):ac(e,t))}var dc=(e,t)=>Math.abs(e-t);function fc(e,t){let n=dc(e.x,t.x),r=dc(e.y,t.y);return Math.sqrt(n**2+r**2)}var pc=new Set([`auto`,`scroll`]),mc=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o,immediate:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=gc(this.lastRawMoveEventInfo,this.transformPagePoint));let e=vc(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=fc(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:_n.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=gc(t,this.transformPagePoint),this.hasPendingMove=!0,V.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=vc(e.type===`pointercancel`?this.lastMoveEventInfo:gc(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!qs(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=s?0:a,this.contextWindow=r||window;let c=Js(e),l=gc(c,this.transformPagePoint),{point:u}=l;this.history=[{...u,timestamp:_n.now()}];let{onSessionStart:d}=t;d&&d(e,vc(l,this.history));let f={passive:!0,capture:!0};this.removeListeners=Se(Xs(this.contextWindow,`pointermove`,this.handlePointerMove,f),Xs(this.contextWindow,`pointerup`,this.handlePointerUp,f),Xs(this.contextWindow,`pointercancel`,this.handlePointerUp,f)),o&&this.startScrollTracking(o),s&&(this.handlePointerMove(e,c),this.updatePoint())}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(pc.has(e.overflowX)||pc.has(e.overflowY))&&this.scrollPositions.set(t,hc(t)),t=t.parentElement}this.scrollPositions.set(window,hc(window)),this.removeScrollListeners=Se(Bs(window,`scroll`,this.onElementScroll,{capture:!0}),Bs(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=hc(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),V.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),B(this.updatePoint)}},hc=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function gc(e,t){return t?{point:t(e.point)}:e}function _c(e,t){return{x:e.x-t.x,y:e.y-t.y}}function vc({point:e},t){return{point:e,delta:_c(e,bc(t)),offset:_c(e,yc(t)),velocity:xc(t,.1)}}function yc(e){return e[0]}function bc(e){return e[e.length-1]}function xc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=bc(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>an(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>an(t)*2&&(r=e[1]);let a=ln(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Sc=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Cc(e){return Sc.has(e.tagName)||e.isContentEditable===!0}var wc=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Tc(e){return wc.has(e.tagName)||e.isContentEditable===!0}var q={x:!1,y:!1};function Ec(){return q.x||q.y}function Dc(e){return e===`x`||e===`y`?q[e]?null:(q[e]=!0,()=>{q[e]=!1}):q.x||q.y?null:(q.x=q.y=!0,()=>{q.x=q.y=!1})}function Oc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?I(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?I(n,e,r.max):Math.min(e,n)),e}function kc(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Ac(e,{top:t,left:n,bottom:r,right:i}){return{x:kc(e.x,n,i),y:kc(e.y,t,r)}}function jc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Mc(e,t){return{x:jc(e.x,t.x),y:jc(e.y,t.y)}}function Nc(e,t){let n=.5,r=G(e),i=G(t);return i>r?n=Te(t.min,t.max-r,e.min):r>i&&(n=Te(e.min,e.max-i,t.min)),yn(0,1,n)}function Pc(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Fc=.35;function Ic(e=Fc){return e===!1?e=0:e===!0&&(e=Fc),{x:Lc(e,`left`,`right`),y:Lc(e,`top`,`bottom`)}}function Lc(e,t,n){return{min:Rc(e,t),max:Rc(e,n)}}function Rc(e,t){return typeof e==`number`?e:e[t]||0}function zc(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var Bc=new WeakMap,Vc=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=U(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,t={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let n=e=>{t.snapToCursor&&this.snapToCursor(e),this.stopAnimation()},r=(e,t)=>{let{drag:n,dragConstraints:r,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock=Dc(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),K(e=>{let t=this.getAxisMotionValue(e).get()||0;if($t(t)&&(t=De(t,this.visualElement.current)||0),tn.test(t))t=parseFloat(t);else if(Rt.test(t)){let n=o?.layout?.layoutBox[e];n&&(t=G(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),this.point=typeof r==`function`&&r(this),a&&V.update(()=>a(e,t),!1,!0),$a(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},i=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=qc(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.point&&this.point.move(),this.visualElement.render(),a&&V.update(()=>a(e,t),!1,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},o=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:s}=this.getProps();this.panSession=new mc(e,{onSessionStart:n,onStart:r,onMove:i,onSessionEnd:a,resumeAnimation:o},{...t,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&V.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!Kc(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Oc(i,a,this.elastic[e])),this.point?this.point[e]=i:r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;Hc(e)?this.constraints&&this.scroll===zc(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?Ac(r.layoutBox,e):!1,this.elastic=Ic(t),i!==this.constraints&&!Hc(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&K(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Pc(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!Hc(e))return!1;let n=Uc(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=zc(r);let i=w(n,r.root,this.visualElement.getTransformPagePoint()),a=Mc(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(de(a));this.hasMutatedConstraints=!!e,e&&(a=T(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c={bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a},l=i=>r&&!(this.point&&o)&&Kc(i,t||n,this.currentDirection)?e[i]:0;if(this.point&&!o)return this.point.release({x:l(`x`),y:l(`y`)},c).then(s);let u=this.constraints||{},d=K(e=>{if(!Kc(e,t||n,this.currentDirection))return;let r=u[e]||{};(o===!0||o===e)&&(r={min:0,max:0});let i={type:`inertia`,velocity:l(e),...c,...r};return this.startAxisValueAnimation(e,i)});return Promise.all(d).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return $a(this.visualElement,e),n.start(me(e,n,0,t,this.visualElement,!1))}stopAnimation(){K(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();K(e=>{if(!Kc(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-I(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Hc(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};K(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Nc({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),K(t=>{let n=this.getAxisMotionValue(t);if(!Kc(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(I(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Bc.set(this.visualElement,this);let e=this.visualElement.current,t=Xs(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Tc(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=Hc(t)&&Uc(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Gc(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),V.read(r);let o=Bs(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(K(t=>{if(!Kc(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Fc,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function Hc(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Uc=e=>`current`in e?e.current:e;function Wc(e){let t=!0;return()=>{t?t=!1:e()}}function Gc(e,t,n){let r=uc(e,Wc(n)),i=uc(t,Wc(n));return()=>{r(),i()}}function Kc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qc(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Jc(e,t){let n=fe(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},ne(()=>r.abort())]}function Yc(e){return!(e.pointerType===`touch`||Ec())}function Xc(e,t,n={}){t=p(t);let[r,i,a]=Jc(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Yc(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Zc=(e,t)=>t?e===t||Zc(e,t.parentElement):!1,Qc=new WeakSet;function $c(e){return t=>{t.key===`Enter`&&e(t)}}function el(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var tl=(e,t)=>{let n=!1,r=$c(()=>{n||Qc.has(e)||(n=!0,el(e,`down`))}),i=$c(()=>{n&&(n=!1,el(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&el(e,`cancel`)},{...t,once:!0})};function nl(e){return qs(e)&&!Ec()}var rl=new WeakSet,il=100,al=8,ol=(e,t,n)=>Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)>n,sl=e=>e.preventDefault();function cl(e,t,n={}){t=p(t);let[r,i,a]=Jc(e,n),o=new WeakMap,s=e=>{let r=e.currentTarget;if(!nl(e)||rl.has(e))return;n.stopPropagation&&rl.add(e);let{count:a=1,countTimeout:s=.3,hold:c=0,repeat:l}=n,u=_n.now(),d=an(c),f=an(s),p=o.get(r);p?.expire(ol(p.event,e,il))?p=void 0:p&&(B(p.expire),o.delete(r));let m=p?p.count+1:1,h=m>=a,g=h&&(c||l),_=!c,v=0,y;if(Qc.add(r),p)y=p.handlers;else{let n=t(r,e);y=typeof n==`function`?{onComplete:n}:n||{}}h&&_&&y.onActive?.();let b=an(l),x=d||b,S=u+x,C=!0,w=()=>{if(i.signal.aborted)return B(w);let e=Math.min(1-(S-_n.now())/x,1);C&&e<1&&(e=0),C=!1,y.onHold?.(e),e<1||(_?y.onRepeat?.(++v):(_=!0,y.onActive?.()),l?(C=!0,S+=x=b):B(w))},T={...i,capture:!0},E=(t,n)=>{if(qs(t)){if(window.removeEventListener(`pointerup`,D,T),window.removeEventListener(`pointercancel`,O,T),window.removeEventListener(`pointermove`,k,T),r.removeEventListener(`contextmenu`,sl),B(w),Qc.delete(r),Ec()&&(n=!1),n&&!h){let n=_n.now(),a=e=>{let s=i.signal.aborted;if(s||e===!0||_n.now()-n>f)return B(a),o.delete(r),s||y.onComplete?.(t,{success:!1}),!0};o.set(r,{count:m,event:e,handlers:y,expire:a}),V.update(a,!0)}else y.onComplete?.(t,{success:n&&_})}},D=e=>{E(e,r===window||r===document||n.useGlobalTarget||Zc(r,e.target))},O=e=>{E(e,!1)},k=t=>{qs(t)&&((l||!_)&&ol(e,t,al)||a>1&&Ec())&&O(t)};window.addEventListener(`pointerup`,D,T),window.addEventListener(`pointercancel`,O,T),(g||a>1)&&window.addEventListener(`pointermove`,k,T),g&&(V.update(w,!0),r.addEventListener(`contextmenu`,sl,{...i,passive:!1}))};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,s,i),Ge(e)&&(e.addEventListener(`focus`,()=>tl(e,i),i),!Cc(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function ll(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=je(i,a,o);return t?s(r):s}var ul=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},dl=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`]);function fl(e,t,n,r){Ws(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(dl.has(n)?n:le(n),t.attrs[n])}var pl=class extends Us{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=U}getBaseTargetFromProps(e,t){return Wt.has(t)?super.getBaseTargetFromProps(e,t)??Gt(t):e[t]}getDefaultValue(e){return Wt.has(e)?this.latestValues[e]??Gt(e):void 0}readValueFromInstance(e,t){if(Wt.has(t)){let e=Ht(t);return e&&e.default||0}if(sn.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=dl.has(t)?t:le(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Vi(e,t,n)}build(e,t,n){Qt(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){fl(e,t,n,r)}mount(e){this.isSVGTag=ba(e.tagName),super.mount(e)}};function ml(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var hl=[...wi].reverse(),gl=e=>e?.out===!0?e:e?.out;function _l(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>ao(e,t,n))),n=yl(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&Ka(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&gl(f(l??(g&&g.props.initial))?.transition);if(hl.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?Qr(f)||f===!1?f:void 0:l,y=Qr(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||wa(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=vl(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=Ka(e,n,qa(e,t))||{};E={...E,...a,...i},D=gl(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!ml(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=Ka(s,n)?.transition?.delayChildren;r.delay=Ga(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!en(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=yl(),i=!0}}}function vl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!ml(t,e):!1}function yl(){let e={};for(let t of wi)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var J=Lt(),Y=t(It(),1);function bl({children:e,features:t,strict:n=!1}){let[,r]=(0,Y.useState)(!xl(t)),i=(0,Y.useRef)(void 0);if(!xl(t)){let{renderer:e,...n}=t;i.current=e,fa(n)}return(0,Y.useEffect)(()=>{xl(t)&&t().then(({renderer:e,...t})=>{fa(t),i.current=e,r(!0)})},[]),(0,J.jsx)(li.Provider,{value:{renderer:i.current,strict:n},children:e})}function xl(e){return typeof e==`function`}function Sl(e,t){if(typeof Proxy>`u`)return ji;let n=new Map,r=(n,r)=>ji(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,ji(a,void 0,e,t)),n.get(a))})}var Cl=Sl(),wl=(e,t)=>t.isSVG??Qi(e)?new pl(t):new Ks(t,{allowProjection:e!==Y.Fragment}),Tl=class extends ul{constructor(e){super(e),e.animationState||=_l(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();wa(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},El=0,Dl={animation:{Feature:Tl},exit:{Feature:class extends ul{constructor(){super(...arguments),this.id=El++}update(){let{presenceContext:e,animationState:t}=this.node;if(!e||!t)return;let{isPresent:n,onExitComplete:r}=e;if(n===!this.exit)return;if(n){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Ka(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,t.reset(),t.animateChanges()}else t.setActive(`exit`,!1);this.exit=void 0;return}let i=this.exit=t.setActive(`exit`,!0);r&&i.then(()=>{this.exit===i&&(this.exit=!0,r(this.id))})}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id,this.node)),this.update()}unmount(){}}}},Ol=class extends ul{constructor(e){super(e),this.removeGroupControls=Yt,this.removeListeners=Yt,this.controls=new Vc(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Yt}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},kl=e=>(t,n)=>{e&&V.update(()=>e(t,n),!1,!0)},Al=class extends ul{constructor(){super(...arguments),this.removePointerDownListener=Yt}onPointerDown(e){this.session=new mc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:kl(e),onStart:kl(t),onMove:kl(n),onEnd:(e,t)=>{delete this.session,r&&V.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Xs(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},jl=!1,Ml=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),Nl=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},Pl=class extends Y.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),jl&&i.root.didUpdate(),i.options.layoutId!==r&&Nl(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Ml(this.props),onExitComplete:()=>this.safeToRemove()})),os.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),Nl(o,n)),o.setOptions({...o.options,...Ml(this.props)}),jl=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||V.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),pn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;jl=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Fl(e){let[t,n]=ae(),r=(0,Y.useContext)(Xt);return(0,J.jsx)(Pl,{...e,layoutGroup:r,switchLayoutGroup:(0,Y.useContext)(ni),isPresent:t,safeToRemove:n})}var Il={pan:{Feature:Al},drag:{Feature:Ol,ProjectionNode:Hs,MeasureLayout:Fl}};function Ll(e,t,n,r,i){let{props:a}=e,o=`while`+n;!i&&e.animationState&&a[o]&&e.animationState.setActive(o,r===`Start`);let s=a[`on`+n+r];s&&V.postRender(()=>s(t,Js(t)))}var Rl=class extends ul{mount(){let{current:e}=this.node;e&&(this.unmount=Xc(e,(e,t)=>(Ll(this.node,t,`Hover`,`Start`),e=>Ll(this.node,e,`Hover`,`End`))))}unmount(){}},zl=class extends ul{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=Se(Bs(this.node.current,`focus`,()=>this.onFocus()),Bs(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Bl(e,t,n,r){e.current instanceof HTMLButtonElement&&e.current.disabled||Ll(e,t,`Tap`,n,r)}var Vl=class extends ul{constructor(){super(...arguments),this.options={}}mount(){let{current:e}=this.node;e&&(this.update(),this.unmount=cl(e,(e,t)=>(Bl(this.node,t,`Start`),{onComplete:(e,{success:t})=>Bl(this.node,e,t?``:`Cancel`),onRepeat:()=>Bl(this.node,t,``,!0)}),this.options))}update(){let{options:e,node:t}=this,{globalTapTarget:n,propagate:r,tap:i}=t.props;for(let t in e)delete e[t];Object.assign(e,i,{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}},Hl=new WeakMap,Ul=new WeakMap,Wl=e=>{let t=Hl.get(e.target);t&&t(e)},Gl=e=>{e.forEach(Wl)};function Kl({root:e,...t}){let n=e||document;Ul.has(n)||Ul.set(n,{});let r=Ul.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Gl,{root:e,...t})),r[i]}function ql(e,t,n){let r=Kl(t);return Hl.set(e,n),r.observe(e),()=>{Hl.delete(e),r.unobserve(e)}}var Jl={some:0,all:1},Yl=class extends ul{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Jl[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=ql(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Xl(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Xl({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Zl=Object.assign({},Object.assign({renderer:wl},Dl,{inView:{Feature:Yl},tap:{Feature:Vl},focus:{Feature:zl},hover:{Feature:Rl}}),Il,{layout:{ProjectionNode:Hs,MeasureLayout:Fl}});function Ql(e){let t=on(()=>cn(e)),{isStatic:n}=(0,Y.useContext)(hn);if(n){let[,n]=(0,Y.useState)(e);(0,Y.useEffect)(()=>t.on(`change`,n),[])}return t}function $l(e,t){let n=Ql(t()),r=()=>n.set(t());return r(),fn(()=>{let t=()=>V.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),B(r)}}),n}function eu(e){dn.current=[],e();let t=$l(dn.current,e);return dn.current=void 0,t}function tu(e,t,n,r){if(typeof e==`function`)return eu(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return ru(e,t,n,r);let i=typeof t==`function`?t:ll(t,n,r),a=Array.isArray(e)?nu(e,i):nu([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&!r?.mixer){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function nu(e,t){let n=on(()=>[]);return $l(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function ru(e,t,n,r){let i=on(()=>Object.keys(n)),a=on(()=>({}));for(let o of i)a[o]=tu(e,t,n[o],r);return a}var iu=(0,Y.createContext)(null),au=(0,Y.createContext)(null);function ou(e,t,n,r,i,a=`ltr`){let o=e.findIndex(e=>e.value===t);if(o===-1)return e;if(i===`xy`){let{layout:t}=e[o],r={x:cu(t.x)+n.x,y:cu(t.y)+n.y},i=lu(e),s=i.find(t=>t.items.includes(e[o])),c=i.reduce((e,t)=>uu(r.y,t)<uu(r.y,e)?t:e);if(c!==s)return du(e,o,r.x,c,a);let l=fu(r,t),u=-1,d=l;return e.forEach((e,t)=>{if(t===o)return;let n=fu(r,e.layout);n<d&&(u=t,d=n)}),u===-1?e:Bt(e,o,o+Math.sign(u-o))}if(!r[i])return e;let s=r[i]>0?1:-1,c=e[o+s];if(!c)return e;let l=e[o].layout[i],u=c.layout[i],d=cu(u);return s===1&&l.max+n[i]>d||s===-1&&l.min+n[i]<d?Bt(e,o,o+s):e}function su(e,t,n,r,i){let a=n>1==!!(n%2&&i)?-1:1,o=n>3?(n-4)*(e.length-1):t+a;if(r===`xy`&&n<4&&!(n%2)&&t>-1){let n=lu(e).sort((e,t)=>e.min-t.min),r=n[n.findIndex(({items:n})=>n.includes(e[t]))+a],i=n=>Math.abs(cu(n.layout.x)-cu(e[t].layout.x));o=r?e.indexOf(r.items.reduce((e,t)=>i(t)<i(e)?t:e)):-1}return t>-1&&o!==t&&e[o]?o:-1}var cu=({min:e,max:t})=>I(e,t,.5);function lu(e){let t=[];return e.forEach(e=>{let{min:n,max:r}=e.layout.y,i=t[t.length-1];!i||n>=i.max||r<=i.min?t.push({items:[e],min:n,max:r}):(i.items.push(e),i.min=Math.min(i.min,n),i.max=Math.max(i.max,r))}),t}function uu(e,t){return e<t.min?t.min-e:e>t.max?e-t.max:0}function du(e,t,n,r,i){let a=e.filter((e,n)=>n!==t),o=r.items.find(e=>{let t=cu(e.layout.x);return i===`ltr`?n<t:n>t}),s=o?a.indexOf(o):a.indexOf(r.items[r.items.length-1])+1,c=[...a];return c.splice(s,0,e[t]),c.every((t,n)=>t===e[n])?e:c}function fu(e,t){let n=Math.max(t.x.min-e.x,0,e.x-t.x.max),r=Math.max(t.y.min-e.y,0,e.y-t.y.max);return n*n+r*r}var pu=(e,t)=>e.max<=t.min||t.max<=e.min;function mu(e){let t=!1,n=!1;for(let r=0;r<e.length;r++)for(let i=r+1;i<e.length;i++)if(t||=pu(e[r].x,e[i].x),n||=pu(e[r].y,e[i].y),t&&n)return`xy`;return t?`x`:`y`}var hu=(e,t)=>n=>{e.current=n;let r=typeof t==`function`?t(n):t&&(t.current=n);if(typeof r==`function`)return()=>{e.current=null,r()}};function gu({children:e,as:t=`ul`,axis:n,onReorder:r,values:i,onPointerDownCapture:a,onClickCapture:o,...s},c,l){let u=on(()=>l[t]),d=(0,Y.useContext)(iu),f=(0,Y.useRef)(new Map),p=(0,Y.useRef)(new Map),[m,h]=(0,Y.useState)(),[g,_]=(0,Y.useState)(`y`),v=(0,Y.useRef)(!1),y=(0,Y.useRef)(!1),b=(0,Y.useRef)(null),x=n||g,S=new Set(i);for(let e of[f.current,p.current])e.forEach((t,n)=>S.has(n)||e.delete(n));let C=S.has(m)?m:i[0],w=e=>p.current.get(e)?.current?.isConnected,T=e=>S.has(e)&&h(e),E=()=>{w(C)||T(i.find(w))};(0,Y.useEffect)(E);let D=()=>i.flatMap(e=>f.current.get(e)||[]),O=()=>b.current?.ownerDocument.defaultView?.getComputedStyle(b.current).direction===`rtl`,k=(e,t)=>{let n=0,a=i.map(t=>f.current.has(t)?e[n++].value:t);a.some((e,t)=>e!==i[t])&&r(a,t)},A={axis:x,proxy:l,groupRef:b,hasReordered:y,values:i,onReorder:r,getOrder:D,isTabStop:e=>e===C||!S.has(e),setActive:T,checkTabStop:E,elements:p.current,onKeyDown:(e,t,n,r)=>{let{key:a,currentTarget:o}=e;if(e.defaultPrevented||e.target!==o||e.altKey||e.ctrlKey||e.metaKey)return;let s=D(),c=[`ArrowUp`,`ArrowLeft`,`ArrowDown`,`ArrowRight`,`Home`,`End`].indexOf(a),l=c%2;if(a===` `)e.repeat||r(o,n?void 0:i);else if(c<0&&!(a===`Escape`&&n))return;else if(!d?.isMoving(o)){if(a===`Escape`&&n){if(r(o),!d?.restore(A,t,o,n)){let e=n.flatMap(e=>s.filter(t=>t.value===e));k(s.map(t=>n.includes(t.value)?e.shift():t),t)}}else{let e=c>3||x===`xy`||x===(l?`x`:`y`),r=n?s:s.filter(({value:e})=>w(e)),i=r.findIndex(({value:e})=>e===t),a=e?su(r,i,c,x,!!l&&O()):-1;if(a>-1)n?k(Bt(s,i,a),t):p.current.get(r[a].value)?.current?.focus();else if(!(n&&c<4&&d?.key(A,t,c,o,n))&&!e)return}}e.preventDefault()},registerItem:(e,t,r)=>{if(f.current.set(e,{value:e,layout:t,ref:r}),!n){let e=mu(D().map(e=>e.layout));e!==g&&_(e)}},updateOrder:(e,t,n)=>{if(v.current)return;let r=D(),i=ou(r,e,t,n,x,O()?`rtl`:`ltr`);r!==i&&(v.current=!0,y.current=!0,k(i,e))}};(0,Y.useEffect)(()=>{v.current=!1},[i]),fn(()=>d?.add(A));let j={overflowAnchor:`none`,...s.style};return(0,J.jsx)(u,{...s,style:j,ref:hu(b,c),onPointerDownCapture:e=>{y.current=!1,a?.(e)},onClickCapture:e=>{y.current&&e.detail&&(y.current=!1,e.stopPropagation(),e.preventDefault()),o?.(e)},ignoreStrict:!0,children:(0,J.jsx)(au.Provider,{value:A,children:e})})}var _u=e=>(0,Y.forwardRef)((t,n)=>gu(t,n,e)),vu=50,yu=1.5,bu=new Set([`auto`,`scroll`]),xu={x:new Map,y:new Map};function Su(){xu.x.clear(),xu.y.clear()}function Cu(e,t){let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY;return e===document.body||e===document.documentElement||bu.has(r)&&(t===`x`?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight)}function wu(e,t){let n=e?.parentElement;for(;n;){if(Cu(n,t))return n;n=n.parentElement}return null}function Tu(e){let t=Math.min(1,1-e/vu);return yu*t*t*H.delta}function Eu(e,t,n){let r=t.getBoundingClientRect(),i=n===`x`?Math.max(0,r.left):Math.max(0,r.top),a=n===`x`?Math.min(window.innerWidth,r.right):Math.min(window.innerHeight,r.bottom),o=e-i,s=a-e;return o<vu?{amount:-Tu(o),edge:`start`}:s<vu?{amount:Tu(s),edge:`end`}:{amount:0,edge:null}}function Du(e,t,n,r){if(!e)return;let i=wu(e,n);if(!i)return;let{amount:a,edge:o}=Eu(t-(n===`x`?window.scrollX:window.scrollY),i,n),s=xu[n];if(o===null){s.delete(i);return}let c=s.get(i),l=i===document.body||i===document.documentElement;if(c?.edge!==o){if(!(o===`start`&&r<0||o===`end`&&r>0))return;c={edge:o,limit:n===`x`?i.scrollWidth-(l?window.innerWidth:i.clientWidth):i.scrollHeight-(l?window.innerHeight:i.clientHeight)},s.set(i,c)}a>0&&(n===`x`?l?window.scrollX:i.scrollLeft:l?window.scrollY:i.scrollTop)>=c.limit||(n===`x`?l?window.scrollBy({left:a}):i.scrollLeft+=a:l?window.scrollBy({top:a}):i.scrollTop+=a)}function Ou(e,t=0){return en(e)?e:Ql(t)}function ku({children:e,style:t={},value:n,as:r=`li`,onDragStart:i,onDrag:a,onDragEnd:o,onKeyDown:s,onFocus:c,onBlur:l,layout:u=!0,...d},f){let p=(0,Y.useContext)(au),m=(0,Y.useContext)(iu),h=(0,Y.useRef)(null),g=on(()=>p.proxy[r]),_=(0,Y.useRef)(),v={x:Ou(t.x),y:Ou(t.y)},y=tu([v.x,v.y],([e,t])=>e||t?1:`unset`),{axis:b,registerItem:x,updateOrder:S,groupRef:C,hasReordered:w,isTabStop:T,setActive:E,checkTabStop:D,elements:O,onKeyDown:k}=p,A=b===`xy`||m?!0:b;O.set(n,h),(0,Y.useEffect)(()=>D);let j=(e,t)=>{_.current=t,t||m?.end(n),un.get(e)?.animationState?.setActive(`whileDrag`,!!t)},ee=(0,Y.useRef)(!1);return fn(()=>{m?.receive(p,n,h.current,j)&&(ee.current=!0)},[]),(0,J.jsx)(g,{drag:A,tabIndex:T(n)?0:-1,...d,dragSnapToOrigin:!0,style:{...t,x:v.x,y:v.y,zIndex:y},layout:u,onDragStart:(e,t)=>{ee.current?ee.current=!1:i?.(e,t)},onDrag:(e,t)=>{let{velocity:r,point:i}=t,o={x:v.x.get(),y:v.y.get()};m?.drag(p,n,h.current,e)||S(n,o,r);let s=m?[`x`,`y`]:[b===`xy`?Math.abs(r.x)>Math.abs(r.y)?`x`:`y`:b];for(let e of s)Du(m&&!b.includes(e)?m.column(p):C.current,i[e],e,r[e]);a&&a(e,t)},onDragEnd:(e,t)=>{w.current=!1,Su(),m?.end(n),o&&o(e,t)},onKeyDown:e=>{s?.(e),k(e,n,_.current,j)},onFocus:e=>{c?.(e),E(n)},onBlur:e=>{l?.(e),_.current&&j(e.currentTarget)},onLayoutMeasure:e=>{x(n,e,h)},ref:hu(h,f),ignoreStrict:!0,children:e})}var Au=(0,Y.forwardRef)(ku),ju=e=>{let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{x:t+r/2,y:n+i/2}},Mu=e=>{let{x:t,y:n}=ju(e),{scrollX:r,scrollY:i}=e.ownerDocument.defaultView;return{x:t+r,y:n+i}};function Nu(e,t,n,r){let{left:i,right:a,top:o,bottom:s}=t.getBoundingClientRect(),c=r?e.x>(i+a)/2:e.x<=(i+a)/2,l=e.y<=(o+s)/2;return n===`x`?c:n===`y`?l:e.y<o||e.y<s&&c}var Pu=(e,t)=>{let n=e.groupRef.current,r=t.groupRef.current;return n.contains(r)||r.contains(n)};function Fu(e){let t=new Set,n,r=(t,n,r)=>!Pu(t,n)&&e.current.canMove?.(r,t.values,n.values)!==!1,i,a=(e,t,r,i,a,o)=>{let s=ju(i),{values:c}=t;if(o===void 0){let e=t.getOrder().filter(e=>e.ref?.current?.isConnected),n=getComputedStyle(t.groupRef.current).direction===`rtl`,r=e.find(e=>Nu(s,e.ref.current,t.axis,n)),i=e[e.length-1];o=r?c.indexOf(r.value):i?c.indexOf(i.value)+1:c.length}n={value:r,to:t.groupRef,element:i,centre:Mu(i),...a},t.hasReordered.current=!0,e.onReorder(e.values.filter(e=>e!==r),r),t.onReorder([...c.slice(0,o),r,...c.slice(o)],r)};return{add:e=>(t.add(e),()=>t.delete(e)),drag:(e,i,o,s)=>{if(!o?.isConnected)return!1;if(n?.controls?.isDragging)return n.value===i&&(n.centre=Mu(o),n.event=s),!0;let c=ju(o),l;for(let e of o.ownerDocument.elementsFromPoint(c.x,c.y))if(!o.contains(e)){for(let n of t)n.groupRef.current===e&&(l=n);if(l)break}if(!l||!r(e,l,i))return!1;let u=un.get(o);return a(e,l,i,o,{controls:u&&Bc.get(u),event:s}),!0},key:(e,n,o,s,c)=>{let l=ju(s),u=o%2?`x`:`y`,d=o>1?1:-1,f,p=1/0;for(let i of t){let t=i.groupRef.current;if(!t)continue;let{left:a,right:s,top:c,bottom:m,width:h,height:g}=t.getBoundingClientRect();if(!h&&!g||([m,s,c,a][o]-l[u])*d<=0)continue;let _=Math.max(a-l.x,0,l.x-s),v=Math.max(c-l.y,0,l.y-m);_*_+v*v<p&&r(e,i,n)&&(p=_*_+v*v,f=i)}return f?(i?.from!==c&&(i={group:e.groupRef,from:c}),a(e,f,n,s,{keys:!0,from:c}),!0):!1},restore:(e,n,r,o)=>{let s=i?.from===o&&[...t].find(e=>e.groupRef===i.group);if(!s||s.groupRef===e.groupRef)return!1;let c=o.slice(o.indexOf(n)+1),l=s.values.findIndex(e=>c.includes(e));return i=void 0,a(e,s,n,r,{keys:!0},l<0?s.values.length:l),!0},end:e=>{n?.value===e&&(n=void 0)},isMoving:e=>n?.element===e,receive:(e,t,r,i)=>{let a=un.get(r),o=a&&Bc.get(a);o?.isDragging&&a.animationState?.setActive(`whileDrag`,!0);let s=n;if(!s||s.value!==t||s.to!==e.groupRef)return!1;let{keys:c,from:l,controls:u}=s,d=!s.element.isConnected;if(c){n=void 0;let{activeElement:e,body:t}=r.ownerDocument;return d&&(!e||e===t)&&(r.focus(),i(r,l)),!1}return!o||!u?.isDragging?!1:(pn.read(()=>{if(n!==s)return;n=void 0,un.get(s.element)?.values.forEach((e,t)=>{let n=e.get();a.getValue(t,a.readValue(t,n))?.set(n)});let e=a.getTransformPagePoint()||(e=>e),t=e(s.centre),i=e(Mu(r));a.getValue(`x`).set(t.x-i.x),a.getValue(`y`).set(t.y-i.y),a.render(),d?u.cancel():u.stop(),o.start(s.event,{immediate:!0})}),d)},column:({groupRef:e})=>{let n=e.current,r=n=>[...t].some(t=>t.groupRef!==e&&n.contains(t.groupRef.current));for(;n?.parentElement?.parentElement&&!r(n.parentElement);)n=n.parentElement;return n}}}function Iu({children:e,...t}){let n=(0,Y.useRef)(t);return fn(()=>{n.current=t}),(0,J.jsx)(iu.Provider,{value:on(()=>Fu(n)),children:e})}var Lu=e=>{e.stopPropagation()},Ru=e=>{e.preventDefault(),e.stopPropagation(),e.preventBaseUIHandler?.()},zu={anchor:null,iconSpaceMode:`global`,items:[],open:!1,triggerId:null},Bu=zu,Vu=new Set,Hu={ready:!1,triggerId:null,x:0,y:0},Uu=()=>{Vu.forEach(e=>e())},Wu=e=>(Vu.add(e),()=>Vu.delete(e)),Gu=()=>Bu,Ku=()=>zu,qu=e=>{Hu.x=e.clientX,Hu.y=e.clientY,Hu.ready=!0,Hu.triggerId=e.target instanceof Element?e.target.closest(`[data-contextmenu-trigger]`)?.dataset.contextmenuTrigger??null:null},Ju=e=>({contextElement:typeof document>`u`?void 0:document.body,getBoundingClientRect:()=>({bottom:e.y,height:0,left:e.x,right:e.x,toJSON:()=>void 0,top:e.y,width:0,x:e.x,y:e.y})}),Yu=e=>{Bu={...Bu,...e},Uu()},Xu=null,Zu=(e,t)=>{let n={x:window.innerWidth/2,y:window.innerHeight/2};Yu({anchor:Ju(Hu.ready?{x:Hu.x,y:Hu.y}:n),footer:t?.footer,header:t?.header,iconAlign:t?.iconAlign,iconSpaceMode:t?.iconSpaceMode??`global`,items:e,listItemHeight:t?.listItemHeight,open:!0,triggerId:Hu.triggerId??null,virtual:t?.virtual})},Qu=(e,t)=>{typeof window<`u`&&(Xu?.show?Xu.show(e,t,()=>Zu(e,t)):Zu(e,t))},$u=()=>{Yu({anchor:null,footer:void 0,header:void 0,iconSpaceMode:`global`,items:[],listItemHeight:void 0,open:!1,triggerId:null,virtual:void 0})},ed=()=>{Xu?.close?Xu.close($u):$u()},X=Pt({block:`context-menu`,elements:[`trigger`,`positioner`,`header`,`viewport`,`footer`,`item`,`item-content`,`icon`,`label-group`,`label`,`desc`,`extra`,`submenu-arrow`,`checkbox-indicator`,`switch`,`separator`,`group`,`group-label`]});function td(e){let[t,n]=Y.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=Y.useRef(null),i=Y.useRef(null),a=Y.useRef(null),o=Y.useRef(null),s=Y.useRef(!0),c=Y.useRef(null),l=tt(),u=Y.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,J.jsx)(y.Provider,{value:u,children:(0,J.jsx)(v.Provider,{value:void 0,children:(0,J.jsx)(Oe,{...e})})})}var nd=Me,rd=(0,Y.memo)(({collisionPadding:e,style:t,...n})=>{let r=typeof t!=`function`&&t?.zIndex!=null&&typeof t.zIndex==`number`?t.zIndex:void 0,{zIndex:i,ref:a}=kt(`floating`,r),o=typeof t==`function`?e=>({zIndex:i,...t(e)}):{zIndex:i,...t};return(0,J.jsx)(nd,{...n,className:z(m.positioner,X(`positioner`)),collisionPadding:e??x(),ref:a,style:o})});rd.displayName=`ContextMenuSubmenuPositioner`;var id=(0,Y.memo)(()=>{let{t:e}=h(Qe);return(0,J.jsx)(Ee,{disabled:!0,className:z(R(F.item,F.empty).className,X(`item`)),children:(0,J.jsx)(`div`,{className:z(m.itemContent,X(`item-content`)),children:(0,J.jsx)(`span`,{className:z(m.label,X(`label`)),children:e(`common.empty`)})})})});id.displayName=`EmptyMenuItem`;var ad=({checked:e,children:t,closeOnClick:n=!1,danger:r,defaultChecked:i,disabled:a,label:o,onCheckedChange:s})=>{let[c,l]=(0,Y.useState)(i??!1),u=e!==void 0,d=u?e:c,f=(0,Y.useCallback)(e=>{u||l(e),s?.(e)},[u,s]);return(0,J.jsxs)(Ee,{closeOnClick:n,disabled:a,label:o,className:z(R(F.item,r&&F.danger).className,X(`item`)),onClick:e=>{e.preventDefault(),a||f(!d)},children:[t,(0,J.jsx)(`span`,{className:z(m.switchWrap,X(`switch`)),onFocus:e=>e.stopPropagation(),children:(0,J.jsx)(k,{checked:d,disabled:a,size:`small`,tabIndex:-1,onChange:f,onClick:(e,t)=>t.stopPropagation()})})]})},od=(e,t,n)=>{let r=P(e),i=`desc`in e?e.desc:void 0,a=`extra`in e?e.extra:void 0,o=t?.indicatorOnRight,s=!!i&&t?.iconAlign===`start`,c=n!==void 0&&!o,l=c?!!n:!!e.icon,u=c?!!(t?.reserveIconSpace||n):!!(l||t?.reserveIconSpace),d=i?(0,J.jsxs)(`div`,{className:z(m.labelGroup,X(`label-group`)),children:[(0,J.jsx)(`span`,{className:z(m.label,X(`label`)),children:r}),(0,J.jsx)(`span`,{className:z(m.desc,X(`desc`)),children:i})]}):(0,J.jsx)(`span`,{className:z(m.label,X(`label`)),children:r});return(0,J.jsxs)(`div`,{className:z(R(F.itemContent,s&&F.itemContentAlignStart).className,X(`item-content`)),children:[u?(0,J.jsx)(`span`,{"aria-hidden":!l,className:z(R(F.icon,s&&F.iconAlignStart).className,ke.icon,X(`icon`)),children:c?n:l?ye(e.icon,`small`):null}):null,d,a?(0,J.jsx)(`span`,{className:z(m.extra,X(`extra`)),children:a}):null,o&&n?n:null,t?.submenu?(0,J.jsx)(`span`,{className:z(m.submenuArrow,X(`submenu-arrow`)),children:(0,J.jsx)(ue,{})}):null]})},sd=(e,t,n)=>{if(!e.onClick)return;let r=e.key??t.at(-1)??``,i={domEvent:n,item:n.currentTarget,key:String(r),keyPath:t};e.onClick(i)},cd=(e,t=[],n)=>{let r=n?.iconAlign,i=n?.iconSpaceMode??`global`,a=n?.reserveIconSpace??te(e,i===`global`),o=n?.indicatorOnRight??f(e);return e.map((e,n)=>{if(!e)return null;let s=`${t.join(`-`)||`root`}-${n}`,c=ce(e,s),l=[...t,String(c)];if(e.type===`checkbox`){let t=e,n=P(t),i=typeof n==`string`?n:void 0,s=!!t.danger,l=(0,J.jsx)(Ze,{className:X(`checkbox-indicator`),children:(0,J.jsx)(ut,{icon:_,size:`small`})});return(0,J.jsx)(ge,{checked:t.checked,closeOnClick:t.closeOnClick,defaultChecked:t.defaultChecked,disabled:t.disabled,label:i,className:z(R(F.item,s&&F.danger).className,X(`item`)),onCheckedChange:e=>t.onCheckedChange?.(e),children:od(t,{iconAlign:r,indicatorOnRight:o,reserveIconSpace:a},l)},c)}if(e.type===`switch`){let t=e,n=P(t),i=typeof n==`string`?n:void 0,o=!!t.danger;return(0,J.jsx)(ad,{checked:t.checked,closeOnClick:t.closeOnClick,danger:o,defaultChecked:t.defaultChecked,disabled:t.disabled,label:i,onCheckedChange:t.onCheckedChange,children:od(t,{iconAlign:r,reserveIconSpace:a})},c)}if(e.type===`divider`)return(0,J.jsx)(Le,{className:z(m.separator,X(`separator`))},c);if(e.type===`group`){let t=e,n=i===`group`?t.children?te(t.children):!1:a,o=t.children?f(t.children):!1;return(0,J.jsxs)(pe,{className:X(`group`),children:[t.label?(0,J.jsx)(Ce,{className:z(m.groupLabel,X(`group-label`)),children:t.label}):null,t.children?cd(t.children,l,{iconAlign:r,iconSpaceMode:i,indicatorOnRight:o,reserveIconSpace:n}):null]},c)}if(e.type===`submenu`||`children`in e&&e.children){let t=e,n=P(t),o=typeof n==`string`?n:void 0,s=`danger`in t&&!!t.danger,u=t.header!=null||t.footer!=null,d=t.children&&t.children.length>0?cd(t.children,l,{iconAlign:r,iconSpaceMode:i}):(0,J.jsx)(id,{});return(0,J.jsxs)(Ue,{defaultOpen:t.defaultOpen,open:t.open,onOpenChange:t.onOpenChange,children:[(0,J.jsx)(Ke,{...t.triggerProps,closeDelay:t.closeDelay,delay:t.delay,disabled:t.disabled,label:o,openOnHover:t.openOnHover,className:z(R(F.item,s&&F.danger).className,X(`item`)),onClick:t.onClick,children:od(t,{iconAlign:r,reserveIconSpace:a,submenu:!0})}),(0,J.jsx)(xe,{children:(0,J.jsx)(rd,{alignOffset:-4,"data-submenu":``,sideOffset:-1,onContextMenu:Ru,children:(0,J.jsxs)(ze,{className:z(R(F.popup,u&&F.popupWithSlots).className,ke.popup,X()),children:[t.header==null?null:(0,J.jsx)(`div`,{className:z(m.header,X(`header`)),children:t.header}),u?(0,J.jsx)(`div`,{className:z(m.slotViewport,X(`viewport`)),children:d}):d,t.footer==null?null:(0,J.jsx)(`div`,{className:z(m.footer,X(`footer`)),children:t.footer})]})})})]},c)}let u=e,d=P(u),p=typeof d==`string`?d:void 0,h=`danger`in u&&!!u.danger;return(0,J.jsx)(Ee,{closeOnClick:u.closeOnClick,disabled:u.disabled,label:p,className:z(R(F.item,h&&F.danger).className,X(`item`)),onClick:e=>sd(u,l,e),children:od(u,{iconAlign:r,reserveIconSpace:a})},c)})},ld={"--lobe-dropdown-animation-duration":`0ms`},ud=(0,Y.memo)(()=>{let e=E(),t=at(),n=(0,Y.useSyncExternalStore)(Wu,Gu,Ku);(0,Y.useEffect)(()=>{},[e]),(0,Y.useEffect)(()=>{let e=e=>qu(e);return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`contextmenu`,e,!0),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`contextmenu`,e,!0)}},[]);let r=(0,Y.useMemo)(()=>cd(n.items,[],{iconAlign:n.iconAlign,iconSpaceMode:n.iconSpaceMode}),[n.items,n.iconAlign,n.iconSpaceMode]),{zIndex:i,ref:a}=kt(`floating`),o=n.header!=null||n.footer!=null;return!e||!n.open&&n.items.length===0?null:(0,J.jsx)(td,{open:n.open,onOpenChange:e=>{e?Yu({open:e}):ed()},children:(0,J.jsx)(xe,{container:t,children:(0,J.jsx)(nd,{anchor:n.anchor??void 0,className:z(m.positioner,X(`positioner`)),collisionPadding:x(),ref:a,sideOffset:6,style:{...ld,zIndex:i},children:(0,J.jsxs)(ze,{"data-has-footer":n.footer==null?void 0:``,"data-has-header":n.header==null?void 0:``,className:z(R(F.popup,o&&F.popupWithSlots).className,ke.popup,X()),onContextMenu:Ru,children:[n.header==null?null:(0,J.jsx)(`div`,{className:z(m.header,X(`header`)),children:n.header}),n.virtual?(0,J.jsx)(A,{className:X(`viewport`),itemSize:n.listItemHeight,children:r}):o?(0,J.jsx)(`div`,{className:z(m.slotViewport,X(`viewport`)),children:r}):r,n.footer==null?null:(0,J.jsx)(`div`,{className:z(m.footer,X(`footer`)),children:n.footer})]})})})})});ud.displayName=`ContextMenuHost`;function dd(e,t){let n=(t??bt(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}var fd=(0,Y.createContext)({position:`bottom-right`,swipeDirection:[`down`,`right`]}),pd=()=>(0,Y.useContext)(fd),md=[],hd=new Set,gd=()=>{for(let e of hd)e()},_d=e=>(md.push(e),gd(),()=>{let t=md.indexOf(e);t!==-1&&md.splice(t,1),gd()}),vd=e=>md[0]===e,yd=e=>(hd.add(e),()=>{hd.delete(e)}),bd=20,xd=5e3,Sd=!1,Cd=[],wd=e=>{Sd?e():(Cd.length>=bd&&Cd.shift(),Cd.push({queuedAt:Date.now(),run:e}))},Td=()=>{Sd=!0;let e=Cd;Cd=[];let t=Date.now();for(let n of e)t-n.queuedAt<=xd&&n.run()},Ed=()=>{Sd=!1},Z=Pt({block:`toast`,dataAttributes:[`type`,`position`],elements:[`viewport`,`content`,`body`,`icon`,`main`,`title-row`,`title`,`close`,`description`,`actions`,`action`]}),Q={action:{kVAM5u:`lb181nr7w`,kaIpWk:`lb1vihcfj`,ksu8eU:`lbng3xce`,kMzoRj:`lbfn42iu`,kg3NbH:`lbaope02`,kmkexE:`lb1cd9vmy`,kGNEyG:`lb6s0dn4`,kkrTdU:`lb1ypdohk`,k1xSpc:`lb3nfvp2`,kmuXW:`lb2lah0s`,kGuDYH:`lbfifm61`,k63SB2:`lbk50ysn`,kjj79g:`lbl56j7k`,kLWn49:`lbo5v014`,kZKoxP:`lb1fgtraw`,$$css:!0},actionDanger:{"--lobe-focus-ring-color":`lb2hswdp`,kWkggS:`lbixdnzb lb1ca5mm0 lb4c98my`,kMwMTN:`lb15g0kca`,kjBf7l:`lbiep9q5 lb1y5du2d`,$$css:!0},actionGhost:{kVAM5u:`lbqnr5ac lb1ahehej lbuhn3al`,ksu8eU:`lb1y0btm7`,kMzoRj:`lbmkeg23`,kWkggS:`lbjbqb8w`,kMwMTN:`lb66ogz0 lb1l4wxl8 lb1nelral`,$$css:!0},actionPrimary:{kWkggS:`lb1hsafae lblxzpop lb1gwghft`,kMwMTN:`lb15g0kca`,$$css:!0},actionSecondary:{kWkggS:`lbjjy28o lbswrfa9 lb147z954`,kMwMTN:`lb66ogz0`,$$css:!0},actionText:{kWkggS:`lbjbqb8w lbswrfa9 lb1cpyog9`,kMwMTN:`lb16owwnm`,$$css:!0},actions:{kOIVth:`lb167g77z`,kGNEyG:`lb6s0dn4`,kSGwAc:`lbpvyfi4`,k1xSpc:`lb78zum5`,kzQI83:`lb1iyjqo2`,kmuXW:`lb2lah0s`,kjj79g:`lb13a6bvl`,keoZOQ:`lb1xmf6yo`,$$css:!0},close:{kmVPX3:`lb1717udv`,kVAM5u:`lb181nr7w`,kaIpWk:`lb1vihcfj`,ksu8eU:`lbng3xce`,kMzoRj:`lbfn42iu`,kmkexE:`lb1ng1d19`,kGNEyG:`lb6s0dn4`,kWkggS:`lbjbqb8w lb1ri6zej`,kMwMTN:`lbc77et8 lb1bxu9lh`,kkrTdU:`lb1ypdohk`,k1xSpc:`lb78zum5`,kmuXW:`lb2lah0s`,kjj79g:`lbl56j7k`,keTefX:`lbvc5jky`,kZKoxP:`lb1qx5ct2`,kzqmXN:`lbw4jnvo`,$$css:!0},content:{kVQacm:`lbb3r6kr`,kmkexE:`lb1hzt7jf`,kSiTet:`lb1g256cz lbcbbmyo`,kfzvcC:`lbp78wxm lb1cicrrk`,$$css:!0},contentArea:{kUk6DE:`lb98rzlu`,k1xSpc:`lb78zum5`,kXwgrk:`lbdt5ytf`,k7Eaqz:`lbeuugli`,$$css:!0},description:{kogj98:`lb1ghz6dp`,kMwMTN:`lbc77et8`,kGuDYH:`lb4z9k3i`,kLWn49:`lb1evy7pa`,$$css:!0},descriptionWithTitle:{keoZOQ:`lb1gslohp`,$$css:!0},descriptionStandalone:{kMwMTN:`lb66ogz0`,$$css:!0},icon:{kGNEyG:`lb6s0dn4`,k1xSpc:`lb78zum5`,kmuXW:`lb2lah0s`,kjj79g:`lbl56j7k`,$$css:!0},root:{"--toast-collapsed-height":`lb1o8nl8n`,"--toast-gap":`lbr9sdi6`,"--toast-peek":`lb1wxzbih`,"--toast-scale":`lb1vhpo3u`,"--toast-shrink":`lb1c223hw`,kaIpWk:`lb159sbz3`,kkqhue:`lb17y0mx6`,k8WAf4:`lb10dr8xq`,kg3NbH:`lb1hr3lfm`,kHypHr:`lbx83zyx`,kWkggS:`lb1w937bt`,kGVxlE:`lbj07k4p`,kB7OPa:`lb9f619`,kMwMTN:`lb66ogz0`,kkrTdU:`lbt0e3qv`,kSiTet:`lb4ki41r`,kVAEAm:`lb10l6tqk`,kIyJzY:`lb1ssesjg lbm69ghq`,k1ekBW:`lb19ix5ol lbo3tt7b`,kAMwcw:`lb1477tyf lb7cr0y4`,kfSwDN:`lb87ps6o`,kY2c9j:`lb1l48cz2`,kZKoxP:`lb677f43 lbnbj6on`,kzqmXN:`lbh8yej3`,$$css:!0},rootBottom:{kYYq5F:`lb1fclj7r`,k3aq6I:`lb1qsqgls lbz09l4w lb1ce1yp4`,k3nNDw:`lb18ouj0k`,kcktkL:`lbb7ltuz`,k5JduY:`lb100rkj9`,k3foIR:`lb1srwf7z`,kwXMNM:`lb1j6awrg`,k4zj60:`lb1jflgyd`,$$css:!0},rootTop:{kYYq5F:`lbdwv5cp`,k3aq6I:`lb1jkqqlh lb7ly47h lbjeddtc`,k3nNDw:`lb1dp6rp6`,kcktkL:`lbb7ltuz`,k5JduY:`lb100rkj9`,k8Iv0R:`lb1wpe5ba`,kwXMNM:`lb1j6awrg`,k4zj60:`lb1jflgyd`,$$css:!0},title:{kogj98:`lb1ghz6dp`,kMwMTN:`lb66ogz0`,kGuDYH:`lbif65rj`,k63SB2:`lbk50ysn`,kLWn49:`lb1evy7pa`,$$css:!0},titleRow:{kOIVth:`lb167g77z`,kGNEyG:`lb1cy8zhl`,k1xSpc:`lb78zum5`,$$css:!0},toastBody:{kOIVth:`lb1v2ro7d`,kGNEyG:`lb1cy8zhl`,k1xSpc:`lb78zum5`,$$css:!0},viewport:{kI3sdo:`lb1b6ykf0`,kVAEAm:`lbixxii4`,kY2c9j:`lb979qle`,ks0D6T:`lbg5xlue`,kzqmXN:`lb1fzdfyu lbm1mc0`,$$css:!0},viewportBottom:{krVfgx:`lbo7r6ss`,kLqNvP:`lbbudbmw`,k3aq6I:`lbuuh30`,$$css:!0},viewportBottomLeft:{krVfgx:`lbo7r6ss`,kLqNvP:`lb10vz1dz`,$$css:!0},viewportBottomRight:{krVfgx:`lbo7r6ss`,kt4wiu:`lb1cj2eds`,k3aq6I:`lb18zyp77`,kIyJzY:`lb1x2t6jx lb12w9bfk`,k1ekBW:`lb11xpdln lb4wkmsb`,kAMwcw:`lbsygjwy lb7v8fk2`,$$css:!0},viewportTop:{k87sOh:`lb1kd19f1`,kLqNvP:`lbbudbmw`,k3aq6I:`lbuuh30`,$$css:!0},viewportTopLeft:{k87sOh:`lb1kd19f1`,kLqNvP:`lb10vz1dz`,$$css:!0},viewportTopRight:{k87sOh:`lb1kd19f1`,kt4wiu:`lb1cj2eds`,$$css:!0}},Dd={bottom:Q.viewportBottom,"bottom-left":Q.viewportBottomLeft,"bottom-right":Q.viewportBottomRight,top:Q.viewportTop,"top-left":Q.viewportTopLeft,"top-right":Q.viewportTopRight},Od={bottom:Q.rootBottom,"bottom-left":Q.rootBottom,"bottom-right":Q.rootBottom,top:Q.rootTop,"top-left":Q.rootTop,"top-right":Q.rootTop},kd={danger:Q.actionDanger,ghost:Q.actionGhost,primary:Q.actionPrimary,secondary:Q.actionSecondary,text:Q.actionText},Ad=Y.createContext(void 0);function jd(){let e=Y.useContext(Ad);if(!e)throw Error(rt(73));return e}var Md=0;function Nd(e){return Md+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Md}`}function Pd(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function Fd(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function Id(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var $={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},Ld=class extends wt{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Fd(e.toasts)},{},$)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=Id(this.state.toasts,t);r.toasts=e,r.toastMetadata=Fd(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=$.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||Nd(`toast`);if(e.id){let t=$.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(Id(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),$.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{let n=$.toast(this.state,e);n&&n.transitionStatus!==`ending`&&this.updateToastInternal(e,typeof t==`function`?t(n):t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=$.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;!d&&f?this.clearTimer(e):d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),$.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=$.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=Id(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=Pd(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=Pd(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=Pd(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=ft.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=At(e);Ct(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=$.expandedOrOutOfFocus(this.state)?void 0:ft.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:Fd(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=jt(pt(this.state.viewport));if(!this.state.viewport||!Ct(this.state.viewport,t)||!St(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=$.toasts(this.state),r=$.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},a=i(r+1,1)??i(r-1,-1);a?a.ref?.current?.focus():this.restoreFocusToPrevElement()}},Rd=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=dt(()=>new Ld({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return st(a.disposeEffect),Y.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t.updates):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,J.jsxs)(Ad.Provider,{value:a,children:[(0,J.jsx)(zd,{store:a,timeout:n,limit:r}),t]})};function zd(e){let{store:t,timeout:n,limit:r}=e;return nt(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var Bd=`--toast-frontmost-height`,Vd=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=jd(),c=it(),l=Y.useRef(!1),u=Y.useRef(!1),d=Y.useRef(!1),f=s.useState(`isEmpty`),p=s.useState(`toasts`),m=s.useState(`focused`),h=s.useState(`expanded`),g=s.useState(`prevFocusElement`),_=p[0]?.height,v=p.some(e=>e.transitionStatus===`ending`),y=p.filter(e=>e.priority===`high`);Y.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=bt(e),n=pt(e);function r(t){t.key===`F6`&&At(t)!==e&&(t.preventDefault(),s.set(`prevFocusElement`,jt(n)),e?.focus({preventScroll:!0}),s.pauseTimers(),s.set(`focused`,!0))}function i(e){At(e)===t&&(s.set(`isWindowFocused`,!1),s.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=At(n),i=jt(pt(e));r!==t&&Ct(e,r)&&St(i)||s.resumeTimers(),c.start(0,()=>s.set(`isWindowFocused`,!0))}return mt(Mt(t,`keydown`,r),Mt(t,`blur`,i,!0),Mt(t,`focus`,a,!0),Mt(n,`pointerdown`,s.handleDocumentPointerDown,!0))},[s,c,f]);function b(e){l.current=!0;let t=e.relatedTarget===s.state.viewport?p.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():s.restoreFocusToPrevElement()}function x(e){e.key===`Tab`&&e.shiftKey&&At(e.nativeEvent)===s.state.viewport&&(e.preventDefault(),s.restoreFocusToPrevElement())}function S(){s.state.toasts.some(e=>e.transitionStatus===`ending`)||d.current||!u.current||(s.set(`hovering`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers(),u.current=!1)}Y.useEffect(S,[v,s]);function C(){s.pauseTimers(),s.set(`hovering`,!0),u.current=!1}function w(){u.current=!0,S()}function T(e){e.pointerType===`touch`&&(d.current=!0)}function E(e){e.pointerType===`touch`&&(d.current=!1,S())}function D(){l.current?l.current=!1:m||St(jt(pt(s.state.viewport)))&&(s.set(`focused`,!0),s.pauseTimers())}function O(e){m&&!Ct(s.state.viewport,e.relatedTarget)&&(s.set(`focused`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers())}let k={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:C,onMouseMove:C,onMouseLeave:w,onFocus:D,onBlur:O,onKeyDown:x,onClick:D,onPointerDown:T,onPointerUp:E,onPointerCancel:E,style:{[Bd]:_?`${_}px`:void 0}},A={expanded:h},j=!f&&g&&(0,J.jsx)(_t,{onFocus:b}),ee=et(`div`,e,{ref:[t,s.setViewport],state:A,props:[k,o,{children:(0,J.jsxs)(Y.Fragment,{children:[j,a,j]})}]});return(0,J.jsxs)(Y.Fragment,{children:[j,ee,!m&&y.length>0&&(0,J.jsx)(`div`,{style:vt,children:y.map(e=>(0,J.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,J.jsx)(`div`,{children:e.title}),(0,J.jsx)(`div`,{children:e.description})]},e.id))})]})}),Hd=Y.createContext(void 0);function Ud(){let e=Y.useContext(Hd);if(!e)throw Error(rt(66));return e}function Wd(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}var Gd=`--toast-index`,Kd=`--toast-offset-y`,qd=`--toast-height`,Jd=`--toast-swipe-movement-x`,Yd=`--toast-swipe-movement-y`,Xd=`data-swipe-direction`,Zd=t(u(),1),Qd={...gt,swipeDirection(e){return e?{[Xd]:e}:null}},$d=40,ef=10,tf=.5,nf=1,rf=`${ht},${yt}`,af=Y.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,c=n.positionerProps?.anchor!==void 0,l=[];c||(l=Array.isArray(a)?a:[a]);let u=l.length>0,d=jd(),[f,p]=Y.useState(void 0),[m,h]=Y.useState(!1),[g,_]=Y.useState(!1),[v,y]=Y.useState({x:0,y:0}),[b,x]=Y.useState({x:0,y:0,scale:1}),[S,C]=Y.useState(),[w,T]=Y.useState(),[E,D]=Y.useState(null),O=Y.useRef(null),k=Y.useRef(void 0),A=Y.useRef({x:0,y:0}),j=Y.useRef({x:0,y:0,scale:1}),ee=Y.useRef(void 0),te=Y.useRef(0),ne=Y.useRef(!1),M=Y.useRef({x:0,y:0}),re=Y.useRef(!1),ie=Y.useRef({x:0,y:0}),N=Y.useRef(null),ae=Y.useRef(null),oe=d.useState(`toastIndex`,n.id),se=d.useState(`toastVisibleIndex`,n.id),ce=d.useState(`toastOffsetY`,n.id),le=d.useState(`focused`),ue=d.useState(`expanded`);Tt({open:n.transitionStatus!==`ending`,ref:O,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let de=ct((e=!1)=>{let t=O.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){d.updateToastInternal(n.id,{ref:O,height:i,transitionStatus:void 0})}e?Zd.flushSync(a):a()});nt(()=>{let e=k.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(p(void 0),x({x:0,y:0,scale:1}),P({x:0,y:0})),k.current=n.id,de())},[de,n.id,n.transitionStatus]);function P(e){ie.current=e,y(e)}nt(()=>()=>{ae.current?.abort()},[]);function fe(e,t){let n=e=>e>0?e**tf:-(Math.abs(e)**tf),r=e>0&&!l.includes(`right`)||e<0&&!l.includes(`left`),i=t>0&&!l.includes(`down`)||t<0&&!l.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let pe=ct(e=>{if(e.pointerId!==N.current)return;N.current=null,ae.current?.abort(),ae.current=null,h(!1),_(!1),D(null);let t=j.current;if(e.type===`pointercancel`||ne.current){P({x:t.x,y:t.y}),p(void 0);return}let r=ie.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of l)if(Wd(e,i,a)>$d){o=e;break}o?(p(o),d.closeToast(n.id)):(P({x:t.x,y:t.y}),p(void 0))});function me(e){if(e.button!==0)return;e.pointerType===`touch`&&d.pauseTimers();let t=At(e.nativeEvent);if(Ot(t,`button,a,input,textarea,[role="button"],${rf}`))return;ne.current=!1,ee.current=void 0,te.current=0,N.current=e.pointerId,A.current={x:e.clientX,y:e.clientY},M.current=A.current;let n=e.currentTarget,r=dd(n);j.current=r,x(r),P({x:r.x,y:r.y}),d.set(`hovering`,!0),h(!0),_(!1),D(null),re.current=!0,ae.current?.abort();let i=new AbortController;ae.current=i;let a=pt(n);a.addEventListener(`pointerup`,pe,{signal:i.signal}),a.addEventListener(`pointercancel`,pe,{signal:i.signal}),n.setPointerCapture?.(e.pointerId)}function he(e){if(e.pointerId!==N.current)return;e.preventDefault(),re.current&&=(A.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>M.current.y||i>0&&t<M.current.y)&&(M.current={x:M.current.x,y:t}),(r<0&&n>M.current.x||r>0&&n<M.current.x)&&(M.current={x:n,y:M.current.y});let a=n-A.current.x,o=t-A.current.y,s=t-M.current.y,c=n-M.current.x,u=E;if(!g&&Math.sqrt(a*a+o*o)>=nf){_(!0);let e=l.includes(`left`)||l.includes(`right`),t=l.includes(`up`)||l.includes(`down`);e&&t&&(u=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,D(u))}let d;if(!ee.current)u===`vertical`?o>0?d=`down`:o<0&&(d=`up`):u===`horizontal`?a>0?d=`right`:a<0&&(d=`left`):d=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,d&&l.includes(d)&&(ee.current=d,te.current=Wd(d,a,o),p(d));else{let e=ee.current,t=Wd(e,c,s);t>$d?(ne.current=!1,p(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&te.current-t>=ef&&(ne.current=!0)}let f=fe(a,o),m=j.current.x,h=j.current.y,v=l.includes(`left`)||l.includes(`right`),y=l.includes(`up`)||l.includes(`down`);u!==`vertical`&&v&&(m+=f.x),u!==`horizontal`&&y&&(h+=f.y),P({x:m,y:h})}function ge(e){if(e.key===`Escape`){if(!O.current||!Ct(O.current,jt(pt(O.current))))return;d.closeToast(n.id)}}Y.useEffect(()=>{let e=O.current;if(!u||!e)return;function t(t){N.current!==null&&Ct(e,At(t))&&t.preventDefault()}return Mt(e,`touchmove`,t,{passive:!1})},[u]);function _e(){let e=v.x-b.x,t=v.y-b.y;return{transition:m?`none`:void 0,transform:m?`translateX(${v.x}px) translateY(${v.y}px) scale(${b.scale})`:void 0,[Jd]:`${e}px`,[Yd]:`${t}px`}}let ve=n.priority===`high`,ye={role:ve?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":S,"aria-describedby":w,"aria-hidden":ve&&!le?!0:void 0,onPointerDown:u?me:void 0,onPointerMove:u?he:void 0,onPointerUp:u?pe:void 0,onPointerCancel:u?pe:void 0,onKeyDown:ge,inert:Et(n.limited),style:{..._e(),[Gd]:n.transitionStatus===`ending`?oe:se,[Kd]:`${ce}px`,[qd]:n.height?`${n.height}px`:void 0}},be=Y.useMemo(()=>({toast:n,setTitleId:C,setDescriptionId:T,recalculateHeight:de,visibleIndex:se,expanded:ue}),[n,C,T,de,se,ue]),xe={transitionStatus:n.transitionStatus,expanded:ue,limited:n.limited||!1,type:n.type,swiping:m,swipeDirection:f},Se=et(`div`,e,{ref:[t,O],state:xe,stateAttributesMapping:Qd,props:[ye,s]});return(0,J.jsx)(Hd.Provider,{value:be,children:Se})}),of=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=Ud(),l=Y.useRef(null);return nt(()=>{c();let e=l.current;if(!e||typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`)return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),et(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})});function sf(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(sf)}function cf(e){return Y.isValidElement(e)&&sf(e.props.children)}function lf(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=Ud(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:tt(e),children:s,type:r.type,setId:o}}function uf(e,t,n){let r=cf(e);return nt(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var df=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=lf(a,o,`description`);return uf(et(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),ff=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=lf(a,o,`title`);return uf(et(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),pf=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=jd(),{toast:l,expanded:u}=Ud(),[d,f]=Y.useState(!1),{getButtonProps:p,buttonRef:m}=xt({disabled:a,native:o}),h={type:l.type};return et(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),mf=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=Ud(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=xt({disabled:a,native:o}),f={type:c.type},p=et(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return cf(p)?p:null}),hf=Y.forwardRef(function(e,t){return(0,J.jsx)(Ie,{ref:t,...e})});function gf(){let e=jd(),t=e.useState(`toasts`);return Y.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function _f(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||Nd(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{id:e,updates:n}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var vf={default:ie,error:Wa,info:ie,loading:Ye,success:Ha,warning:he},yf={default:Xe.colorText,error:Xe.colorError,info:Xe.colorInfo,loading:Xe.colorPrimary,success:Xe.colorSuccess,warning:Xe.colorWarning},bf=(0,Y.memo)(({toast:e,classNames:t,styles:n})=>{let{position:r,swipeDirection:i}=pd(),a=e.data,o=a?.type??`default`,s=a?.closable??!0,c=a?.hideCloseButton??!1,l=s&&!c,u=a?.icon,d=e.title??a?.title,f=e.description??a?.description,p=e.actionProps??a?.actionProps,m=a?.actions,h=yf[o],g=u??vf[o],_=o===`loading`,v=()=>g?(0,J.jsx)(`div`,{...L(Q.icon,z(Z(`icon`),t?.icon),n?.icon),children:(0,J.jsx)(ut,{color:h,icon:g,size:18,spin:_})}):null,y=()=>m&&m.length>0?(0,J.jsx)(`div`,{...L(Q.actions,z(Z(`actions`),t?.actions),n?.actions),children:m.map((e,r)=>(0,J.jsx)(mf,{...L([Q.action,ot.info,kd[e.variant??`primary`]],z(Z(`action`),t?.action),n?.action),onClick:e.onClick,...e.props,children:e.label},r))}):p?(0,J.jsx)(mf,{...L([Q.action,ot.info,Q.actionPrimary],z(Z(`action`),t?.action),n?.action),...p}):null;return(0,J.jsx)(af,{swipeDirection:i,toast:e,...Ft({position:r,type:o}),...L([Q.root,Od[r]],z(Z(),t?.root),{...n?.root,...a?.style}),children:(0,J.jsx)(of,{...L(Q.content,z(Z(`content`),t?.content),n?.content),children:(0,J.jsxs)(`div`,{...L(Q.toastBody,Z(`body`)),children:[v(),(0,J.jsxs)(`div`,{...L(Q.contentArea,Z(`main`)),children:[d?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{...L(Q.titleRow,Z(`title-row`)),children:[(0,J.jsx)(ff,{...L(Q.title,z(Z(`title`),t?.title),n?.title),children:d}),l&&(0,J.jsx)(pf,{"aria-label":`Close`,...L(Q.close,z(Z(`close`),t?.close),n?.close),children:(0,J.jsx)(lt,{size:14})})]}),f&&(0,J.jsx)(df,{...L([Q.description,Q.descriptionWithTitle],z(Z(`description`),t?.description),n?.description),children:f})]}):f&&(0,J.jsxs)(`div`,{...L(Q.titleRow,Z(`title-row`)),children:[(0,J.jsx)(df,{...L([Q.description,Q.descriptionStandalone],z(Z(`description`),t?.description),n?.description),children:f}),l&&(0,J.jsx)(pf,{"aria-label":`Close`,...L(Q.close,z(Z(`close`),t?.close),n?.close),children:(0,J.jsx)(lt,{size:14})})]}),y()]})]})})})});bf.displayName=`ToastItem`;var xf=[`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`],Sf={duration:5e3,limit:5,position:`bottom-right`,swipeDirection:[`down`,`right`]},Cf={bottom:_f(),"bottom-left":_f(),"bottom-right":_f(),top:_f(),"top-left":_f(),"top-right":_f()},wf={bottom:new Map,"bottom-left":new Map,"bottom-right":new Map,top:new Map,"top-left":new Map,"top-right":new Map},Tf=e=>Cf[e],Ef=0,Df=()=>`toast-${Date.now().toString(36)}-${(Ef++).toString(36)}`,Of=e=>xf.find(t=>wf[t].has(e)),kf=(e,t)=>Array.from(wf[e].keys()).at(-1)===t,Af=(e,t)=>typeof e==`string`?{description:e,type:t}:{...e,type:t},jf=(e,t)=>({close:()=>wd(()=>Tf(t).close(e)),id:e,update:n=>{wd(()=>Tf(t).update(e,{data:n,description:n.description,title:n.title}))}}),Mf=e=>{let t=e.placement??Sf.position,n=Tf(t),{id:r,onClose:i,onRemove:a}=e;if(r){let e=Of(r);e&&!(e===t&&kf(t,r))&&(wf[e].get(r).superseded=!0,wf[e].delete(r),wd(()=>Tf(e).close(r)))}let o=r??Df(),s={superseded:!1};return wf[t].set(o,s),wd(()=>{n.add({id:o,data:e,description:e.description,onClose:()=>{s.superseded||i?.()},onRemove:()=>{s.superseded||(wf[t].delete(o),a?.())},timeout:e.duration??Sf.duration,title:e.title})}),jf(o,t)},Nf=e=>{if(e)for(let[t,n]of Object.entries(Cf))wf[t].delete(e),wd(()=>n.close(e));else for(let[e,t]of Object.entries(Cf)){let n=Array.from(wf[e].keys());wf[e].clear(),wd(()=>{for(let e of n)t.close(e)})}},Pf=e=>Mf(Af(e,`success`)),Ff=e=>Mf(Af(e,`error`)),If=e=>Mf(Af(e,`info`)),Lf=e=>Mf(Af(e,`warning`)),Rf=e=>Mf({duration:0,...Af(e,`loading`)});async function zf(e,t){let n=Mf({closable:!1,duration:0,type:`loading`,...typeof t.loading==`string`?{description:t.loading}:t.loading});try{let r=await e;return n.close(),Mf({type:`success`,...typeof t.success==`string`?{description:t.success}:typeof t.success==`function`?{description:t.success(r)}:t.success}),r}catch(e){throw n.close(),Mf({type:`error`,...typeof t.error==`string`?{description:t.error}:typeof t.error==`function`?{description:t.error(e)}:t.error}),e}}var Bf=Object.assign(e=>Mf({type:`default`,...e}),{dismiss:Nf,error:Ff,info:If,loading:Rf,promise:zf,success:Pf,warning:Lf}),Vf=(0,Y.memo)(()=>{let{toasts:e}=gf();return e.map(e=>(0,J.jsx)(bf,{toast:e},e.id))});Vf.displayName=`ToastList`;var Hf=(0,Y.memo)(({root:e,className:t,duration:n=5e3,limit:r=5,position:i=`bottom-right`,swipeDirection:a=[`down`,`right`]})=>{let o=E(),s=at(),[c,l]=(0,Y.useState)(void 0),u=(0,Y.useId)();(0,Y.useEffect)(()=>_d(u),[u]);let d=(0,Y.useSyncExternalStore)(yd,()=>vd(u),()=>!1);if((0,Y.useEffect)(()=>{d&&(Sf={duration:n,limit:r,position:i,swipeDirection:a})},[n,r,i,a,d]),(0,Y.useEffect)(()=>{d&&l(Dt(`toast`))},[d]),(0,Y.useEffect)(()=>{if(d&&o)return Td(),()=>{Ed()}},[d,o]),!o||!d)return null;let f=e??s??document.body;return xf.map(e=>(0,J.jsx)(fd,{value:{position:e,swipeDirection:a},children:(0,J.jsx)(Rd,{limit:r,timeout:n,toastManager:Tf(e),children:(0,J.jsx)(hf,{container:f,children:(0,J.jsx)(Vd,{"data-position":e,...L([Q.viewport,Dd[e]],z(Z(`viewport`),t),c===void 0?void 0:{zIndex:c}),children:(0,J.jsx)(Vf,{})})})})},e))});Hf.displayName=`ToastHost`;var Uf=e({Board:()=>Iu,Group:()=>Wf,Item:()=>Au}),Wf=_u(Cl),Gf=e({Reorder:()=>Uf,a:()=>ma,abbr:()=>Ki,address:()=>oa,animate:()=>ki,area:()=>ei,article:()=>Xi,aside:()=>ua,audio:()=>si,b:()=>zi,base:()=>va,bdi:()=>di,bdo:()=>vi,big:()=>ea,blockquote:()=>Ui,body:()=>Ei,button:()=>Si,canvas:()=>Xr,caption:()=>Sa,circle:()=>Pa,cite:()=>ii,clipPath:()=>Aa,code:()=>wr,col:()=>kn,colgroup:()=>Ea,create:()=>ca,data:()=>Or,datalist:()=>In,dd:()=>Nn,defs:()=>fr,del:()=>Ii,desc:()=>Cn,details:()=>Ni,dfn:()=>or,dialog:()=>lr,div:()=>hr,dl:()=>zn,dt:()=>Jn,ellipse:()=>rr,em:()=>xr,embed:()=>Ra,feBlend:()=>En,feColorMatrix:()=>Fr,feComponentTransfer:()=>Gn,feComposite:()=>Mr,feConvolveMatrix:()=>Rr,feDiffuseLighting:()=>Hn,feDisplacementMap:()=>er,feDistantLight:()=>ra,feDropShadow:()=>Zn,feFlood:()=>Wr,feFuncA:()=>Vr,feFuncB:()=>qr,feFuncG:()=>vr,feFuncR:()=>bn,feGaussianBlur:()=>_i,feImage:()=>_a,feMerge:()=>Yi,feMergeNode:()=>la,feMorphology:()=>Mi,feOffset:()=>ri,fePointLight:()=>$i,feSpecularLighting:()=>pa,feSpotLight:()=>ui,feTile:()=>Hi,feTurbulence:()=>xa,fieldset:()=>mi,figcaption:()=>xi,figure:()=>na,filter:()=>Gi,footer:()=>Oi,foreignObject:()=>Ti,form:()=>$r,g:()=>Ta,h1:()=>La,h2:()=>oi,h3:()=>Na,h4:()=>Dr,h5:()=>Mn,h6:()=>ka,head:()=>jr,header:()=>Rn,hgroup:()=>Fn,hr:()=>mr,html:()=>Ri,i:()=>Tn,iframe:()=>Fi,image:()=>cr,img:()=>dr,input:()=>_r,ins:()=>Vn,kbd:()=>Xn,keygen:()=>ar,label:()=>Cr,legend:()=>Ba,li:()=>On,line:()=>Lr,linearGradient:()=>qn,link:()=>Pr,main:()=>Br,map:()=>Wn,mark:()=>nr,marker:()=>aa,mask:()=>$n,menu:()=>Kr,menuitem:()=>Ur,metadata:()=>Yr,meter:()=>br,nav:()=>Sn,object:()=>hi,ol:()=>ha,optgroup:()=>qi,option:()=>sa,output:()=>Ai,p:()=>ti,param:()=>Zi,path:()=>da,pattern:()=>ci,picture:()=>Bi,polygon:()=>ya,polyline:()=>fi,pre:()=>yi,progress:()=>ta,q:()=>Wi,radialGradient:()=>Di,rect:()=>Ci,rp:()=>Zr,rt:()=>Ca,ruby:()=>Fa,s:()=>ai,samp:()=>ja,script:()=>Tr,section:()=>An,select:()=>Da,small:()=>kr,source:()=>Ln,span:()=>Pn,stop:()=>pr,strong:()=>Li,style:()=>wn,sub:()=>Pi,summary:()=>sr,sup:()=>ur,svg:()=>gr,symbol:()=>Bn,table:()=>Yn,tbody:()=>ir,td:()=>Sr,text:()=>za,textPath:()=>Dn,textarea:()=>Ir,tfoot:()=>Kn,th:()=>Nr,thead:()=>zr,time:()=>Un,title:()=>tr,tr:()=>ia,track:()=>Qn,tspan:()=>Gr,u:()=>Hr,ul:()=>Jr,use:()=>yr,video:()=>xn,view:()=>gi,wbr:()=>ga,webview:()=>Ji}),Kf=l();function qf(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var Jf=Nt(),Yf=Y.useInsertionEffect,Xf=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?Y.useLayoutEffect:Y.useEffect,Zf=Yf||Xf,Qf=e=>{let t=Y.useRef([e,(...e)=>t[0](...e)]).current;return Zf(()=>{t[0]=e}),t[1]},$f=[`popstate`,`pushState`,`replaceState`,`hashchange`],ep=[],tp=()=>ep.forEach(e=>e()),np=e=>(ep.push(e)===1&&$f.forEach(e=>addEventListener(e,tp)),()=>{ep=ep.filter(t=>t!==e),ep.length||$f.forEach(e=>removeEventListener(e,tp))}),rp=(e,t)=>(0,Jf.useSyncExternalStore)(np,e,t),ip=()=>location.search,ap=({ssrSearch:e}={})=>rp(ip,e==null?ip:()=>e),op=()=>location.pathname,sp=({ssrPath:e}={})=>rp(op,e==null?op:()=>e),cp=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),lp=e=>[sp(e),cp],up=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[up]===void 0){for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,up,{value:!0})}var dp=(e=``)=>e===`/`?``:e,fp=(e,t)=>e[0]===`~`?e.slice(1):dp(t)+e,pp=(e,t)=>(e=mp(dp(e)),t=mp(t),!e||(t.toLowerCase()+`/`).startsWith(e.toLowerCase()+`/`)?t.slice(e.length)||`/`:`~`+t),mp=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},hp={hook:lp,searchHook:ap,parser:qf,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},gp=(0,Y.createContext)(hp),_p=()=>(0,Y.useContext)(gp);(0,Y.createContext)({});var vp=e=>{let[t,n]=e.hook(e);return[pp(e.base,t),Qf((t,r)=>e.aroundNav(n,fp(t,e.base),r))]},yp=()=>vp(_p());(0,Y.forwardRef)((e,t)=>{let n=_p(),[r,i]=vp(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e;return m.onClick=Qf(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),m.href=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n),u!==void 0&&(m.className=u?.call?u(r===o):u),t&&(m.ref=t),c&&(0,Y.isValidElement)(l)?(0,Y.cloneElement)(l,m):(0,Y.createElement)(`a`,m,l)});function bp(e=window){try{let t=e.parent,n=new URLSearchParams(e.location.search).get(`at`);if(t!==e&&t.location.origin===e.location.origin&&/^\/whiteboard\/[^/]+\/?$/.test(t.location.pathname)&&t.location.pathname===n)return t}catch{}return e}var xp=0,Sp=0,Cp=new Set;function wp(){Sp||xp>0||Cp.size===0||(Sp=requestAnimationFrame(()=>{if(Sp=0,xp>0)return;let e=[...Cp];Cp.clear();for(let t of e)t()}))}function Tp(){return xp+=1,()=>{--xp,wp()}}function Ep({label:e}){return(0,Y.useEffect)(Tp,[]),(0,J.jsx)(o,{stack:!0,label:e,size:32})}var Dp=new Set;function Op(e){return Dp.add(e),()=>{Dp.delete(e)}}function kp(e){for(let t of Dp)t(e)}function Ap(e){return`${e.protocol===`https:`?`wss`:`ws`}://${e.host}/ws?at=${encodeURIComponent(e.pathname)}`}function jp(e,t){let[n,r]=(0,Y.useState)(!1),i=(0,Y.useRef)({onMessage:e,onOpen:t}),a=(0,Y.useRef)(null),o=(0,Y.useRef)([]);return i.current={onMessage:e,onOpen:t},(0,Y.useEffect)(()=>{let e=null,t,n=!1,s=()=>{e=new WebSocket(Ap(location)),a.current=e,e.onopen=()=>{r(!0);for(let t of o.current.splice(0))e?.send(t);i.current.onOpen?.()},e.onclose=()=>{r(!1),n||(t=setTimeout(s,1e3))},e.onmessage=e=>{let t=JSON.parse(String(e.data));i.current.onMessage(t),kp(t)}};return s(),()=>{n=!0,clearTimeout(t),e?.close()}},[]),{live:n,send:(0,Y.useCallback)(e=>{let t=a.current,n=JSON.stringify(e);t?.readyState===WebSocket.OPEN?t.send(n):o.current.length<50&&o.current.push(n)},[])}}function Mp(){let[e,t]=(0,Y.useState)([]);return(0,Y.useEffect)(()=>{let e=null,n,r=!1,i=()=>{e=new WebSocket(Ap(location)),e.onmessage=e=>{let n=JSON.parse(String(e.data));n.type===`agent-status`&&t(n.sessions)},e.onclose=()=>{t([]),r||(n=setTimeout(i,1e3))}};return i(),()=>{r=!0,clearTimeout(n),e?.close()}},[]),e}var Np=(0,Y.lazy)(()=>r(async()=>{let{AgentStatusPill:e}=await import(`./AgentStatusPill-D0Rec9af.js`);return{AgentStatusPill:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url).then(({AgentStatusPill:e})=>({default:e})));function Pp({artifact:e}){let t=Mp();return t.length===0?null:(0,J.jsx)(Y.Suspense,{fallback:null,children:(0,J.jsx)(Np,{artifact:e,sessions:t})})}var Fp=1e3,Ip=`ryugi:embed:hello`,Lp=`ryugi:embed:heartbeat`,Rp=`ryugi:embed:painted`,zp=`ryugi:embed:position`,Bp=`ryugi:embed:positioned`;function Vp({parentOrigin:e,onPosition:t,win:n=window}){let r=(t,r)=>n.parent.postMessage({type:t,...r},e),i=i=>{if(i.origin!==e||i.source!==n.parent)return;let a=i.data;a?.type===zp&&a.anchor&&t&&t(a.anchor).then(()=>r(Bp))};n.addEventListener(`message`,i),r(Ip,t?{position:!0}:void 0);let a=setInterval(()=>r(Lp),Fp),o=!1;return{painted(){o||(o=!0,r(Rp))},close(){clearInterval(a),n.removeEventListener(`message`,i)}}}function Hp(e=document,t=window,n){let r=e.documentElement.dataset.ryugiEmbedParent;return r?Vp({parentOrigin:r,onPosition:n,win:t}):null}var Up=()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e()))),Wp=e=>(we(e),Up()),Gp=(0,Y.createContext)(()=>{});function Kp(){let e=(0,Y.useRef)(null),t=(0,Y.useRef)(!1);return(0,Y.useEffect)(()=>{let n=Hp(document,window,Wp);return e.current=n,t.current&&n?.painted(),()=>{n?.close(),e.current=null}},[]),(0,Y.useCallback)(()=>{t.current=!0,e.current?.painted()},[])}function qp(e){let t=(0,Y.useContext)(Gp);(0,Y.useEffect)(()=>{if(!e)return;let n=0,r=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>{t(),Ae()&&Ne({kind:`painted`})})});return()=>{cancelAnimationFrame(r),cancelAnimationFrame(n)}},[e,t])}var Jp=(0,Y.createContext)(null);function Yp({pageWindow:e,children:t}){return(0,J.jsx)(Jp.Provider,{value:e??null,children:t})}var Xp=()=>(0,Y.useContext)(Jp)??window,Zp=(0,Y.lazy)(()=>r(async()=>{let{AutoPublishBar:e}=await import(`./auto-publish-DHavv7el.js`);return{AutoPublishBar:e}},__vite__mapDeps([25,1,26,12,3,27,28,2,4,5,6,7,23]),import.meta.url).then(({AutoPublishBar:e})=>({default:e}))),Qp=(0,Y.lazy)(()=>r(async()=>{let{SettingsDialog:e}=await import(`./settings-BVzw2sWx.js`);return{SettingsDialog:e}},__vite__mapDeps([29,1,30,17,3,4,5,10,2,6,7,11,12,13,31,32,33,34,35,23,36,37,27,28,18]),import.meta.url).then(({SettingsDialog:e})=>({default:e}))),$p=(0,Y.lazy)(()=>r(async()=>{let{ArtboardLayout:e}=await import(`./ArtboardLayout-C5pqwr8S.js`);return{ArtboardLayout:e}},__vite__mapDeps([38,1,10,2,3,4,5,6,7,11,12,13,39,40,41,42,43,21,16,17,44,23,45,32,46,47,14,48,31,49,50,15,51,52,53,54,34,18,55,56,9,57,35,58,26,59,60,61,27,28,36,62,63,64,65,66,67,68,33,24,69,70,71,72,73,19,20,74,75,76]),import.meta.url).then(({ArtboardLayout:e})=>({default:e}))),em=(0,Y.lazy)(()=>r(async()=>{let{ArtifactList:e}=await import(`./ArtifactList-CXK1wKgO.js`);return{ArtifactList:e}},__vite__mapDeps([77,1,10,2,3,4,5,6,7,11,12,13,51,15,33,34,31,50,47,14,48,17,78,65,62,79,18,55,30,53,54,59,27,28,35,23,63,70,68]),import.meta.url).then(({ArtifactList:e})=>({default:e}))),tm=(0,Y.lazy)(()=>r(async()=>{let{DocumentLayout:e}=await import(`./DocumentLayout-Deg-ZGA1.js`);return{DocumentLayout:e}},__vite__mapDeps([80,1,3,4,2,5,6,7]),import.meta.url).then(({DocumentLayout:e})=>({default:e}))),nm=(0,Y.lazy)(()=>r(async()=>{let{ReportLayout:e}=await import(`./ReportLayout-TkIi9O3f.js`);return{ReportLayout:e}},__vite__mapDeps([81,1,57,2,3,4,5,6,7,10,11,12,13,47,14,48,17,31,35,58,50,26,59,60,44,23,61,27,28,36,18,75,82,83,79,84,69,70,85,55,73,24,9,15,16,43,56]),import.meta.url).then(({ReportLayout:e})=>({default:e}))),rm=(0,Y.lazy)(()=>r(async()=>{let{HtmlLayout:e}=await import(`./HtmlLayout-BtGbMait.js`);return{HtmlLayout:e}},__vite__mapDeps([86,1,3,79,47,2,4,5,6,7,10,11,12,13,14,48,17,31,18,84,69,70,57,35,58,50,26,59,60,44,23,61,27,28,36,75]),import.meta.url).then(({HtmlLayout:e})=>({default:e}))),im=(0,Y.lazy)(()=>r(async()=>{let{SlidesLayout:e}=await import(`./SlidesLayout-Bgur5-Ez.js`);return{SlidesLayout:e}},__vite__mapDeps([87,1,57,2,3,4,5,6,7,10,11,12,13,47,14,48,17,31,35,58,50,26,59,60,44,23,61,27,28,36,18,75,88,89,90,84,69,70,43,79,24,56,55,9,15,16,46,49,51,91,83,92,62,53,54,34,33,32,71,20,73,72,67,93,41,94,19,85,95]),import.meta.url).then(({SlidesLayout:e})=>({default:e}))),am=(0,Y.lazy)(()=>r(async()=>{let{VerifyLayout:e}=await import(`./VerifyLayout-MN-8cJN7.js`);return{VerifyLayout:e}},__vite__mapDeps([96,1,57,2,3,4,5,6,7,10,11,12,13,47,14,48,17,31,35,58,50,26,59,60,44,23,61,27,28,36,18,97,98,99,62,49,100,91,64,65,32,54,34,101,102,92,72,103,83,93,56,55,9,15,16,78,41,40,21,24,19,20,84,22,37,89,104,66,67,68,43,105,106]),import.meta.url).then(({VerifyLayout:e})=>({default:e}))),om=(0,Y.lazy)(()=>r(async()=>{let{WhiteboardLayout:e}=await import(`./WhiteboardLayout-Q-bMT-_q.js`);return{WhiteboardLayout:e}},__vite__mapDeps([107,1,108,99,2,3,4,5,6,7,10,11,12,13,47,14,48,17,31,62,58,49,100,91,64,65,32,54,34,101,90,24,61,28,45,16,21,9,15,18,56,55,23,37,52,53,83,109]),import.meta.url).then(({WhiteboardLayout:e})=>({default:e}))),sm=(0,Y.lazy)(()=>Promise.all([r(()=>import(`./split-BVOyh9Pb.js`),__vite__mapDeps([110,1,89,10,2,3,4,5,6,7,11,12,13,70,102,73,100,103,72,93,20,94,48,53,54,34,18,23,111,82,112,24,105,109,113]),import.meta.url),r(()=>import(`./local-split-host-1U6JgPrf.js`).then(e=>e.n),__vite__mapDeps([88,1,89,10,2,3,4,5,6,7,11,12,13,28]),import.meta.url)]).then(([{SplitShell:e},{localSplitHost:t}])=>({default:n=>(0,J.jsx)(e,{...n,host:t})}))),cm=(0,Y.lazy)(()=>r(async()=>{let{PreviewLayout:e}=await import(`./PreviewLayout-D6i9jAsH.js`).then(e=>e.n);return{PreviewLayout:e}},__vite__mapDeps([114,1,3,28,2,4,5,6,7,39,23]),import.meta.url).then(({PreviewLayout:e})=>({default:e}))),lm=(e,t)=>(0,J.jsxs)(J.Fragment,{children:[e,(0,J.jsx)(Zp,{}),(0,J.jsx)(Qp,{}),t&&(0,J.jsx)(Pp,{artifact:t})]});function um({id:e,type:t}){let n=Kp();return(0,J.jsx)(Gp,{value:n,children:t===`whiteboard`?(0,J.jsx)(Yp,{pageWindow:bp(),children:(0,J.jsx)(om,{id:e})}):t===`document`?(0,J.jsx)(tm,{id:e}):t===`verify`?(0,J.jsx)(am,{id:e}):t===`slides`?(0,J.jsx)(im,{id:e}):(0,J.jsx)($p,{id:e})})}function dm(){let[e]=yp(),t=a(e);if((0,Y.useEffect)(()=>{if(!document.documentElement.dataset.ryugiArtifactId)return;let e=document.querySelector(`link[rel="canonical"]`);if(!e)return;let t=new URL(location.href);t.pathname=c(t.pathname,new URL(e.href).pathname),t.href!==location.href&&history.replaceState(history.state,``,t)},[]),(0,Y.useEffect)(()=>{window.scrollTo(0,0)},[e]),t.kind===`list`)return lm((0,J.jsx)(em,{}));if(t.kind===`unknown`)return(0,J.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k x5yr21d xggk2y7 x1bo0w0s xqfszdh xif65rj`,children:`No artifact lives at this address.`});let n=document.documentElement.dataset.ryugiArtifactId??t.id;return t.kind===`preview`?(0,J.jsx)(cm,{id:n,type:t.type}):t.kind===`embed`?(0,J.jsx)(um,{id:n,type:t.type}):t.type===`html`?lm((0,J.jsx)(rm,{id:n}),`html/${n}`):t.type===`slides`?lm((0,J.jsx)(im,{id:n}),`slides/${n}`):t.type===`report`?lm((0,J.jsx)(nm,{id:n}),`report/${n}`):lm((0,J.jsx)(sm,{id:n,split:Ve(t,location.search)?.split??null,type:t.type}),`${t.type}/${n}`)}function fm(){return(0,J.jsx)(Y.Suspense,{fallback:(0,J.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k x5yr21d xggk2y7 x1bo0w0s xqfszdh xif65rj`,children:(0,J.jsx)(Ep,{label:i(`common.loading`)})}),children:(0,J.jsx)(dm,{})})}re(),document.documentElement.lang=d[s.language];function pm(){return n(),(0,J.jsx)(bl,{features:Zl,children:(0,J.jsxs)(j,{enableCustomFonts:!1,motion:Gf,children:[(0,J.jsx)(fm,{}),(0,J.jsx)(Je,{}),(0,J.jsx)(Hf,{}),(0,J.jsx)(ud,{})]})})}(0,Kf.createRoot)(document.getElementById(`root`)).render((0,J.jsx)(Y.StrictMode,{children:(0,J.jsx)(pm,{})}));export{Ep as a,X as c,Qu as d,Wu as f,Wa as h,jp as i,Ku as l,tu as m,qp as n,Bf as o,Lu as p,Op as r,dd as s,Xp as t,Gu as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AgentStatusPill-B2LrXApc.js","./rolldown-runtime-XKyaHtl9.js","./route-CBDn8aA_.js","./react-DlmbjZJV.js","./jsx-runtime-LKYXHABd.js","./clsx-DRUh9g2d.js","./types-D9vXo34b.js","./index2.css","./PhoneSheet-Dyg85WID.js","./Composer-DtmsJM8R.js","./url-D2nInhsE.js","./mergeRefs-DM4719JU.js","./MotionConfigContext-B3czw3wn.js","./useScrollLock-DQ9j79Pm.js","./arrow-up-kdcWAnXX.js","./FieldControl-CHQD9IDx.js","./icons-DrkFjhmy.js","./Center-IV4K8JrC.js","./index5.css","./BottomSheet-7r3g6yRy.js","./motion-Cy65kd7X.js","./tokens.stylex-4hFgkDcQ.js","./read-resolutions-CyYzExQ1.js","./useTranslation-UGm7Uo4m.js","./useMedia-CFebB4XU.js","./auto-publish-CPtZZlz2.js","./cloud-upload-DClbwO_k.js","./useCloudStatus-_QzffzLo.js","./api-BCnpPU7U.js","./settings-CnSJna4w.js","./Avatar-Bl67MCxf.js","./isElementDisabled-DWHaZxJe.js","./maximize-2-BEWXAYRs.js","./Segmented-xJdCLm-b.js","./CompositeItem-r7w86f_k.js","./urls-YNuHd8vV.js","./CloudLegalNotice-C-lwr2NX.js","./preference-oNdcNeml.js","./ArtboardLayout-DuPhmI2p.js","./view-BVogu64x.js","./rounds-BLj-tfMG.js","./sliders-horizontal-BD0nAOF2.js","./Canvas-BaCiqx37.js","./cssVar.stylex-CGbpAC1Y.js","./elements-Coqr6-Yv.js","./WritingCursor-Bcmcf9RW.js","./snap-BpI2bGh5.js","./Popover-B_c2R3tb.js","./useTriggerFocusGuards-qc8VJB2K.js","./stringifyLocale-vuEzlEs6.js","./Select-TB8D_2Ak.js","./Input-C4lfMDT0.js","./PhoneArtboardBar-BZpLfQYf.js","./DropdownMenu-CJwUBLlC.js","./MenuTrigger-BP8vj2dt.js","./ActionIcon-CelD6ljd.js","./ThreadView-De_p-Sr1.js","./PublishMenu-eV9uW7Kg.js","./minus-YVaskeP9.js","./globe-IX-8l1m2.js","./link-2-CdvyBGG6.js","./usePageQuery-h2vHVMBa.js","./type-DA3yqyzM.js","./folder-DAgV-D-C.js","./ruler-C-6kncvn.js","./image-DSbKs3OG.js","./GroupVerdict-YCGvEg4H.js","./play-BT1pPvq4.js","./artifact-list-BgZnDmry.js","./useTypeFavicon-DfhRoYAf.js","./type-icons-hKtZQMAv.js","./ActionBar-BEJ066Ej.js","./file-text-CBItcVAp.js","./chevron-left-BwjnhkoQ.js","./selection-BWCQd_Fn.js","./useArtifactFeed-r3p9_j2-.js","./ArtboardLayout-DLyi-yDq.css","./ArtifactList-Cp_4E7tp.js","./search-ClR54veT.js","./WarningsBadge-BXOR30h4.js","./DocumentLayout-CJoYGdTu.js","./ReportLayout-DjlI-WU4.js","./rotate-ccw-clock-CzXnXfrp.js","./message-square-D1ap_NhC.js","./useSandboxFrame-CJmSnwgG.js","./DraggablePanel-DZLHeUmg.js","./HtmlLayout-L2YY8RF2.js","./SlidesLayout-DrnbCy4l.js","./local-split-host-Dl9rlSsp.js","./ref-CVmDwuKG.js","./pages-DWkRbog-.js","./trash-E1jt4Cuh.js","./video-CIk6tKSZ.js","./presentation-CrG2a4R-.js","./DocumentExportMenu-DHSPKzzP.js","./SlidesLayout-Bjds2UXz.css","./VerifyLayout-Calc3qn5.js","./useAssetBase-4Ut9QhBI.js","./editor-CcqMiLz3.js","./WhiteboardEditor-cZ32fLqJ-BAVFcyMv.js","./code-DZDLeByL.js","./index3.css","./pen-tool-BwPmMqqj.js","./external-link-CxwFOzUH.js","./index4.css","./fit-BLbHgoq2.js","./VerifyLayout-BH4hYui6.css","./WhiteboardLayout-CAcGLV3D.js","./shims-s-YVfIlz.js","./backlinks-C_k8-LL2.js","./split-B6eupXjE.js","./route-messages-hJ8pJxir.js","./SplitFrame-C8XTBMoN.js","./split-C1umM5Fz.css","./PreviewLayout-Z9Q--w6E.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{_ as n,b as r,m as i,n as a,o,p as s,t as c,v as l,w as u,y as d}from"./route-CBDn8aA_.js";/* empty css */import{$ as f,$t as p,At as m,B as h,Bt as g,Cr as _,Dt as v,Et as y,Ft as b,Gn as x,Gt as S,Ht as C,It as w,Jt as T,Kn as E,Kt as D,Lt as O,Mt as k,Nn as A,Or as j,Pt as ee,Q as te,Qt as ne,Rt as M,S as re,Sr as ie,Ut as N,V as ae,Vt as oe,Wt as se,X as ce,Xt as le,Y as ue,Yt as de,Z as P,Zt as fe,_t as pe,an as me,br as he,bt as ge,dn as _e,en as ve,et as ye,fn as be,ft as xe,gn as Se,gt as Ce,h as we,hn as Te,ht as Ee,in as De,it as Oe,jt as F,kt as ke,l as Ae,ln as je,lt as Me,m as Ne,mn as Pe,nn as Fe,nr as Ie,nt as Le,on as Re,pn as I,pt as ze,qt as Be,r as Ve,rn as He,rt as Ue,sn as We,tn as Ge,tt as Ke,un as qe,w as Je,xr as Ye,yr as Xe,yt as Ze,z as Qe,zt as $e}from"./url-D2nInhsE.js";import{G as et,H as tt,Q as nt,Z as rt,at as L,c as it,ct as at,it as ot,l as st,nt as ct,o as lt,ot as R,r as ut,rt as dt,s as ft}from"./mergeRefs-DM4719JU.js";import{Dn as pt,Ft as mt,J as ht,Jn as gt,Mt as _t,Nt as vt,Q as yt,Rn as bt,Tn as xt,Vt as St,an as Ct,b as wt,bn as Tt,g as Et,h as Dt,in as Ot,m as kt,on as At,rn as jt,wn as Mt,x as Nt}from"./useScrollLock-DQ9j79Pm.js";import{n as Pt,r as Ft,t as z}from"./clsx-DRUh9g2d.js";import{t as It}from"./react-DlmbjZJV.js";import{t as Lt}from"./jsx-runtime-LKYXHABd.js";import{$ as Rt,B as zt,Ct as Bt,G as Vt,I as Ht,J as Ut,M as Wt,N as Gt,P as Kt,St as qt,Tt as Jt,U as B,W as V,_t as Yt,a as Xt,bt as Zt,c as Qt,ct as $t,d as en,dt as H,et as tn,gt as nn,h as rn,ht as an,i as on,l as sn,m as cn,mt as ln,o as un,p as dn,r as fn,s as pn,st as mn,t as hn,u as gn,ut as _n,wt as vn,xt as yn}from"./MotionConfigContext-B3czw3wn.js";import{$ as bn,$n as xn,$t as Sn,A as Cn,An as wn,At as Tn,B as En,Bn as Dn,Bt as On,C as kn,Cn as An,Cr as jn,Ct as Mn,D as Nn,Dn as Pn,Dt as Fn,E as In,En as Ln,Et as Rn,F as zn,Fn as Bn,Ft as Vn,G as Hn,Gn as Un,Gt as Wn,H as Gn,Hn as Kn,Ht as qn,I as Jn,In as Yn,It as Xn,J as Zn,Jn as Qn,Jt as $n,K as er,Kn as tr,Kt as nr,L as rr,Ln as ir,Lt as ar,M as or,Mn as sr,Mt as cr,N as lr,Nn as ur,Nt as dr,O as fr,On as pr,Ot as mr,P as hr,Pn as gr,Pt as _r,Q as vr,Qn as yr,Qt as br,R as xr,Rn as Sr,Rt as Cr,S as wr,Sn as Tr,Sr as Er,St as Dr,T as Or,Tn as kr,Tr as Ar,Tt as jr,U as Mr,Un as Nr,Ut as Pr,V as Fr,Vn as Ir,Vt as Lr,W as Rr,Wn as zr,Wt as Br,X as Vr,Xn as Hr,Xt as Ur,Y as Wr,Yn as Gr,Yt as Kr,Z as qr,Zn as Jr,Zt as Yr,_ as Xr,_n as Zr,_r as Qr,_t as $r,a as ei,an as ti,ar as ni,at as ri,b as ii,bn as ai,br as U,bt as oi,c as si,cn as ci,cr as li,ct as ui,d as di,dn as fi,dr as pi,dt as mi,en as hi,er as gi,et as _i,f as vi,fn as yi,fr as bi,ft as xi,g as Si,gn as Ci,gr as wi,gt as Ti,h as Ei,hn as Di,ht as Oi,i as ki,in as Ai,ir as ji,it as Mi,j as Ni,jn as Pi,jt as Fi,k as Ii,kn as Li,kt as Ri,l as zi,ln as Bi,lr as Vi,lt as Hi,m as Ui,mn as Wi,mt as Gi,n as Ki,nn as qi,nr as Ji,nt as Yi,o as Xi,on as Zi,or as Qi,ot as $i,p as ea,pn as ta,pt as na,q as ra,qn as ia,qt as aa,r as oa,rn as sa,rr as ca,rt as la,s as ua,sn as da,sr as fa,st as pa,t as ma,tn as ha,tr as ga,tt as _a,u as va,un as ya,ur as ba,ut as xa,v as Sa,vn as Ca,vr as wa,vt as Ta,w as Ea,wn as Da,wr as Oa,wt as ka,x as Aa,xn as ja,xr as Ma,xt as Na,y as Pa,yn as Fa,yr as Ia,yt as La,z as Ra,zn as za,zt as Ba}from"./elements-Coqr6-Yv.js";var Va={name:`circle-check-big`,size:24,node:[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-circle`]};Va.node;var Ha=Jt(Va),Ua={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};Ua.node;var Wa=Jt(Ua);function Ga(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}function Ka(e,t,n){return Ar(e.getProps(),t,n,e)}var qa=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Ja=e=>Array.isArray(e);function Ya(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,cn(n))}function Xa(e){return Ja(e)?e[e.length-1]||0:e}function Za(e,t){let{transitionEnd:n={},transition:r={},...i}=Ka(e,t)||{};i={...i,...n};for(let t in i)Ya(e,t,Xa(i[t]))}function Qa(e){return!!(en(e)&&e.add)}function $a(e,t){let n=e.getValue(`willChange`);if(Qa(n))return n.add(t);if(!n&&Zt.WillChange){let n=new Zt.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function eo(e){return e.props[Oa]}var to=typeof window<`u`;function no({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function ro(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?We(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState?.getState()[i],p=a?.path;p&&(p.animateValues?p.animateValues(t=>e.getValue(t,e.latestValues[t]??0),s,a,n,d):p.animateVisualElement?.(e,s,a,n,d));for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&no(f,t))continue;let o={delay:n,...Re(f?.out[t]||a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){V.update(()=>r.set(i));continue}let p=!1;if(to&&window.MotionHandoffAnimation){let n=eo(e);if(n){let e=window.MotionHandoffAnimation(n,t,V);e!==null&&(o.startTime=e,p=!0)}}$a(e,t);let m=l??e.shouldReduceMotion;r.run(me(t,r,i,m&&He.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>V.update(()=>{o&&Za(e,o)});d.length?Promise.all(d).then(t):t()}return d}function io(e,t,n={}){let r=Ka(e,t,qa(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?ro(e,r,n):[]),o=(r=0)=>{let{variantChildren:a}=e,{delayChildren:o=0,staggerChildren:s,staggerDirection:c}=i,l=[];return a?.forEach(e=>{e.notify(`AnimationStart`,t),l.push(io(e,t,{...n,delay:r+(typeof o==`function`?0:o)+Ga(a,e,o,s,c)}).then(()=>e.notify(`AnimationComplete`,t)))}),Promise.all(l)},{when:s}=i;return s?s===`beforeChildren`?a().then(()=>o()):o().then(a):Promise.all([a(),o(n.delay)])}function ao(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>io(e,t,n))):typeof t==`string`?io(e,t,n):Promise.all(ro(e,Ka(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var oo=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],so={value:null,addProjectionMetrics:null,countProjection:void 0};function co(e,t){let n=_n.now();e=p(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(B(r),e(a-t))};return V.setup(r,!0),ne(()=>B(r))}function lo(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function uo(e){return ve(e)&&e.tagName===`svg`}var fo=e=>typeof e==`number`?e:parseFloat(e),po=oo.length,mo=e=>typeof e==`number`||tn.test(e);function ho(e,t,n,r,i,a){i?(e.opacity=I(0,n.opacity??1,_o(r)),e.opacityExit=I(t.opacity??1,0,vo(r))):a&&(e.opacity=I(t.opacity??1,n.opacity??1,r));for(let i=0;i<po;i++){let a=oo[i],o=go(t,a),s=go(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||mo(o)===mo(s)?(e[a]=Math.max(I(fo(o),fo(s),r),0),(Rt.test(s)||Rt.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<N.length;i++){let a=N[i];(t[a]||n[a])&&(e[a]=I(t[a]||0,n[a]||0,r))}}function go(e,t){return e[t]===void 0?e.borderRadius:e[t]}var _o=yo(0,.5,Pe),vo=yo(.5,.95,Yt);function yo(e,t,n){return r=>r<e?0:r>t?1:n(Te(e,t,r))}var bo=(e,t,{x:n,y:r})=>{let i=e*e+t*t;return i<1?0:-1e3*(n*e+r*t)/i},xo=(e,t=300)=>{let n=yn(.25,2,t/300),{stiffness:r,damping:i}=qe({...e,duration:e.duration&&an(e.duration)});return{...e,stiffness:r,damping:i*Math.sqrt(n),mass:n}};function So(e,t){e.min=t.min,e.max=t.max}function W(e,t){So(e.x,t.x),So(e.y,t.y)}function Co(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var wo=.9999,To=1.0001,Eo=-.01,Do=.01;function G(e){return e.max-e.min}function Oo(e,t,n){return Math.abs(e-t)<=n}function ko(e,t,n,r=.5){e.origin=r,e.originPoint=I(t.min,t.max,e.origin),e.scale=G(n)/G(t),e.translate=I(n.min,n.max,e.origin)-e.originPoint,(e.scale>=wo&&e.scale<=To||isNaN(e.scale))&&(e.scale=1),(e.translate>=Eo&&e.translate<=Do||isNaN(e.translate))&&(e.translate=0)}function Ao(e,t,n,r){ko(e.x,t.x,n.x,r?.originX),ko(e.y,t.y,n.y,r?.originY)}function jo(e,t,n,r=0){e.min=(r?I(n.min,n.max,r):n.min)+t.min,e.max=e.min+G(t)}function Mo(e,t,n,r){jo(e.x,t.x,n.x,r?.x),jo(e.y,t.y,n.y,r?.y)}function No(e,t,n,r=0){let i=r?I(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+G(t)}function Po(e,t,n,r){No(e.x,t.x,n.x,r?.x),No(e.y,t.y,n.y,r?.y)}function Fo(e,t,n,r,i){return e-=t,e=g(e,1/n,r),i!==void 0&&(e=g(e,1/i,r)),e}function Io(e,t=0,n=1,r=.5,i,a=e,o=e){if(Rt.test(t)&&(t=parseFloat(t),t=I(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=I(a.min,a.max,r);e===a&&(s-=t),e.min=Fo(e.min,t,n,s,i),e.max=Fo(e.max,t,n,s,i)}function Lo(e,t,[n,r,i],a,o){Io(e,t[n],t[r],t[i],t.scale,a,o)}var Ro=[`x`,`scaleX`,`originX`],zo=[`y`,`scaleY`,`originY`];function Bo(e,t,n,r){Lo(e.x,t,Ro,n?.x,r?.x),Lo(e.y,t,zo,n?.y,r?.y)}var Vo=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ho=Vo(`applewebkit/`)&&!Vo(`chrome/`)?Math.round:Yt;function Uo(e){e.min=Ho(e.min),e.max=Ho(e.max)}function Wo(e){Uo(e.x),Uo(e.y)}function Go(e){return e.translate===0&&e.scale===1}function Ko(e){return Go(e.x)&&Go(e.y)}function qo(e,t){return e.min===t.min&&e.max===t.max}function Jo(e,t){return qo(e.x,t.x)&&qo(e.y,t.y)}function Yo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Xo(e,t){return Yo(e.x,t.x)&&Yo(e.y,t.y)}function Zo(e){return G(e.x)/G(e.y)}function Qo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var $o=class{constructor(){this.members=[]}add(e){qt(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;r&&r.isConnected!==!1||n.snapshot||(vn(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(vn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};function es(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var ts={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(tn.test(e))e=parseFloat(e);else return e}return`${es(e,t.target.x)}% ${es(e,t.target.y)}%`}},ns={borderRadius:Object.assign({},ts,{applyTo:oo.slice()}),borderTopLeftRadius:ts,borderTopRightRadius:ts,borderBottomLeftRadius:ts,borderBottomRightRadius:ts,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ut.parse(e);if(i.length>5)return r;let a=Ut.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=I(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}};function rs(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;(i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `);let s=``;if(n){let{transformPerspective:e}=n;e&&(r=`perspective(${e}px) ${r}`);for(let e=0;e<N.length;e++){let t=N[e],r=n[t];r&&(s+=`${t}(${r}deg) `),!e&&n.pathRotation&&(s+=`rotate(${n.pathRotation}deg) `)}}if(s){(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),r+=s;let n=e.x.scale*t.x,i=e.y.scale*t.y;(n!==1||i!==1)&&(r+=`scale(${n}, ${i})`)}else e.x.scale!==1||e.y.scale!==1?r+=`scale(${e.x.scale}, ${e.y.scale})`:r||t.x===1&&t.y===1||(r=`scale(1, 1)`);return r||`none`}function K(e){return[e(`x`),e(`y`)]}var is=(e,t)=>e.depth-t.depth,as=class{constructor(){this.children=[],this.isDirty=!1}add(e){qt(this.children,e),this.isDirty=!0}remove(e){vn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(is),this.isDirty=!1,this.children.forEach(e)}},os={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ss=[`z`,`skew`,`skewZ`],cs=1e3,ls=0;function us(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var ds=e=>e.instance&&rn.get(e.instance)?.demote()&&e.resetSkewAndRotation();function fs(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=eo(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,V,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&fs(r)}function ps(e){if(e)return e.options.allowProjection===!1?ps(e.parent):e.projection}function ms({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(jn,{...ns,...jn}),class{static create(e,t,n){let{layoutId:r,layout:i,drag:a,dragConstraints:o,layoutScroll:s,layoutRoot:c,layoutAnchor:l,layoutCrossfade:u}=t,d=e.projection=new this(e.latestValues,t[`data-framer-portal-id`]?void 0:ps(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&lo(o),visualElement:e,animationType:typeof i==`string`?i:`both`,initialPromotionConfig:n,crossfade:u,layoutScroll:s,layoutRoot:c,layoutAnchor:l});let f=d.getStack()?.lead;f&&!d.root.isUpdateBlocked()&&(f.willUpdate(),f.scheduleCheckAfterUnmount())}constructor(e={},n=t?.()){this.id=ls++,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.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(_s),this.nodes.forEach(Os),this.nodes.forEach(ks),this.nodes.forEach(vs),so.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new as)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new nn),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){this.eventHandlers.get(e)?.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=ve(t)&&!uo(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;V.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n?.(),n=co(i,250),os.hasAnimatedSinceResize&&(os.hasAnimatedSinceResize=!1,this.nodes.forEach(Ds)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){let{layoutId:e,layout:t,visualElement:n,animate:r}=this.options;this.instance&&!this.hasLayoutListener&&r!==!1&&n&&(e||t)&&(this.hasLayoutListener=!0,this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:r,layout:i})=>{if(this.isAnimationBlocked){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||n.getDefaultTransition()||Is,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!Xo(this.targetLayout,i),l=!t&&r;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Re(a,`layout`),onPlay:o,onComplete:s};(n.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Ds(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=i}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,B(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(As),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete?.();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&fs(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;ds(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,ds(t),(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1),t.isAnimationBlocked&&(t.dragSnapshot||=t.measure(),this.dragAncestor=t)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(xs),this.nodes.forEach(bs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ss);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ws),this.nodes.forEach(Ts),this.nodes.forEach(Es),this.nodes.forEach(hs),this.nodes.forEach(gs)):this.nodes.forEach(Ss),this.clearAllSnapshots();let e=_n.now();H.delta=yn(0,1e3/60,e-H.timestamp),H.timestamp=e,H.isProcessing=!0,Vt.update.process(H),Vt.preRender.process(H),Vt.render.process(H),H.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ys),this.sharedNodes.forEach((e,t)=>e.members.length?e.removeLeadSnapshot():this.sharedNodes.delete(t))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,V.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){V.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(!this.snapshot&&this.instance&&(this.snapshot=this.measure(),this.snapshot&&!G(this.snapshot.measuredBox.x)&&!G(this.snapshot.measuredBox.y)&&(this.snapshot=void 0),this.snapshot)){let{visualElement:e}=this.options,t=this.currentAnimation?.state===`running`,n=t&&this.animationEdges;t&&this.relativeTarget&&(this.snapshot.relativeVelocity=this.relativeVelocity?.slice()||[]);let r=n&&this.motionValue?.getVelocity()||0,i=[0,1,2,3,4,5].map(t=>(t<4?n&&(this.edgeValues?this.edgeVelocity(t):-n[t]*r/1e3):e?.getValue(t<5?`x`:`y`)?.getVelocity())||0);i.some(Boolean)&&(this.snapshot.velocity=i)}}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected||=U(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t?.notify(`LayoutMeasure`,this.layout.layoutBox,e?.layoutBox)}updateScroll(e=`measure`){let{scroll:t,instance:i}=this,{animationId:a}=this.root;if(this.options.layoutScroll&&i&&!(t&&t.animationId===a&&t.phase===e)){let o=r(i);this.scroll={animationId:a,phase:e,isRoot:o,offset:n(i),wasRoot:t?t.isRoot:o}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;e&&ds(this);let t=this.projectionDelta&&!Ko(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Be(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Wo(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return U();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(zs))){let{scroll:e}=this.root;e&&(C(t.x,e.offset.x),C(t.y,e.offset.y))}return t}removeElementScroll(e){let t=U();if(W(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&W(t,e),C(t.x,i.offset.x),C(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n,r,i=0){let a=n||U();W(a,e);for(let e=i;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(C(a.x,-n.scroll.offset.x),C(a.y,-n.scroll.offset.y)),Be(n.latestValues)&&oe(a,n.latestValues,n.layout?.layoutBox)}return!r&&Be(this.latestValues)&&oe(a,this.latestValues,this.layout?.layoutBox),a}removeTransform(e){let t=U();W(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Be(n.latestValues))continue;let r;n.instance&&(D(n.latestValues)&&n.updateSnapshot(),r=U(),W(r,n.measurePageBox())),Bo(t,n.latestValues,n.snapshot?.layoutBox,r)}return Be(this.latestValues)&&Bo(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==H.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=H.timestamp;let a=this.getClosestProjectingParent();!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),(this.relativeTarget||this.targetDelta)&&(this.target||(this.target=U(),this.targetWithTransforms=U()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Mo(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):W(this.target,this.layout.layoutBox),M(this.target,this.targetDelta)):W(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&(!a.resumingFrom==!this.resumingFrom||a.options.layoutRoot&&!a.resumingFrom)&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),so.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||D(this.parent.latestValues)||se(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=U(),this.relativeTargetOrigin=U(),Po(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),W(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===H.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;W(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;$e(this.layoutCorrected,this.treeScale,this.path,t&&(e.relativeTarget&&!e.relativeParent.resumingFrom?e.relativeParent:!0)),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=U());let{target:s}=e;s?(!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Co(this.prevProjectionDelta.x,this.projectionDelta.x),Co(this.prevProjectionDelta.y,this.projectionDelta.y)),Ao(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&Qo(this.projectionDelta.x,this.prevProjectionDelta.x)&&Qo(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),so.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){this.options.visualElement?.scheduleRender(),e&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ma(),this.projectionDelta=Ma(),this.projectionDeltaWithTransform=Ma()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Ma();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=U(),c=r?.source!==this.layout?.source,l=this.getStack(),u=!l||l.members.length<=1,d=!(!c||u||this.options.crossfade!==!0||this.path.some(Fs));this.animationProgress=0;let f,p=n?.interpolateProjection(e),m=this.layout?.layoutBox,h=m&&[m.x.min,m.x.max,m.y.min,m.y.max].map((t,n)=>{let{translate:r,scale:i,originPoint:a}=e[n<2?`x`:`y`];return(t-a)*(i-1)+r});h?.every(isFinite)||(h=void 0),this.animationEdges=h,this.edgeValues=this.startVelocity=this.impulse=this.relativeVelocity=this.relativeStart=void 0;let g=r?.velocity,_=r?.relativeVelocity||g;if(_?.slice(0,4).some(Boolean)&&this.getClosestProjectingParent()&&(this.relativeStart=_),g&&h){let t=g.slice(0,4).map((e,t)=>e+(c?g[4+(t>>1)]:0));t.some(Boolean)&&(this.startVelocity=p?bo(e.x.translate,e.y.translate,{x:(t[0]+t[1])/2,y:(t[2]+t[3])/2}):t)}this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n),l=this.edgeValues;for(let t=0;t<2;t++){let r=t?`y`:`x`;l?js(o[r],e[r],this.layout.layoutBox[r],l[t*2],l[t*2+1]):Ms(o[r],e[r],n)}if(r&&(o.x.translate=r.x,o.y.translate=r.y),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){Po(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);let e=this.relativeTargetOrigin,t=s;if(Ps(this.relativeTarget,e,t,n),this.isSpringLayout){let e=this.relativeTarget,t=this.impulse||0,n=this.relativeStart,r=_n.now(),i=(r-this.relativeTime)/1e3;this.relativeTime=r;let a=this.relativeVelocity||=[0,0,0,0];for(let r=0;r<4;r++){let o=r<2?`x`:`y`,s=r&1?`max`:`min`;n&&(e[o][s]+=n[r]*t),f&&i>0&&(a[r]=(e[o][s]-f[o][s])/i)}}f&&Jo(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=U(),W(f,this.relativeTarget)}c&&(this.animationValues=a,ho(a,i,this.latestValues,n,d,u)),r?.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`);let t=this.isSpringLayout=e.type===`spring`;this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.resumingFrom&&(this.resumingFrom.edgeValues=void 0),this.pendingAnimation&&=(B(this.pendingAnimation),void 0),this.pendingAnimation=V.update(()=>{os.hasAnimatedSinceResize=!0,this.motionValue||=cn(0),this.motionValue.jump(0,!1);let n=this.startVelocity;this.startVelocity=void 0;let r=e,i=0;if(t){if(e.mass===`auto`){let t=this.layout?.layoutBox;r=xo(e,t&&Math.sqrt(G(t.x)*G(t.y)))}let t=this.relativeStart;if((n||t)&&!e.repeat){if(typeof n==`number`)i=n;else{let e=n&&this.animationEdges;r={...r,type:r=>{let i=[r.velocity,...n||[]].map((t,n)=>_e({...r,keyframes:n?[e[n-1],0]:r.keyframes,velocity:t})),a=i.length;t&&i.push(_e({...r,keyframes:[0,0],velocity:1e3,restDelta:.5,restSpeed:5}));let o=0,s=[],c={calculatedDuration:null,next:t=>{o=t;let n=i[0].next(t),r=n.done;for(let e=1;e<i.length;e++){let{value:n,done:o}=i[e].next(t);e<a?s[e-1]=n:this.impulse=n/1e3,r&&=o}return e&&(this.edgeValues=s),n.done=r,n}};return c.calculatedDuration=be(c),c.next(0),this.edgeVelocity=e=>i[e+1].velocity(o),c}}}}}let a=ee(this.motionValue,[0,1e3],{...r,velocity:i,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}});this.currentAnimation=a,zt(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=this.edgeValues=this.edgeVelocity=this.impulse=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.edgeValues=this.impulse=void 0,this.mixTargetDelta?.(cs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,layout:n,latestValues:r}=e,{target:i}=e;if(t&&i&&n){if(this!==e&&this.layout&&n&&Rs(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||U(),Ls(i.x,t.x,e.x),Ls(i.y,t.y,e.y)}W(t,i),oe(t,r),Ao(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new $o),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let{latestValues:t}=e;if(!S(t))return;let n={};for(let t=0;t<ss.length;t++)us(ss[t],e,n,this.animationValues);for(let t=0;t<N.length;t++)us(N[t],e,n,this.animationValues);e.render();for(let t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;let n=this.getLead();if(!this.isVisible&&n!==this){e.visibility=`hidden`;return}let r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Er(t?.pointerEvents)||``,e.transform=r?r(this.latestValues,``):`none`;return}if(!this.projectionDelta||!this.layout||!n.target){(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,e.visibility=``,e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Er(t?.pointerEvents)||``),this.hasProjected&&!Be(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=rs(this.projectionDeltaWithTransform,this.treeScale,i);r&&(a=r(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=n.animationValues?n===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in jn){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=jn[t],c=a===`none`?i[t]:r(i[t],n);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=n===this?Er(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(bs),this.root.sharedNodes.clear()}}}function hs(e){e.updateLayout(),Cs(e)}function gs(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source,o=(r,a)=>{if(i===`size`)K(e=>{let t=G(r[e]);r[e].min=a[e].min,r[e].max=r[e].min+t});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;So(r[e],a[e])}else Rs(i,t.layoutBox,n)&&K(t=>{let n=G(a[t]);r[t].max=r[t].min+n,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[t].max=e.relativeTarget[t].min+n)})},s=a?t.measuredBox:t.layoutBox;o(s,n);let c=Ma();Ao(c,n,t.layoutBox);let l=Ma();Ao(l,a?e.applyTransform(r,!0):n,s);let u=!Ko(c),d=!1,f=e.getClosestProjectingParent();if((!a||f?.options.layoutRoot&&e.resumeFrom?.path.includes(f))&&f&&!f.resumeFrom){let{snapshot:r,layout:i}=f;if(r&&i){let s=e.options.layoutAnchor||void 0,c=U();Po(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=U();Po(l,n,i.layoutBox,s),a&&o(c,l),Xo(c,l)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=l,e.relativeTargetOrigin=c,e.relativeParent=f)}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else e.isLead()&&e.options.onExitComplete?.();e.options.transition=void 0}function _s(e){so.countProjection?.(0),e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function vs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ys(e){e.clearSnapshot()}function bs(e){e.clearMeasurements()}function xs(e){e.isLayoutDirty=!0,e.updateLayout()}function Ss(e){e.isLayoutDirty=!1}function Cs(e){let{snapshot:t,dragAncestor:n}=e,r=n?.isAnimationBlocked&&n.layout;if(!t||!r||e.resumeFrom||e.isAnimationBlocked)return;let i=n.dragSnapshot;K(e=>C(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function ws(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Ts(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Es(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Ds(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Os(e){e.resolveTargetDelta()}function ks(e){e.calcProjection()}function As(e){e.resetSkewAndRotation()}function js(e,t,n,r,i){let a=n.max-n.min,o=a?Math.max(0,(a+i-r)/a):1,s=e.originPoint=t.originPoint;e.origin=t.origin,e.scale=o,e.translate=n.min+r-(s+(n.min-s)*o)}function Ms(e,t,n){e.translate=I(t.translate,0,n),e.scale=I(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Ns(e,t,n,r){e.min=I(t.min,n.min,r),e.max=I(t.max,n.max,r)}function Ps(e,t,n,r){Ns(e.x,t.x,n.x,r),Ns(e.y,t.y,n.y,r)}function Fs(e){return e.animationValues?.opacityExit!==void 0}var Is={duration:.45,ease:[.4,0,.1,1]};function Ls(e,t,n){e.max=G(n)+(e.min=t.min)}function Rs(e,t,n){return e===`position`||e===`preserve-aspect`&&!Oo(Zo(t),Zo(n),.2)}function zs(e){return e!==e.root&&e.scroll?.wasRoot}function Bs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Vs=ms({attachResizeListener:(e,t)=>Bs(e,`resize`,t),measureScroll:b,checkIsScrollRoot:()=>!0}),Hs=ms({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ia.current){let e=new Vs({});e.mount(window),e.setOptions({layoutScroll:!0}),Ia.current=e}return Ia.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Us=class extends bi{constructor(){super(...arguments),this.KeyframeResolver=Fe}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;en(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ws(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Gs(e){return window.getComputedStyle(e)}var Ks=class extends Us{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ws}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Wt.has(t))return this.projection?.isProjecting?Gt(t):Kt(e,t);{let n=Gs(e),r=(mn(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return O(e,t)}build(e,t,n){gn(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return pi(e,t,n)}},qs=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Js(e){return{point:{x:e.pageX,y:e.pageY}}}var Ys=e=>t=>qs(t)&&e(t,Js(t));function Xs(e,t,n,r){return Bs(e,t,Ys(n),r)}var Zs=new WeakMap,Qs,$s=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:ve(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ec=$s(`inline`,`width`,`offsetWidth`),tc=$s(`block`,`height`,`offsetHeight`);function nc({target:e,borderBoxSize:t}){Zs.get(e)?.forEach(n=>{n(e,{get width(){return ec(e,t)},get height(){return tc(e,t)}})})}function rc(e){e.forEach(nc)}function ic(){typeof ResizeObserver<`u`&&(Qs=new ResizeObserver(rc))}function ac(e,t){Qs||ic();let n=fe(e);return n.forEach(e=>{let n=Zs.get(e);n||(n=new Set,Zs.set(e,n)),n.add(t),Qs?.observe(e)}),()=>{n.forEach(e=>{let n=Zs.get(e);n?.delete(t),n?.size||Qs?.unobserve(e)})}}var oc=new Set,sc;function cc(){sc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};oc.forEach(t=>t(e))},window.addEventListener(`resize`,sc)}function lc(e){return oc.add(e),sc||cc(),()=>{oc.delete(e),!oc.size&&typeof sc==`function`&&(window.removeEventListener(`resize`,sc),sc=void 0)}}function uc(e,t){return ne(typeof e==`function`?lc(e):ac(e,t))}var dc=(e,t)=>Math.abs(e-t);function fc(e,t){let n=dc(e.x,t.x),r=dc(e.y,t.y);return Math.sqrt(n**2+r**2)}var pc=new Set([`auto`,`scroll`]),mc=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o,immediate:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=gc(this.lastRawMoveEventInfo,this.transformPagePoint));let e=vc(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=fc(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:_n.now()});let{onStart:i,onMove:a}=this.handlers;t||(i?.(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a?.(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.handleScroll(window),this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=gc(t,this.transformPagePoint),this.hasPendingMove=!0,V.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i?.(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=vc(e.type===`pointercancel`?this.lastMoveEventInfo:gc(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!qs(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=s?0:a,this.contextWindow=r||window;let c=Js(e),l=gc(c,this.transformPagePoint),{point:u}=l;this.history=[{...u,timestamp:_n.now()}];let{onSessionStart:d}=t;d&&d(e,vc(l,this.history));let f={passive:!0,capture:!0};this.removeListeners=Se(Xs(this.contextWindow,`pointermove`,this.handlePointerMove,f),Xs(this.contextWindow,`pointerup`,this.handlePointerUp,f),Xs(this.contextWindow,`pointercancel`,this.handlePointerUp,f)),o&&this.startScrollTracking(o),s&&(this.handlePointerMove(e,c),this.updatePoint())}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(pc.has(e.overflowX)||pc.has(e.overflowY))&&this.scrollPositions.set(t,hc(t)),t=t.parentElement}this.scrollPositions.set(window,hc(window)),this.removeScrollListeners=Se(Bs(window,`scroll`,this.onElementScroll,{capture:!0}),Bs(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=hc(e),i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),V.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),B(this.updatePoint)}},hc=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function gc(e,t){return t?{point:t(e.point)}:e}function _c(e,t){return{x:e.x-t.x,y:e.y-t.y}}function vc({point:e},t){return{point:e,delta:_c(e,bc(t)),offset:_c(e,yc(t)),velocity:xc(t,.1)}}function yc(e){return e[0]}function bc(e){return e[e.length-1]}function xc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=bc(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>an(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>an(t)*2&&(r=e[1]);let a=ln(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Sc=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Cc(e){return Sc.has(e.tagName)||e.isContentEditable===!0}var wc=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Tc(e){return wc.has(e.tagName)||e.isContentEditable===!0}var q={x:!1,y:!1};function Ec(){return q.x||q.y}function Dc(e){return e===`x`||e===`y`?q[e]?null:(q[e]=!0,()=>{q[e]=!1}):q.x||q.y?null:(q.x=q.y=!0,()=>{q.x=q.y=!1})}function Oc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?I(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?I(n,e,r.max):Math.min(e,n)),e}function kc(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Ac(e,{top:t,left:n,bottom:r,right:i}){return{x:kc(e.x,n,i),y:kc(e.y,t,r)}}function jc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Mc(e,t){return{x:jc(e.x,t.x),y:jc(e.y,t.y)}}function Nc(e,t){let n=.5,r=G(e),i=G(t);return i>r?n=Te(t.min,t.max-r,e.min):r>i&&(n=Te(e.min,e.max-i,t.min)),yn(0,1,n)}function Pc(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Fc=.35;function Ic(e=Fc){return e===!1?e=0:e===!0&&(e=Fc),{x:Lc(e,`left`,`right`),y:Lc(e,`top`,`bottom`)}}function Lc(e,t,n){return{min:Rc(e,t),max:Rc(e,n)}}function Rc(e,t){return typeof e==`number`?e:e[t]||0}function zc(e){let t=``;for(let n of e.path){n.scroll=void 0,n.updateScroll();let{scroll:r}=n;n!==e.root&&r&&(t+=r.offset.x+`,`+r.offset.y+`,`)}return t}var Bc=new WeakMap,Vc=class{constructor(e,t=()=>e.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=U(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e,this.readProps=t}start(e,t={}){if(this.visualElement.presenceContext?.isPresent===!1)return;let n=e=>{t.snapToCursor&&this.snapToCursor(e),this.stopAnimation()},r=(e,t)=>{let{drag:n,dragConstraints:r,dragPropagation:i,onDragStart:a}=this.getProps();if(n&&!i&&(this.openDragLock?.(),this.openDragLock=Dc(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();let{projection:o}=this.visualElement;o&&(o.isAnimationBlocked=!0,o.target=void 0),K(e=>{let t=this.getAxisMotionValue(e).get()||0;if($t(t)&&(t=De(t,this.visualElement.current)||0),tn.test(t))t=parseFloat(t);else if(Rt.test(t)){let n=o?.layout?.layoutBox[e];n&&(t=G(n)*(parseFloat(t)/100))}this.originPoint[e]=t}),this.point=typeof r==`function`&&r(this),a&&V.update(()=>a(e,t),!1,!0),$a(this.visualElement,`transform`),this.visualElement.animationState?.setActive(`whileDrag`,!0)},i=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){if(this.currentDirection=qc(o),this.currentDirection===null)return;i&&i(this.currentDirection)}this.updateAxis(`x`,o),this.updateAxis(`y`,o),this.point&&this.point.move(),this.visualElement.render(),a&&V.update(()=>a(e,t),!1,!0)},a=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},o=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints||this.point)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:s}=this.getProps();this.panSession=new mc(e,{onSessionStart:n,onStart:r,onMove:i,onSessionEnd:a,resumeAnimation:o},{...t,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(e,t,n){let r=e||this.latestPointerEvent,i=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;let{velocity:o}=i;this.startAnimation(o,n);let{onDragEnd:s}=this.getProps();s&&V.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t?.setActive(`whileDrag`,!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(e,t){let{drag:n}=this.readProps();if(!t||!Kc(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Oc(i,a,this.elastic[e])),this.point?this.point[e]=i:r.set(i)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),{projection:n}=this.visualElement,r=n&&(n.layout||n.measure(!1)),i=this.constraints;Hc(e)?this.constraints&&this.scroll===zc(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?Ac(r.layoutBox,e):!1,this.elastic=Ic(t),i!==this.constraints&&!Hc(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&K(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Pc(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!Hc(e))return!1;let n=Uc(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=zc(r);let i=w(n,r.root,this.visualElement.getTransformPagePoint()),a=Mc(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(de(a));this.hasMutatedConstraints=!!e,e&&(a=T(e))}return a}startAnimation(e,t){let{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c={bounceStiffness:i?200:1e6,bounceDamping:i?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...a},l=i=>r&&!(this.point&&o)&&Kc(i,t||n,this.currentDirection)?e[i]:0;if(this.point&&!o)return this.point.release({x:l(`x`),y:l(`y`)},c).then(s);let u=this.constraints||{},d=K(e=>{if(!Kc(e,t||n,this.currentDirection))return;let r=u[e]||{};(o===!0||o===e)&&(r={min:0,max:0});let i={type:`inertia`,velocity:l(e),...c,...r};return this.startAxisValueAnimation(e,i)});return Promise.all(d).then(s)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return $a(this.visualElement,e),n.start(me(e,n,0,t,this.visualElement,!1))}stopAnimation(){K(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.readProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();K(e=>{if(!Kc(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-I(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Hc(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};K(e=>{let t=this.getAxisMotionValue(e).get();i[e]=Nc({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),K(t=>{let n=this.getAxisMotionValue(t);if(!Kc(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(I(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Bc.set(this.visualElement,this);let e=this.visualElement.current,t=Xs(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Tc(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=Hc(t)&&Uc(t);r&&(this.constraints=this.resolveRefConstraints(),n||=Gc(e,r,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i.layout||(i.root?.updateScroll(),i.updateLayout()),V.read(r);let o=Bs(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(K(t=>{if(!Kc(t,this.getProps().drag,this.currentDirection))return;let n=this.getAxisMotionValue(t);this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate)}),this.visualElement.render())}));return()=>{o(),t(),a(),s(),n?.()}}getProps(){let e=this.readProps(),{dragElastic:t=Fc,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function Hc(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Uc=e=>`current`in e?e.current:e;function Wc(e){let t=!0;return()=>{t?t=!1:e()}}function Gc(e,t,n){let r=uc(e,Wc(n)),i=uc(t,Wc(n));return()=>{r(),i()}}function Kc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qc(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Jc(e,t){let n=fe(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},ne(()=>r.abort())]}function Yc(e){return!(e.pointerType===`touch`||Ec())}function Xc(e,t,n={}){t=p(t);let[r,i,a]=Jc(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{e.pointerType!==`touch`&&(n?r=!0:s(e))};e.addEventListener(`pointerenter`,n=>{if(!Yc(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Zc=(e,t)=>t?e===t||Zc(e,t.parentElement):!1,Qc=new WeakSet;function $c(e){return t=>{t.key===`Enter`&&e(t)}}function el(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var tl=(e,t)=>{let n=!1,r=$c(()=>{n||Qc.has(e)||(n=!0,el(e,`down`))}),i=$c(()=>{n&&(n=!1,el(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&el(e,`cancel`)},{...t,once:!0})};function nl(e){return qs(e)&&!Ec()}var rl=new WeakSet,il=100,al=8,ol=(e,t,n)=>Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)>n,sl=e=>e.preventDefault();function cl(e,t,n={}){t=p(t);let[r,i,a]=Jc(e,n),o=new WeakMap,s=e=>{let r=e.currentTarget;if(!nl(e)||rl.has(e))return;n.stopPropagation&&rl.add(e);let{count:a=1,countTimeout:s=.3,hold:c=0,repeat:l}=n,u=_n.now(),d=an(c),f=an(s),p=o.get(r);p?.expire(ol(p.event,e,il))?p=void 0:p&&(B(p.expire),o.delete(r));let m=p?p.count+1:1,h=m>=a,g=h&&(c||l),_=!c,v=0,y;if(Qc.add(r),p)y=p.handlers;else{let n=t(r,e);y=typeof n==`function`?{onComplete:n}:n||{}}h&&_&&y.onActive?.();let b=an(l),x=d||b,S=u+x,C=!0,w=()=>{if(i.signal.aborted)return B(w);let e=Math.min(1-(S-_n.now())/x,1);C&&e<1&&(e=0),C=!1,y.onHold?.(e),e<1||(_?y.onRepeat?.(++v):(_=!0,y.onActive?.()),l?(C=!0,S+=x=b):B(w))},T={...i,capture:!0},E=(t,n)=>{if(qs(t)){if(window.removeEventListener(`pointerup`,D,T),window.removeEventListener(`pointercancel`,O,T),window.removeEventListener(`pointermove`,k,T),r.removeEventListener(`contextmenu`,sl),B(w),Qc.delete(r),Ec()&&(n=!1),n&&!h){let n=_n.now(),a=e=>{let s=i.signal.aborted;if(s||e===!0||_n.now()-n>f)return B(a),o.delete(r),s||y.onComplete?.(t,{success:!1}),!0};o.set(r,{count:m,event:e,handlers:y,expire:a}),V.update(a,!0)}else y.onComplete?.(t,{success:n&&_})}},D=e=>{E(e,r===window||r===document||n.useGlobalTarget||Zc(r,e.target))},O=e=>{E(e,!1)},k=t=>{qs(t)&&((l||!_)&&ol(e,t,al)||a>1&&Ec())&&O(t)};window.addEventListener(`pointerup`,D,T),window.addEventListener(`pointercancel`,O,T),(g||a>1)&&window.addEventListener(`pointermove`,k,T),g&&(V.update(w,!0),r.addEventListener(`contextmenu`,sl,{...i,passive:!1}))};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,s,i),Ge(e)&&(e.addEventListener(`focus`,()=>tl(e,i),i),!Cc(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function ll(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=je(i,a,o);return t?s(r):s}var ul=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},dl=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`]);function fl(e,t,n,r){Ws(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(dl.has(n)?n:le(n),t.attrs[n])}var pl=class extends Us{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=U}getBaseTargetFromProps(e,t){return Wt.has(t)?super.getBaseTargetFromProps(e,t)??Gt(t):e[t]}getDefaultValue(e){return Wt.has(e)?this.latestValues[e]??Gt(e):void 0}readValueFromInstance(e,t){if(Wt.has(t)){let e=Ht(t);return e&&e.default||0}if(sn.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=dl.has(t)?t:le(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Vi(e,t,n)}build(e,t,n){Qt(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){fl(e,t,n,r)}mount(e){this.isSVGTag=ba(e.tagName),super.mount(e)}};function ml(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var hl=[...wi].reverse(),gl=e=>e?.out===!0?e:e?.out;function _l(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>ao(e,t,n))),n=yl(),r=!0,i=!1;function a(a){let{props:o,parent:s,manuallyAnimateOnMount:c}=e,{initial:l}=o,u=r||i,d=[],f=(t=l)=>typeof t!=`boolean`&&Ka(e,Array.isArray(t)?t[0]:t,e.presenceContext?.custom)||void 0,p=new Map,m={},h=1/0,g=e;do g=g.props.inherit!==!1&&g.parent;while(g&&!g.isControllingVariants);let _=u&&gl(f(l??(g&&g.props.initial))?.transition);if(hl.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?Qr(f)||f===!1?f:void 0:l,y=Qr(v),b=t===a?i.isActive:null,x=y&&l===void 0&&!(u&&c);if(i.protectedKeys={...m},!i.isActive&&b===null||!v&&!i.prevProp||wa(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=vl(i.prevProp,v),C=S||y&&(b&&!x||r>h),w=!1,T=Array.isArray(v)?v:[v],E={},D;if(b!==!1)for(let n of T){let{transition:r,transitionEnd:i,...a}=Ka(e,n,qa(e,t))||{};E={...E,...a,...i},D=gl(r)||D}let{prevResolvedValues:O}=i;for(let t in{...O,...E}){if(t in m)continue;let n=E[t],r=O[t],a=Array.isArray(n)&&Array.isArray(r)?!ml(n,r)||S:n!==r,o;if(a&&n==null)p.has(t)||p.set(t,i.prevOut);else if(a||n!==void 0&&p.has(t)){C=!0,o=p.get(t)||_,p.delete(t)&&(w=!0),i.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)}else i.protectedKeys[t]=!0;i.out[t]=o}if(i.prevProp=v,i.prevResolvedValues=E,i.prevOut=D,i.isActive&&(m={...m,...E}),C&&(!(x&&S)||w))for(let n of T){let r={type:t};if(typeof n==`string`&&u&&c&&s?.enteringChildren){let t=Ka(s,n)?.transition?.delayChildren;r.delay=Ga(s.enteringChildren,e,t)}d.push({animation:n,options:r})}}),p.size){let t={},n=f(),r=n?.transition;p.forEach((i,a)=>{i&&(r={...r||e.getDefaultTransition(),[a]:i});let s=e.getValue(a);s&&(s.liveStyle=!0);let c=n&&!Array.isArray(l)?n[a]:void 0,u=e.getBaseTargetFromProps(o,a);t[a]=(c===void 0?u!==void 0&&!en(u)?u:e.initialValues[a]===void 0?e.baseTarget[a]:void 0:c)??null}),r&&(t.transition=r),d.push({animation:t})}let v=u&&e.blockInitialAnimation||r&&!c&&(o.initial===!1||o.initial===o.animate);return r=i=!1,!v&&d.length?t(d):Promise.resolve()}function o(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=a(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:a,setActive:o,setAnimateFunction:n=>{t=n(e)},getState:()=>n,reset:()=>{n=yl(),i=!0}}}function vl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!ml(t,e):!1}function yl(){let e={};for(let t of wi)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var J=Lt(),Y=t(It(),1);function bl({children:e,features:t,strict:n=!1}){let[,r]=(0,Y.useState)(!xl(t)),i=(0,Y.useRef)(void 0);if(!xl(t)){let{renderer:e,...n}=t;i.current=e,fa(n)}return(0,Y.useEffect)(()=>{xl(t)&&t().then(({renderer:e,...t})=>{fa(t),i.current=e,r(!0)})},[]),(0,J.jsx)(li.Provider,{value:{renderer:i.current,strict:n},children:e})}function xl(e){return typeof e==`function`}function Sl(e,t){if(typeof Proxy>`u`)return ji;let n=new Map,r=(n,r)=>ji(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,ji(a,void 0,e,t)),n.get(a))})}var Cl=Sl(),wl=(e,t)=>t.isSVG??Qi(e)?new pl(t):new Ks(t,{allowProjection:e!==Y.Fragment}),Tl=class extends ul{constructor(e){super(e),e.animationState||=_l(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();wa(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},El=0,Dl={animation:{Feature:Tl},exit:{Feature:class extends ul{constructor(){super(...arguments),this.id=El++}update(){let{presenceContext:e,animationState:t}=this.node;if(!e||!t)return;let{isPresent:n,onExitComplete:r}=e;if(n===!this.exit)return;if(n){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=Ka(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,t.reset(),t.animateChanges()}else t.setActive(`exit`,!1);this.exit=void 0;return}let i=this.exit=t.setActive(`exit`,!0);r&&i.then(()=>{this.exit===i&&(this.exit=!0,r(this.id))})}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id,this.node)),this.update()}unmount(){}}}},Ol=class extends ul{constructor(e){super(e),this.removeGroupControls=Yt,this.removeListeners=Yt,this.controls=new Vc(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Yt}update(){let{dragControls:e,drag:t}=this.node.getProps(),{dragControls:n,drag:r}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls))),r&&!t&&this.controls.stop(void 0,void 0,r)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},kl=e=>(t,n)=>{e&&V.update(()=>e(t,n),!1,!0)},Al=class extends ul{constructor(){super(...arguments),this.removePointerDownListener=Yt}onPointerDown(e){this.session=new mc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:kl(e),onStart:kl(t),onMove:kl(n),onEnd:(e,t)=>{delete this.session,r&&V.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Xs(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},jl=!1,Ml=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),Nl=(e,t)=>{let{snapshot:n}=e,r=e.getStack();r?.remove(e);let i=r?.lead;if(r?.prevLead===e&&i.resumeFrom===e&&(i.resumeFrom=i.currentAnimation=e.resumingFrom=void 0),e.options.layoutId=t,!t)e.needsShow=!0;else return e.root.registerSharedNode(t,e),()=>{let{resumeFrom:t}=e;t?.isPresent!==!1&&e.getStack().members.includes(t)&&(t.hide(),e.resumeFrom=void 0,e.snapshot=n)}},Pl=class extends Y.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group?.add(i),r&&n?.register?.(i),jl&&i.root.didUpdate(),i.options.layoutId!==r&&Nl(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Ml(this.props),onExitComplete:()=>this.safeToRemove()})),os.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,layoutId:n,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,this.takeOver=e.layoutId===n?void 0:(o.willUpdate(),Nl(o,n)),o.setOptions({...o.options,...Ml(this.props)}),jl=!0,i||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||V.postRender(()=>{o.getStack()?.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(this.takeOver?.(),e.root.didUpdate(),pn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;jl=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Fl(e){let[t,n]=ae(),r=(0,Y.useContext)(Xt);return(0,J.jsx)(Pl,{...e,layoutGroup:r,switchLayoutGroup:(0,Y.useContext)(ni),isPresent:t,safeToRemove:n})}var Il={pan:{Feature:Al},drag:{Feature:Ol,ProjectionNode:Hs,MeasureLayout:Fl}};function Ll(e,t,n,r,i){let{props:a}=e,o=`while`+n;!i&&e.animationState&&a[o]&&e.animationState.setActive(o,r===`Start`);let s=a[`on`+n+r];s&&V.postRender(()=>s(t,Js(t)))}var Rl=class extends ul{mount(){let{current:e}=this.node;e&&(this.unmount=Xc(e,(e,t)=>(Ll(this.node,t,`Hover`,`Start`),e=>Ll(this.node,e,`Hover`,`End`))))}unmount(){}},zl=class extends ul{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=Se(Bs(this.node.current,`focus`,()=>this.onFocus()),Bs(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Bl(e,t,n,r){e.current instanceof HTMLButtonElement&&e.current.disabled||Ll(e,t,`Tap`,n,r)}var Vl=class extends ul{constructor(){super(...arguments),this.options={}}mount(){let{current:e}=this.node;e&&(this.update(),this.unmount=cl(e,(e,t)=>(Bl(this.node,t,`Start`),{onComplete:(e,{success:t})=>Bl(this.node,e,t?``:`Cancel`),onRepeat:()=>Bl(this.node,t,``,!0)}),this.options))}update(){let{options:e,node:t}=this,{globalTapTarget:n,propagate:r,tap:i}=t.props;for(let t in e)delete e[t];Object.assign(e,i,{useGlobalTarget:n,stopPropagation:r?.tap===!1})}unmount(){}},Hl=new WeakMap,Ul=new WeakMap,Wl=e=>{let t=Hl.get(e.target);t&&t(e)},Gl=e=>{e.forEach(Wl)};function Kl({root:e,...t}){let n=e||document;Ul.has(n)||Ul.set(n,{});let r=Ul.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Gl,{root:e,...t})),r[i]}function ql(e,t,n){let r=Kl(t);return Hl.set(e,n),r.observe(e),()=>{Hl.delete(e),r.unobserve(e)}}var Jl={some:0,all:1},Yl=class extends ul{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Jl[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=ql(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Xl(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Xl({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Zl=Object.assign({},Object.assign({renderer:wl},Dl,{inView:{Feature:Yl},tap:{Feature:Vl},focus:{Feature:zl},hover:{Feature:Rl}}),Il,{layout:{ProjectionNode:Hs,MeasureLayout:Fl}});function Ql(e){let t=on(()=>cn(e)),{isStatic:n}=(0,Y.useContext)(hn);if(n){let[,n]=(0,Y.useState)(e);(0,Y.useEffect)(()=>t.on(`change`,n),[])}return t}function $l(e,t){let n=Ql(t()),r=()=>n.set(t());return r(),fn(()=>{let t=()=>V.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return r(),()=>{n.forEach(e=>e()),B(r)}}),n}function eu(e){dn.current=[],e();let t=$l(dn.current,e);return dn.current=void 0,t}function tu(e,t,n,r){if(typeof e==`function`)return eu(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return ru(e,t,n,r);let i=typeof t==`function`?t:ll(t,n,r),a=Array.isArray(e)?nu(e,i):nu([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;if(o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&!r?.mixer){let e=r?.ease;a.accelerate={...o,times:[0,...t,1],keyframes:[n[0],...n,n[n.length-1]],isTransformed:!0,...e?{ease:Array.isArray(e)?[e[0],...e]:e}:{}}}return a}function nu(e,t){let n=on(()=>[]);return $l(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function ru(e,t,n,r){let i=on(()=>Object.keys(n)),a=on(()=>({}));for(let o of i)a[o]=tu(e,t,n[o],r);return a}var iu=(0,Y.createContext)(null),au=(0,Y.createContext)(null);function ou(e,t,n,r,i,a=`ltr`){let o=e.findIndex(e=>e.value===t);if(o===-1)return e;if(i===`xy`){let{layout:t}=e[o],r={x:cu(t.x)+n.x,y:cu(t.y)+n.y},i=lu(e),s=i.find(t=>t.items.includes(e[o])),c=i.reduce((e,t)=>uu(r.y,t)<uu(r.y,e)?t:e);if(c!==s)return du(e,o,r.x,c,a);let l=fu(r,t),u=-1,d=l;return e.forEach((e,t)=>{if(t===o)return;let n=fu(r,e.layout);n<d&&(u=t,d=n)}),u===-1?e:Bt(e,o,o+Math.sign(u-o))}if(!r[i])return e;let s=r[i]>0?1:-1,c=e[o+s];if(!c)return e;let l=e[o].layout[i],u=c.layout[i],d=cu(u);return s===1&&l.max+n[i]>d||s===-1&&l.min+n[i]<d?Bt(e,o,o+s):e}function su(e,t,n,r,i){let a=n>1==!!(n%2&&i)?-1:1,o=n>3?(n-4)*(e.length-1):t+a;if(r===`xy`&&n<4&&!(n%2)&&t>-1){let n=lu(e).sort((e,t)=>e.min-t.min),r=n[n.findIndex(({items:n})=>n.includes(e[t]))+a],i=n=>Math.abs(cu(n.layout.x)-cu(e[t].layout.x));o=r?e.indexOf(r.items.reduce((e,t)=>i(t)<i(e)?t:e)):-1}return t>-1&&o!==t&&e[o]?o:-1}var cu=({min:e,max:t})=>I(e,t,.5);function lu(e){let t=[];return e.forEach(e=>{let{min:n,max:r}=e.layout.y,i=t[t.length-1];!i||n>=i.max||r<=i.min?t.push({items:[e],min:n,max:r}):(i.items.push(e),i.min=Math.min(i.min,n),i.max=Math.max(i.max,r))}),t}function uu(e,t){return e<t.min?t.min-e:e>t.max?e-t.max:0}function du(e,t,n,r,i){let a=e.filter((e,n)=>n!==t),o=r.items.find(e=>{let t=cu(e.layout.x);return i===`ltr`?n<t:n>t}),s=o?a.indexOf(o):a.indexOf(r.items[r.items.length-1])+1,c=[...a];return c.splice(s,0,e[t]),c.every((t,n)=>t===e[n])?e:c}function fu(e,t){let n=Math.max(t.x.min-e.x,0,e.x-t.x.max),r=Math.max(t.y.min-e.y,0,e.y-t.y.max);return n*n+r*r}var pu=(e,t)=>e.max<=t.min||t.max<=e.min;function mu(e){let t=!1,n=!1;for(let r=0;r<e.length;r++)for(let i=r+1;i<e.length;i++)if(t||=pu(e[r].x,e[i].x),n||=pu(e[r].y,e[i].y),t&&n)return`xy`;return t?`x`:`y`}var hu=(e,t)=>n=>{e.current=n;let r=typeof t==`function`?t(n):t&&(t.current=n);if(typeof r==`function`)return()=>{e.current=null,r()}};function gu({children:e,as:t=`ul`,axis:n,onReorder:r,values:i,onPointerDownCapture:a,onClickCapture:o,...s},c,l){let u=on(()=>l[t]),d=(0,Y.useContext)(iu),f=(0,Y.useRef)(new Map),p=(0,Y.useRef)(new Map),[m,h]=(0,Y.useState)(),[g,_]=(0,Y.useState)(`y`),v=(0,Y.useRef)(!1),y=(0,Y.useRef)(!1),b=(0,Y.useRef)(null),x=n||g,S=new Set(i);for(let e of[f.current,p.current])e.forEach((t,n)=>S.has(n)||e.delete(n));let C=S.has(m)?m:i[0],w=e=>p.current.get(e)?.current?.isConnected,T=e=>S.has(e)&&h(e),E=()=>{w(C)||T(i.find(w))};(0,Y.useEffect)(E);let D=()=>i.flatMap(e=>f.current.get(e)||[]),O=()=>b.current?.ownerDocument.defaultView?.getComputedStyle(b.current).direction===`rtl`,k=(e,t)=>{let n=0,a=i.map(t=>f.current.has(t)?e[n++].value:t);a.some((e,t)=>e!==i[t])&&r(a,t)},A={axis:x,proxy:l,groupRef:b,hasReordered:y,values:i,onReorder:r,getOrder:D,isTabStop:e=>e===C||!S.has(e),setActive:T,checkTabStop:E,elements:p.current,onKeyDown:(e,t,n,r)=>{let{key:a,currentTarget:o}=e;if(e.defaultPrevented||e.target!==o||e.altKey||e.ctrlKey||e.metaKey)return;let s=D(),c=[`ArrowUp`,`ArrowLeft`,`ArrowDown`,`ArrowRight`,`Home`,`End`].indexOf(a),l=c%2;if(a===` `)e.repeat||r(o,n?void 0:i);else if(c<0&&!(a===`Escape`&&n))return;else if(!d?.isMoving(o)){if(a===`Escape`&&n){if(r(o),!d?.restore(A,t,o,n)){let e=n.flatMap(e=>s.filter(t=>t.value===e));k(s.map(t=>n.includes(t.value)?e.shift():t),t)}}else{let e=c>3||x===`xy`||x===(l?`x`:`y`),r=n?s:s.filter(({value:e})=>w(e)),i=r.findIndex(({value:e})=>e===t),a=e?su(r,i,c,x,!!l&&O()):-1;if(a>-1)n?k(Bt(s,i,a),t):p.current.get(r[a].value)?.current?.focus();else if(!(n&&c<4&&d?.key(A,t,c,o,n))&&!e)return}}e.preventDefault()},registerItem:(e,t,r)=>{if(f.current.set(e,{value:e,layout:t,ref:r}),!n){let e=mu(D().map(e=>e.layout));e!==g&&_(e)}},updateOrder:(e,t,n)=>{if(v.current)return;let r=D(),i=ou(r,e,t,n,x,O()?`rtl`:`ltr`);r!==i&&(v.current=!0,y.current=!0,k(i,e))}};(0,Y.useEffect)(()=>{v.current=!1},[i]),fn(()=>d?.add(A));let j={overflowAnchor:`none`,...s.style};return(0,J.jsx)(u,{...s,style:j,ref:hu(b,c),onPointerDownCapture:e=>{y.current=!1,a?.(e)},onClickCapture:e=>{y.current&&e.detail&&(y.current=!1,e.stopPropagation(),e.preventDefault()),o?.(e)},ignoreStrict:!0,children:(0,J.jsx)(au.Provider,{value:A,children:e})})}var _u=e=>(0,Y.forwardRef)((t,n)=>gu(t,n,e)),vu=50,yu=1.5,bu=new Set([`auto`,`scroll`]),xu={x:new Map,y:new Map};function Su(){xu.x.clear(),xu.y.clear()}function Cu(e,t){let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY;return e===document.body||e===document.documentElement||bu.has(r)&&(t===`x`?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight)}function wu(e,t){let n=e?.parentElement;for(;n;){if(Cu(n,t))return n;n=n.parentElement}return null}function Tu(e){let t=Math.min(1,1-e/vu);return yu*t*t*H.delta}function Eu(e,t,n){let r=t.getBoundingClientRect(),i=n===`x`?Math.max(0,r.left):Math.max(0,r.top),a=n===`x`?Math.min(window.innerWidth,r.right):Math.min(window.innerHeight,r.bottom),o=e-i,s=a-e;return o<vu?{amount:-Tu(o),edge:`start`}:s<vu?{amount:Tu(s),edge:`end`}:{amount:0,edge:null}}function Du(e,t,n,r){if(!e)return;let i=wu(e,n);if(!i)return;let{amount:a,edge:o}=Eu(t-(n===`x`?window.scrollX:window.scrollY),i,n),s=xu[n];if(o===null){s.delete(i);return}let c=s.get(i),l=i===document.body||i===document.documentElement;if(c?.edge!==o){if(!(o===`start`&&r<0||o===`end`&&r>0))return;c={edge:o,limit:n===`x`?i.scrollWidth-(l?window.innerWidth:i.clientWidth):i.scrollHeight-(l?window.innerHeight:i.clientHeight)},s.set(i,c)}a>0&&(n===`x`?l?window.scrollX:i.scrollLeft:l?window.scrollY:i.scrollTop)>=c.limit||(n===`x`?l?window.scrollBy({left:a}):i.scrollLeft+=a:l?window.scrollBy({top:a}):i.scrollTop+=a)}function Ou(e,t=0){return en(e)?e:Ql(t)}function ku({children:e,style:t={},value:n,as:r=`li`,onDragStart:i,onDrag:a,onDragEnd:o,onKeyDown:s,onFocus:c,onBlur:l,layout:u=!0,...d},f){let p=(0,Y.useContext)(au),m=(0,Y.useContext)(iu),h=(0,Y.useRef)(null),g=on(()=>p.proxy[r]),_=(0,Y.useRef)(),v={x:Ou(t.x),y:Ou(t.y)},y=tu([v.x,v.y],([e,t])=>e||t?1:`unset`),{axis:b,registerItem:x,updateOrder:S,groupRef:C,hasReordered:w,isTabStop:T,setActive:E,checkTabStop:D,elements:O,onKeyDown:k}=p,A=b===`xy`||m?!0:b;O.set(n,h),(0,Y.useEffect)(()=>D);let j=(e,t)=>{_.current=t,t||m?.end(n),un.get(e)?.animationState?.setActive(`whileDrag`,!!t)},ee=(0,Y.useRef)(!1);return fn(()=>{m?.receive(p,n,h.current,j)&&(ee.current=!0)},[]),(0,J.jsx)(g,{drag:A,tabIndex:T(n)?0:-1,...d,dragSnapToOrigin:!0,style:{...t,x:v.x,y:v.y,zIndex:y},layout:u,onDragStart:(e,t)=>{ee.current?ee.current=!1:i?.(e,t)},onDrag:(e,t)=>{let{velocity:r,point:i}=t,o={x:v.x.get(),y:v.y.get()};m?.drag(p,n,h.current,e)||S(n,o,r);let s=m?[`x`,`y`]:[b===`xy`?Math.abs(r.x)>Math.abs(r.y)?`x`:`y`:b];for(let e of s)Du(m&&!b.includes(e)?m.column(p):C.current,i[e],e,r[e]);a&&a(e,t)},onDragEnd:(e,t)=>{w.current=!1,Su(),m?.end(n),o&&o(e,t)},onKeyDown:e=>{s?.(e),k(e,n,_.current,j)},onFocus:e=>{c?.(e),E(n)},onBlur:e=>{l?.(e),_.current&&j(e.currentTarget)},onLayoutMeasure:e=>{x(n,e,h)},ref:hu(h,f),ignoreStrict:!0,children:e})}var Au=(0,Y.forwardRef)(ku),ju=e=>{let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{x:t+r/2,y:n+i/2}},Mu=e=>{let{x:t,y:n}=ju(e),{scrollX:r,scrollY:i}=e.ownerDocument.defaultView;return{x:t+r,y:n+i}};function Nu(e,t,n,r){let{left:i,right:a,top:o,bottom:s}=t.getBoundingClientRect(),c=r?e.x>(i+a)/2:e.x<=(i+a)/2,l=e.y<=(o+s)/2;return n===`x`?c:n===`y`?l:e.y<o||e.y<s&&c}var Pu=(e,t)=>{let n=e.groupRef.current,r=t.groupRef.current;return n.contains(r)||r.contains(n)};function Fu(e){let t=new Set,n,r=(t,n,r)=>!Pu(t,n)&&e.current.canMove?.(r,t.values,n.values)!==!1,i,a=(e,t,r,i,a,o)=>{let s=ju(i),{values:c}=t;if(o===void 0){let e=t.getOrder().filter(e=>e.ref?.current?.isConnected),n=getComputedStyle(t.groupRef.current).direction===`rtl`,r=e.find(e=>Nu(s,e.ref.current,t.axis,n)),i=e[e.length-1];o=r?c.indexOf(r.value):i?c.indexOf(i.value)+1:c.length}n={value:r,to:t.groupRef,element:i,centre:Mu(i),...a},t.hasReordered.current=!0,e.onReorder(e.values.filter(e=>e!==r),r),t.onReorder([...c.slice(0,o),r,...c.slice(o)],r)};return{add:e=>(t.add(e),()=>t.delete(e)),drag:(e,i,o,s)=>{if(!o?.isConnected)return!1;if(n?.controls?.isDragging)return n.value===i&&(n.centre=Mu(o),n.event=s),!0;let c=ju(o),l;for(let e of o.ownerDocument.elementsFromPoint(c.x,c.y))if(!o.contains(e)){for(let n of t)n.groupRef.current===e&&(l=n);if(l)break}if(!l||!r(e,l,i))return!1;let u=un.get(o);return a(e,l,i,o,{controls:u&&Bc.get(u),event:s}),!0},key:(e,n,o,s,c)=>{let l=ju(s),u=o%2?`x`:`y`,d=o>1?1:-1,f,p=1/0;for(let i of t){let t=i.groupRef.current;if(!t)continue;let{left:a,right:s,top:c,bottom:m,width:h,height:g}=t.getBoundingClientRect();if(!h&&!g||([m,s,c,a][o]-l[u])*d<=0)continue;let _=Math.max(a-l.x,0,l.x-s),v=Math.max(c-l.y,0,l.y-m);_*_+v*v<p&&r(e,i,n)&&(p=_*_+v*v,f=i)}return f?(i?.from!==c&&(i={group:e.groupRef,from:c}),a(e,f,n,s,{keys:!0,from:c}),!0):!1},restore:(e,n,r,o)=>{let s=i?.from===o&&[...t].find(e=>e.groupRef===i.group);if(!s||s.groupRef===e.groupRef)return!1;let c=o.slice(o.indexOf(n)+1),l=s.values.findIndex(e=>c.includes(e));return i=void 0,a(e,s,n,r,{keys:!0},l<0?s.values.length:l),!0},end:e=>{n?.value===e&&(n=void 0)},isMoving:e=>n?.element===e,receive:(e,t,r,i)=>{let a=un.get(r),o=a&&Bc.get(a);o?.isDragging&&a.animationState?.setActive(`whileDrag`,!0);let s=n;if(!s||s.value!==t||s.to!==e.groupRef)return!1;let{keys:c,from:l,controls:u}=s,d=!s.element.isConnected;if(c){n=void 0;let{activeElement:e,body:t}=r.ownerDocument;return d&&(!e||e===t)&&(r.focus(),i(r,l)),!1}return!o||!u?.isDragging?!1:(pn.read(()=>{if(n!==s)return;n=void 0,un.get(s.element)?.values.forEach((e,t)=>{let n=e.get();a.getValue(t,a.readValue(t,n))?.set(n)});let e=a.getTransformPagePoint()||(e=>e),t=e(s.centre),i=e(Mu(r));a.getValue(`x`).set(t.x-i.x),a.getValue(`y`).set(t.y-i.y),a.render(),d?u.cancel():u.stop(),o.start(s.event,{immediate:!0})}),d)},column:({groupRef:e})=>{let n=e.current,r=n=>[...t].some(t=>t.groupRef!==e&&n.contains(t.groupRef.current));for(;n?.parentElement?.parentElement&&!r(n.parentElement);)n=n.parentElement;return n}}}function Iu({children:e,...t}){let n=(0,Y.useRef)(t);return fn(()=>{n.current=t}),(0,J.jsx)(iu.Provider,{value:on(()=>Fu(n)),children:e})}var Lu=e=>{e.stopPropagation()},Ru=e=>{e.preventDefault(),e.stopPropagation(),e.preventBaseUIHandler?.()},zu={anchor:null,iconSpaceMode:`global`,items:[],open:!1,triggerId:null},Bu=zu,Vu=new Set,Hu={ready:!1,triggerId:null,x:0,y:0},Uu=()=>{Vu.forEach(e=>e())},Wu=e=>(Vu.add(e),()=>Vu.delete(e)),Gu=()=>Bu,Ku=()=>zu,qu=e=>{Hu.x=e.clientX,Hu.y=e.clientY,Hu.ready=!0,Hu.triggerId=e.target instanceof Element?e.target.closest(`[data-contextmenu-trigger]`)?.dataset.contextmenuTrigger??null:null},Ju=e=>({contextElement:typeof document>`u`?void 0:document.body,getBoundingClientRect:()=>({bottom:e.y,height:0,left:e.x,right:e.x,toJSON:()=>void 0,top:e.y,width:0,x:e.x,y:e.y})}),Yu=e=>{Bu={...Bu,...e},Uu()},Xu=null,Zu=(e,t)=>{let n={x:window.innerWidth/2,y:window.innerHeight/2};Yu({anchor:Ju(Hu.ready?{x:Hu.x,y:Hu.y}:n),footer:t?.footer,header:t?.header,iconAlign:t?.iconAlign,iconSpaceMode:t?.iconSpaceMode??`global`,items:e,listItemHeight:t?.listItemHeight,open:!0,triggerId:Hu.triggerId??null,virtual:t?.virtual})},Qu=(e,t)=>{typeof window<`u`&&(Xu?.show?Xu.show(e,t,()=>Zu(e,t)):Zu(e,t))},$u=()=>{Yu({anchor:null,footer:void 0,header:void 0,iconSpaceMode:`global`,items:[],listItemHeight:void 0,open:!1,triggerId:null,virtual:void 0})},ed=()=>{Xu?.close?Xu.close($u):$u()},X=Pt({block:`context-menu`,elements:[`trigger`,`positioner`,`header`,`viewport`,`footer`,`item`,`item-content`,`icon`,`label-group`,`label`,`desc`,`extra`,`submenu-arrow`,`checkbox-indicator`,`switch`,`separator`,`group`,`group-label`]});function td(e){let[t,n]=Y.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=Y.useRef(null),i=Y.useRef(null),a=Y.useRef(null),o=Y.useRef(null),s=Y.useRef(!0),c=Y.useRef(null),l=tt(),u=Y.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,J.jsx)(y.Provider,{value:u,children:(0,J.jsx)(v.Provider,{value:void 0,children:(0,J.jsx)(Oe,{...e})})})}var nd=Me,rd=(0,Y.memo)(({collisionPadding:e,style:t,...n})=>{let r=typeof t!=`function`&&t?.zIndex!=null&&typeof t.zIndex==`number`?t.zIndex:void 0,{zIndex:i,ref:a}=kt(`floating`,r),o=typeof t==`function`?e=>({zIndex:i,...t(e)}):{zIndex:i,...t};return(0,J.jsx)(nd,{...n,className:z(m.positioner,X(`positioner`)),collisionPadding:e??x(),ref:a,style:o})});rd.displayName=`ContextMenuSubmenuPositioner`;var id=(0,Y.memo)(()=>{let{t:e}=h(Qe);return(0,J.jsx)(Ee,{disabled:!0,className:z(R(F.item,F.empty).className,X(`item`)),children:(0,J.jsx)(`div`,{className:z(m.itemContent,X(`item-content`)),children:(0,J.jsx)(`span`,{className:z(m.label,X(`label`)),children:e(`common.empty`)})})})});id.displayName=`EmptyMenuItem`;var ad=({checked:e,children:t,closeOnClick:n=!1,danger:r,defaultChecked:i,disabled:a,label:o,onCheckedChange:s})=>{let[c,l]=(0,Y.useState)(i??!1),u=e!==void 0,d=u?e:c,f=(0,Y.useCallback)(e=>{u||l(e),s?.(e)},[u,s]);return(0,J.jsxs)(Ee,{closeOnClick:n,disabled:a,label:o,className:z(R(F.item,r&&F.danger).className,X(`item`)),onClick:e=>{e.preventDefault(),a||f(!d)},children:[t,(0,J.jsx)(`span`,{className:z(m.switchWrap,X(`switch`)),onFocus:e=>e.stopPropagation(),children:(0,J.jsx)(k,{checked:d,disabled:a,size:`small`,tabIndex:-1,onChange:f,onClick:(e,t)=>t.stopPropagation()})})]})},od=(e,t,n)=>{let r=P(e),i=`desc`in e?e.desc:void 0,a=`extra`in e?e.extra:void 0,o=t?.indicatorOnRight,s=!!i&&t?.iconAlign===`start`,c=n!==void 0&&!o,l=c?!!n:!!e.icon,u=c?!!(t?.reserveIconSpace||n):!!(l||t?.reserveIconSpace),d=i?(0,J.jsxs)(`div`,{className:z(m.labelGroup,X(`label-group`)),children:[(0,J.jsx)(`span`,{className:z(m.label,X(`label`)),children:r}),(0,J.jsx)(`span`,{className:z(m.desc,X(`desc`)),children:i})]}):(0,J.jsx)(`span`,{className:z(m.label,X(`label`)),children:r});return(0,J.jsxs)(`div`,{className:z(R(F.itemContent,s&&F.itemContentAlignStart).className,X(`item-content`)),children:[u?(0,J.jsx)(`span`,{"aria-hidden":!l,className:z(R(F.icon,s&&F.iconAlignStart).className,ke.icon,X(`icon`)),children:c?n:l?ye(e.icon,`small`):null}):null,d,a?(0,J.jsx)(`span`,{className:z(m.extra,X(`extra`)),children:a}):null,o&&n?n:null,t?.submenu?(0,J.jsx)(`span`,{className:z(m.submenuArrow,X(`submenu-arrow`)),children:(0,J.jsx)(ue,{})}):null]})},sd=(e,t,n)=>{if(!e.onClick)return;let r=e.key??t.at(-1)??``,i={domEvent:n,item:n.currentTarget,key:String(r),keyPath:t};e.onClick(i)},cd=(e,t=[],n)=>{let r=n?.iconAlign,i=n?.iconSpaceMode??`global`,a=n?.reserveIconSpace??te(e,i===`global`),o=n?.indicatorOnRight??f(e);return e.map((e,n)=>{if(!e)return null;let s=`${t.join(`-`)||`root`}-${n}`,c=ce(e,s),l=[...t,String(c)];if(e.type===`checkbox`){let t=e,n=P(t),i=typeof n==`string`?n:void 0,s=!!t.danger,l=(0,J.jsx)(Ze,{className:X(`checkbox-indicator`),children:(0,J.jsx)(ut,{icon:_,size:`small`})});return(0,J.jsx)(ge,{checked:t.checked,closeOnClick:t.closeOnClick,defaultChecked:t.defaultChecked,disabled:t.disabled,label:i,className:z(R(F.item,s&&F.danger).className,X(`item`)),onCheckedChange:e=>t.onCheckedChange?.(e),children:od(t,{iconAlign:r,indicatorOnRight:o,reserveIconSpace:a},l)},c)}if(e.type===`switch`){let t=e,n=P(t),i=typeof n==`string`?n:void 0,o=!!t.danger;return(0,J.jsx)(ad,{checked:t.checked,closeOnClick:t.closeOnClick,danger:o,defaultChecked:t.defaultChecked,disabled:t.disabled,label:i,onCheckedChange:t.onCheckedChange,children:od(t,{iconAlign:r,reserveIconSpace:a})},c)}if(e.type===`divider`)return(0,J.jsx)(Le,{className:z(m.separator,X(`separator`))},c);if(e.type===`group`){let t=e,n=i===`group`?t.children?te(t.children):!1:a,o=t.children?f(t.children):!1;return(0,J.jsxs)(pe,{className:X(`group`),children:[t.label?(0,J.jsx)(Ce,{className:z(m.groupLabel,X(`group-label`)),children:t.label}):null,t.children?cd(t.children,l,{iconAlign:r,iconSpaceMode:i,indicatorOnRight:o,reserveIconSpace:n}):null]},c)}if(e.type===`submenu`||`children`in e&&e.children){let t=e,n=P(t),o=typeof n==`string`?n:void 0,s=`danger`in t&&!!t.danger,u=t.header!=null||t.footer!=null,d=t.children&&t.children.length>0?cd(t.children,l,{iconAlign:r,iconSpaceMode:i}):(0,J.jsx)(id,{});return(0,J.jsxs)(Ue,{defaultOpen:t.defaultOpen,open:t.open,onOpenChange:t.onOpenChange,children:[(0,J.jsx)(Ke,{...t.triggerProps,closeDelay:t.closeDelay,delay:t.delay,disabled:t.disabled,label:o,openOnHover:t.openOnHover,className:z(R(F.item,s&&F.danger).className,X(`item`)),onClick:t.onClick,children:od(t,{iconAlign:r,reserveIconSpace:a,submenu:!0})}),(0,J.jsx)(xe,{children:(0,J.jsx)(rd,{alignOffset:-4,"data-submenu":``,sideOffset:-1,onContextMenu:Ru,children:(0,J.jsxs)(ze,{className:z(R(F.popup,u&&F.popupWithSlots).className,ke.popup,X()),children:[t.header==null?null:(0,J.jsx)(`div`,{className:z(m.header,X(`header`)),children:t.header}),u?(0,J.jsx)(`div`,{className:z(m.slotViewport,X(`viewport`)),children:d}):d,t.footer==null?null:(0,J.jsx)(`div`,{className:z(m.footer,X(`footer`)),children:t.footer})]})})})]},c)}let u=e,d=P(u),p=typeof d==`string`?d:void 0,h=`danger`in u&&!!u.danger;return(0,J.jsx)(Ee,{closeOnClick:u.closeOnClick,disabled:u.disabled,label:p,className:z(R(F.item,h&&F.danger).className,X(`item`)),onClick:e=>sd(u,l,e),children:od(u,{iconAlign:r,reserveIconSpace:a})},c)})},ld={"--lobe-dropdown-animation-duration":`0ms`},ud=(0,Y.memo)(()=>{let e=E(),t=at(),n=(0,Y.useSyncExternalStore)(Wu,Gu,Ku);(0,Y.useEffect)(()=>{},[e]),(0,Y.useEffect)(()=>{let e=e=>qu(e);return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`contextmenu`,e,!0),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`contextmenu`,e,!0)}},[]);let r=(0,Y.useMemo)(()=>cd(n.items,[],{iconAlign:n.iconAlign,iconSpaceMode:n.iconSpaceMode}),[n.items,n.iconAlign,n.iconSpaceMode]),{zIndex:i,ref:a}=kt(`floating`),o=n.header!=null||n.footer!=null;return!e||!n.open&&n.items.length===0?null:(0,J.jsx)(td,{open:n.open,onOpenChange:e=>{e?Yu({open:e}):ed()},children:(0,J.jsx)(xe,{container:t,children:(0,J.jsx)(nd,{anchor:n.anchor??void 0,className:z(m.positioner,X(`positioner`)),collisionPadding:x(),ref:a,sideOffset:6,style:{...ld,zIndex:i},children:(0,J.jsxs)(ze,{"data-has-footer":n.footer==null?void 0:``,"data-has-header":n.header==null?void 0:``,className:z(R(F.popup,o&&F.popupWithSlots).className,ke.popup,X()),onContextMenu:Ru,children:[n.header==null?null:(0,J.jsx)(`div`,{className:z(m.header,X(`header`)),children:n.header}),n.virtual?(0,J.jsx)(A,{className:X(`viewport`),itemSize:n.listItemHeight,children:r}):o?(0,J.jsx)(`div`,{className:z(m.slotViewport,X(`viewport`)),children:r}):r,n.footer==null?null:(0,J.jsx)(`div`,{className:z(m.footer,X(`footer`)),children:n.footer})]})})})})});ud.displayName=`ContextMenuHost`;function dd(e,t){let n=(t??bt(e).getComputedStyle(e)).transform,r=0,i=0,a=1;if(n&&n!==`none`){let e=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(r=t[4],i=t[5],a=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(r=t[12],i=t[13],a=t[0])}}return{x:r,y:i,scale:a}}var fd=(0,Y.createContext)({position:`bottom-right`,swipeDirection:[`down`,`right`]}),pd=()=>(0,Y.useContext)(fd),md=[],hd=new Set,gd=()=>{for(let e of hd)e()},_d=e=>(md.push(e),gd(),()=>{let t=md.indexOf(e);t!==-1&&md.splice(t,1),gd()}),vd=e=>md[0]===e,yd=e=>(hd.add(e),()=>{hd.delete(e)}),bd=20,xd=5e3,Sd=!1,Cd=[],wd=e=>{Sd?e():(Cd.length>=bd&&Cd.shift(),Cd.push({queuedAt:Date.now(),run:e}))},Td=()=>{Sd=!0;let e=Cd;Cd=[];let t=Date.now();for(let n of e)t-n.queuedAt<=xd&&n.run()},Ed=()=>{Sd=!1},Z=Pt({block:`toast`,dataAttributes:[`type`,`position`],elements:[`viewport`,`content`,`body`,`icon`,`main`,`title-row`,`title`,`close`,`description`,`actions`,`action`]}),Q={action:{kVAM5u:`lb181nr7w`,kaIpWk:`lb1vihcfj`,ksu8eU:`lbng3xce`,kMzoRj:`lbfn42iu`,kg3NbH:`lbaope02`,kmkexE:`lb1cd9vmy`,kGNEyG:`lb6s0dn4`,kkrTdU:`lb1ypdohk`,k1xSpc:`lb3nfvp2`,kmuXW:`lb2lah0s`,kGuDYH:`lbfifm61`,k63SB2:`lbk50ysn`,kjj79g:`lbl56j7k`,kLWn49:`lbo5v014`,kZKoxP:`lb1fgtraw`,$$css:!0},actionDanger:{"--lobe-focus-ring-color":`lb2hswdp`,kWkggS:`lbixdnzb lb1ca5mm0 lb4c98my`,kMwMTN:`lb15g0kca`,kjBf7l:`lbiep9q5 lb1y5du2d`,$$css:!0},actionGhost:{kVAM5u:`lbqnr5ac lb1ahehej lbuhn3al`,ksu8eU:`lb1y0btm7`,kMzoRj:`lbmkeg23`,kWkggS:`lbjbqb8w`,kMwMTN:`lb66ogz0 lb1l4wxl8 lb1nelral`,$$css:!0},actionPrimary:{kWkggS:`lb1hsafae lblxzpop lb1gwghft`,kMwMTN:`lb15g0kca`,$$css:!0},actionSecondary:{kWkggS:`lbjjy28o lbswrfa9 lb147z954`,kMwMTN:`lb66ogz0`,$$css:!0},actionText:{kWkggS:`lbjbqb8w lbswrfa9 lb1cpyog9`,kMwMTN:`lb16owwnm`,$$css:!0},actions:{kOIVth:`lb167g77z`,kGNEyG:`lb6s0dn4`,kSGwAc:`lbpvyfi4`,k1xSpc:`lb78zum5`,kzQI83:`lb1iyjqo2`,kmuXW:`lb2lah0s`,kjj79g:`lb13a6bvl`,keoZOQ:`lb1xmf6yo`,$$css:!0},close:{kmVPX3:`lb1717udv`,kVAM5u:`lb181nr7w`,kaIpWk:`lb1vihcfj`,ksu8eU:`lbng3xce`,kMzoRj:`lbfn42iu`,kmkexE:`lb1ng1d19`,kGNEyG:`lb6s0dn4`,kWkggS:`lbjbqb8w lb1ri6zej`,kMwMTN:`lbc77et8 lb1bxu9lh`,kkrTdU:`lb1ypdohk`,k1xSpc:`lb78zum5`,kmuXW:`lb2lah0s`,kjj79g:`lbl56j7k`,keTefX:`lbvc5jky`,kZKoxP:`lb1qx5ct2`,kzqmXN:`lbw4jnvo`,$$css:!0},content:{kVQacm:`lbb3r6kr`,kmkexE:`lb1hzt7jf`,kSiTet:`lb1g256cz lbcbbmyo`,kfzvcC:`lbp78wxm lb1cicrrk`,$$css:!0},contentArea:{kUk6DE:`lb98rzlu`,k1xSpc:`lb78zum5`,kXwgrk:`lbdt5ytf`,k7Eaqz:`lbeuugli`,$$css:!0},description:{kogj98:`lb1ghz6dp`,kMwMTN:`lbc77et8`,kGuDYH:`lb4z9k3i`,kLWn49:`lb1evy7pa`,$$css:!0},descriptionWithTitle:{keoZOQ:`lb1gslohp`,$$css:!0},descriptionStandalone:{kMwMTN:`lb66ogz0`,$$css:!0},icon:{kGNEyG:`lb6s0dn4`,k1xSpc:`lb78zum5`,kmuXW:`lb2lah0s`,kjj79g:`lbl56j7k`,$$css:!0},root:{"--toast-collapsed-height":`lb1o8nl8n`,"--toast-gap":`lbr9sdi6`,"--toast-peek":`lb1wxzbih`,"--toast-scale":`lb1vhpo3u`,"--toast-shrink":`lb1c223hw`,kaIpWk:`lb159sbz3`,kkqhue:`lb17y0mx6`,k8WAf4:`lb10dr8xq`,kg3NbH:`lb1hr3lfm`,kHypHr:`lbx83zyx`,kWkggS:`lb1w937bt`,kGVxlE:`lbj07k4p`,kB7OPa:`lb9f619`,kMwMTN:`lb66ogz0`,kkrTdU:`lbt0e3qv`,kSiTet:`lb4ki41r`,kVAEAm:`lb10l6tqk`,kIyJzY:`lb1ssesjg lbm69ghq`,k1ekBW:`lb19ix5ol lbo3tt7b`,kAMwcw:`lb1477tyf lb7cr0y4`,kfSwDN:`lb87ps6o`,kY2c9j:`lb1l48cz2`,kZKoxP:`lb677f43 lbnbj6on`,kzqmXN:`lbh8yej3`,$$css:!0},rootBottom:{kYYq5F:`lb1fclj7r`,k3aq6I:`lb1qsqgls lbz09l4w lb1ce1yp4`,k3nNDw:`lb18ouj0k`,kcktkL:`lbb7ltuz`,k5JduY:`lb100rkj9`,k3foIR:`lb1srwf7z`,kwXMNM:`lb1j6awrg`,k4zj60:`lb1jflgyd`,$$css:!0},rootTop:{kYYq5F:`lbdwv5cp`,k3aq6I:`lb1jkqqlh lb7ly47h lbjeddtc`,k3nNDw:`lb1dp6rp6`,kcktkL:`lbb7ltuz`,k5JduY:`lb100rkj9`,k8Iv0R:`lb1wpe5ba`,kwXMNM:`lb1j6awrg`,k4zj60:`lb1jflgyd`,$$css:!0},title:{kogj98:`lb1ghz6dp`,kMwMTN:`lb66ogz0`,kGuDYH:`lbif65rj`,k63SB2:`lbk50ysn`,kLWn49:`lb1evy7pa`,$$css:!0},titleRow:{kOIVth:`lb167g77z`,kGNEyG:`lb1cy8zhl`,k1xSpc:`lb78zum5`,$$css:!0},toastBody:{kOIVth:`lb1v2ro7d`,kGNEyG:`lb1cy8zhl`,k1xSpc:`lb78zum5`,$$css:!0},viewport:{kI3sdo:`lb1b6ykf0`,kVAEAm:`lbixxii4`,kY2c9j:`lb979qle`,ks0D6T:`lbg5xlue`,kzqmXN:`lb1fzdfyu lbm1mc0`,$$css:!0},viewportBottom:{krVfgx:`lbo7r6ss`,kLqNvP:`lbbudbmw`,k3aq6I:`lbuuh30`,$$css:!0},viewportBottomLeft:{krVfgx:`lbo7r6ss`,kLqNvP:`lb10vz1dz`,$$css:!0},viewportBottomRight:{krVfgx:`lbo7r6ss`,kt4wiu:`lb1cj2eds`,k3aq6I:`lb18zyp77`,kIyJzY:`lb1x2t6jx lb12w9bfk`,k1ekBW:`lb11xpdln lb4wkmsb`,kAMwcw:`lbsygjwy lb7v8fk2`,$$css:!0},viewportTop:{k87sOh:`lb1kd19f1`,kLqNvP:`lbbudbmw`,k3aq6I:`lbuuh30`,$$css:!0},viewportTopLeft:{k87sOh:`lb1kd19f1`,kLqNvP:`lb10vz1dz`,$$css:!0},viewportTopRight:{k87sOh:`lb1kd19f1`,kt4wiu:`lb1cj2eds`,$$css:!0}},Dd={bottom:Q.viewportBottom,"bottom-left":Q.viewportBottomLeft,"bottom-right":Q.viewportBottomRight,top:Q.viewportTop,"top-left":Q.viewportTopLeft,"top-right":Q.viewportTopRight},Od={bottom:Q.rootBottom,"bottom-left":Q.rootBottom,"bottom-right":Q.rootBottom,top:Q.rootTop,"top-left":Q.rootTop,"top-right":Q.rootTop},kd={danger:Q.actionDanger,ghost:Q.actionGhost,primary:Q.actionPrimary,secondary:Q.actionSecondary,text:Q.actionText},Ad=Y.createContext(void 0);function jd(){let e=Y.useContext(Ad);if(!e)throw Error(rt(73));return e}var Md=0;function Nd(e){return Md+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Md}`}function Pd(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function Fd(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function Id(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var $={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},Ld=class extends wt{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:Fd(e.toasts)},{},$)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=Id(this.state.toasts,t);r.toasts=e,r.toastMetadata=Fd(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=$.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||Nd(`toast`);if(e.id){let t=$.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(Id(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),$.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{let n=$.toast(this.state,e);n&&n.transitionStatus!==`ending`&&this.updateToastInternal(e,typeof t==`function`?t(n):t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=$.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;!d&&f?this.clearTimer(e):d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),$.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=$.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=Id(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=Pd(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=Pd(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=Pd(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=ft.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=At(e);Ct(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=$.expandedOrOutOfFocus(this.state)?void 0:ft.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:Fd(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=jt(pt(this.state.viewport));if(!this.state.viewport||!Ct(this.state.viewport,t)||!St(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=$.toasts(this.state),r=$.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},a=i(r+1,1)??i(r-1,-1);a?a.ref?.current?.focus():this.restoreFocusToPrevElement()}},Rd=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=dt(()=>new Ld({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return st(a.disposeEffect),Y.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t.updates):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,J.jsxs)(Ad.Provider,{value:a,children:[(0,J.jsx)(zd,{store:a,timeout:n,limit:r}),t]})};function zd(e){let{store:t,timeout:n,limit:r}=e;return nt(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var Bd=`--toast-frontmost-height`,Vd=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=jd(),c=it(),l=Y.useRef(!1),u=Y.useRef(!1),d=Y.useRef(!1),f=s.useState(`isEmpty`),p=s.useState(`toasts`),m=s.useState(`focused`),h=s.useState(`expanded`),g=s.useState(`prevFocusElement`),_=p[0]?.height,v=p.some(e=>e.transitionStatus===`ending`),y=p.filter(e=>e.priority===`high`);Y.useEffect(()=>{let e=s.state.viewport;if(!e||f)return;let t=bt(e),n=pt(e);function r(t){t.key===`F6`&&At(t)!==e&&(t.preventDefault(),s.set(`prevFocusElement`,jt(n)),e?.focus({preventScroll:!0}),s.pauseTimers(),s.set(`focused`,!0))}function i(e){At(e)===t&&(s.set(`isWindowFocused`,!1),s.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=At(n),i=jt(pt(e));r!==t&&Ct(e,r)&&St(i)||s.resumeTimers(),c.start(0,()=>s.set(`isWindowFocused`,!0))}return mt(Mt(t,`keydown`,r),Mt(t,`blur`,i,!0),Mt(t,`focus`,a,!0),Mt(n,`pointerdown`,s.handleDocumentPointerDown,!0))},[s,c,f]);function b(e){l.current=!0;let t=e.relatedTarget===s.state.viewport?p.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():s.restoreFocusToPrevElement()}function x(e){e.key===`Tab`&&e.shiftKey&&At(e.nativeEvent)===s.state.viewport&&(e.preventDefault(),s.restoreFocusToPrevElement())}function S(){s.state.toasts.some(e=>e.transitionStatus===`ending`)||d.current||!u.current||(s.set(`hovering`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers(),u.current=!1)}Y.useEffect(S,[v,s]);function C(){s.pauseTimers(),s.set(`hovering`,!0),u.current=!1}function w(){u.current=!0,S()}function T(e){e.pointerType===`touch`&&(d.current=!0)}function E(e){e.pointerType===`touch`&&(d.current=!1,S())}function D(){l.current?l.current=!1:m||St(jt(pt(s.state.viewport)))&&(s.set(`focused`,!0),s.pauseTimers())}function O(e){m&&!Ct(s.state.viewport,e.relatedTarget)&&(s.set(`focused`,!1),s.select(`expandedOrOutOfFocus`)||s.resumeTimers())}let k={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:C,onMouseMove:C,onMouseLeave:w,onFocus:D,onBlur:O,onKeyDown:x,onClick:D,onPointerDown:T,onPointerUp:E,onPointerCancel:E,style:{[Bd]:_?`${_}px`:void 0}},A={expanded:h},j=!f&&g&&(0,J.jsx)(_t,{onFocus:b}),ee=et(`div`,e,{ref:[t,s.setViewport],state:A,props:[k,o,{children:(0,J.jsxs)(Y.Fragment,{children:[j,a,j]})}]});return(0,J.jsxs)(Y.Fragment,{children:[j,ee,!m&&y.length>0&&(0,J.jsx)(`div`,{style:vt,children:y.map(e=>(0,J.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,J.jsx)(`div`,{children:e.title}),(0,J.jsx)(`div`,{children:e.description})]},e.id))})]})}),Hd=Y.createContext(void 0);function Ud(){let e=Y.useContext(Hd);if(!e)throw Error(rt(66));return e}function Wd(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}var Gd=`--toast-index`,Kd=`--toast-offset-y`,qd=`--toast-height`,Jd=`--toast-swipe-movement-x`,Yd=`--toast-swipe-movement-y`,Xd=`data-swipe-direction`,Zd=t(u(),1),Qd={...gt,swipeDirection(e){return e?{[Xd]:e}:null}},$d=40,ef=10,tf=.5,nf=1,rf=`${ht},${yt}`,af=Y.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:a=[`down`,`right`],style:o,...s}=e,c=n.positionerProps?.anchor!==void 0,l=[];c||(l=Array.isArray(a)?a:[a]);let u=l.length>0,d=jd(),[f,p]=Y.useState(void 0),[m,h]=Y.useState(!1),[g,_]=Y.useState(!1),[v,y]=Y.useState({x:0,y:0}),[b,x]=Y.useState({x:0,y:0,scale:1}),[S,C]=Y.useState(),[w,T]=Y.useState(),[E,D]=Y.useState(null),O=Y.useRef(null),k=Y.useRef(void 0),A=Y.useRef({x:0,y:0}),j=Y.useRef({x:0,y:0,scale:1}),ee=Y.useRef(void 0),te=Y.useRef(0),ne=Y.useRef(!1),M=Y.useRef({x:0,y:0}),re=Y.useRef(!1),ie=Y.useRef({x:0,y:0}),N=Y.useRef(null),ae=Y.useRef(null),oe=d.useState(`toastIndex`,n.id),se=d.useState(`toastVisibleIndex`,n.id),ce=d.useState(`toastOffsetY`,n.id),le=d.useState(`focused`),ue=d.useState(`expanded`);Tt({open:n.transitionStatus!==`ending`,ref:O,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let de=ct((e=!1)=>{let t=O.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){d.updateToastInternal(n.id,{ref:O,height:i,transitionStatus:void 0})}e?Zd.flushSync(a):a()});nt(()=>{let e=k.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(p(void 0),x({x:0,y:0,scale:1}),P({x:0,y:0})),k.current=n.id,de())},[de,n.id,n.transitionStatus]);function P(e){ie.current=e,y(e)}nt(()=>()=>{ae.current?.abort()},[]);function fe(e,t){let n=e=>e>0?e**tf:-(Math.abs(e)**tf),r=e>0&&!l.includes(`right`)||e<0&&!l.includes(`left`),i=t>0&&!l.includes(`down`)||t<0&&!l.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let pe=ct(e=>{if(e.pointerId!==N.current)return;N.current=null,ae.current?.abort(),ae.current=null,h(!1),_(!1),D(null);let t=j.current;if(e.type===`pointercancel`||ne.current){P({x:t.x,y:t.y}),p(void 0);return}let r=ie.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of l)if(Wd(e,i,a)>$d){o=e;break}o?(p(o),d.closeToast(n.id)):(P({x:t.x,y:t.y}),p(void 0))});function me(e){if(e.button!==0)return;e.pointerType===`touch`&&d.pauseTimers();let t=At(e.nativeEvent);if(Ot(t,`button,a,input,textarea,[role="button"],${rf}`))return;ne.current=!1,ee.current=void 0,te.current=0,N.current=e.pointerId,A.current={x:e.clientX,y:e.clientY},M.current=A.current;let n=e.currentTarget,r=dd(n);j.current=r,x(r),P({x:r.x,y:r.y}),d.set(`hovering`,!0),h(!0),_(!1),D(null),re.current=!0,ae.current?.abort();let i=new AbortController;ae.current=i;let a=pt(n);a.addEventListener(`pointerup`,pe,{signal:i.signal}),a.addEventListener(`pointercancel`,pe,{signal:i.signal}),n.setPointerCapture?.(e.pointerId)}function he(e){if(e.pointerId!==N.current)return;e.preventDefault(),re.current&&=(A.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>M.current.y||i>0&&t<M.current.y)&&(M.current={x:M.current.x,y:t}),(r<0&&n>M.current.x||r>0&&n<M.current.x)&&(M.current={x:n,y:M.current.y});let a=n-A.current.x,o=t-A.current.y,s=t-M.current.y,c=n-M.current.x,u=E;if(!g&&Math.sqrt(a*a+o*o)>=nf){_(!0);let e=l.includes(`left`)||l.includes(`right`),t=l.includes(`up`)||l.includes(`down`);e&&t&&(u=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,D(u))}let d;if(!ee.current)u===`vertical`?o>0?d=`down`:o<0&&(d=`up`):u===`horizontal`?a>0?d=`right`:a<0&&(d=`left`):d=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,d&&l.includes(d)&&(ee.current=d,te.current=Wd(d,a,o),p(d));else{let e=ee.current,t=Wd(e,c,s);t>$d?(ne.current=!1,p(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&te.current-t>=ef&&(ne.current=!0)}let f=fe(a,o),m=j.current.x,h=j.current.y,v=l.includes(`left`)||l.includes(`right`),y=l.includes(`up`)||l.includes(`down`);u!==`vertical`&&v&&(m+=f.x),u!==`horizontal`&&y&&(h+=f.y),P({x:m,y:h})}function ge(e){if(e.key===`Escape`){if(!O.current||!Ct(O.current,jt(pt(O.current))))return;d.closeToast(n.id)}}Y.useEffect(()=>{let e=O.current;if(!u||!e)return;function t(t){N.current!==null&&Ct(e,At(t))&&t.preventDefault()}return Mt(e,`touchmove`,t,{passive:!1})},[u]);function _e(){let e=v.x-b.x,t=v.y-b.y;return{transition:m?`none`:void 0,transform:m?`translateX(${v.x}px) translateY(${v.y}px) scale(${b.scale})`:void 0,[Jd]:`${e}px`,[Yd]:`${t}px`}}let ve=n.priority===`high`,ye={role:ve?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":S,"aria-describedby":w,"aria-hidden":ve&&!le?!0:void 0,onPointerDown:u?me:void 0,onPointerMove:u?he:void 0,onPointerUp:u?pe:void 0,onPointerCancel:u?pe:void 0,onKeyDown:ge,inert:Et(n.limited),style:{..._e(),[Gd]:n.transitionStatus===`ending`?oe:se,[Kd]:`${ce}px`,[qd]:n.height?`${n.height}px`:void 0}},be=Y.useMemo(()=>({toast:n,setTitleId:C,setDescriptionId:T,recalculateHeight:de,visibleIndex:se,expanded:ue}),[n,C,T,de,se,ue]),xe={transitionStatus:n.transitionStatus,expanded:ue,limited:n.limited||!1,type:n.type,swiping:m,swipeDirection:f},Se=et(`div`,e,{ref:[t,O],state:xe,stateAttributesMapping:Qd,props:[ye,s]});return(0,J.jsx)(Hd.Provider,{value:be,children:Se})}),of=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=Ud(),l=Y.useRef(null);return nt(()=>{c();let e=l.current;if(!e||typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`)return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),et(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})});function sf(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(sf)}function cf(e){return Y.isValidElement(e)&&sf(e.props.children)}function lf(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=Ud(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:tt(e),children:s,type:r.type,setId:o}}function uf(e,t,n){let r=cf(e);return nt(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var df=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=lf(a,o,`description`);return uf(et(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),ff=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=lf(a,o,`title`);return uf(et(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),pf=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=jd(),{toast:l,expanded:u}=Ud(),[d,f]=Y.useState(!1),{getButtonProps:p,buttonRef:m}=xt({disabled:a,native:o}),h={type:l.type};return et(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),mf=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=Ud(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=xt({disabled:a,native:o}),f={type:c.type},p=et(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return cf(p)?p:null}),hf=Y.forwardRef(function(e,t){return(0,J.jsx)(Ie,{ref:t,...e})});function gf(){let e=jd(),t=e.useState(`toasts`);return Y.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function _f(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||Nd(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{id:e,updates:n}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var vf={default:ie,error:Wa,info:ie,loading:Ye,success:Ha,warning:he},yf={default:Xe.colorText,error:Xe.colorError,info:Xe.colorInfo,loading:Xe.colorPrimary,success:Xe.colorSuccess,warning:Xe.colorWarning},bf=(0,Y.memo)(({toast:e,classNames:t,styles:n})=>{let{position:r,swipeDirection:i}=pd(),a=e.data,o=a?.type??`default`,s=a?.closable??!0,c=a?.hideCloseButton??!1,l=s&&!c,u=a?.icon,d=e.title??a?.title,f=e.description??a?.description,p=e.actionProps??a?.actionProps,m=a?.actions,h=yf[o],g=u??vf[o],_=o===`loading`,v=()=>g?(0,J.jsx)(`div`,{...L(Q.icon,z(Z(`icon`),t?.icon),n?.icon),children:(0,J.jsx)(ut,{color:h,icon:g,size:18,spin:_})}):null,y=()=>m&&m.length>0?(0,J.jsx)(`div`,{...L(Q.actions,z(Z(`actions`),t?.actions),n?.actions),children:m.map((e,r)=>(0,J.jsx)(mf,{...L([Q.action,ot.info,kd[e.variant??`primary`]],z(Z(`action`),t?.action),n?.action),onClick:e.onClick,...e.props,children:e.label},r))}):p?(0,J.jsx)(mf,{...L([Q.action,ot.info,Q.actionPrimary],z(Z(`action`),t?.action),n?.action),...p}):null;return(0,J.jsx)(af,{swipeDirection:i,toast:e,...Ft({position:r,type:o}),...L([Q.root,Od[r]],z(Z(),t?.root),{...n?.root,...a?.style}),children:(0,J.jsx)(of,{...L(Q.content,z(Z(`content`),t?.content),n?.content),children:(0,J.jsxs)(`div`,{...L(Q.toastBody,Z(`body`)),children:[v(),(0,J.jsxs)(`div`,{...L(Q.contentArea,Z(`main`)),children:[d?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{...L(Q.titleRow,Z(`title-row`)),children:[(0,J.jsx)(ff,{...L(Q.title,z(Z(`title`),t?.title),n?.title),children:d}),l&&(0,J.jsx)(pf,{"aria-label":`Close`,...L(Q.close,z(Z(`close`),t?.close),n?.close),children:(0,J.jsx)(lt,{size:14})})]}),f&&(0,J.jsx)(df,{...L([Q.description,Q.descriptionWithTitle],z(Z(`description`),t?.description),n?.description),children:f})]}):f&&(0,J.jsxs)(`div`,{...L(Q.titleRow,Z(`title-row`)),children:[(0,J.jsx)(df,{...L([Q.description,Q.descriptionStandalone],z(Z(`description`),t?.description),n?.description),children:f}),l&&(0,J.jsx)(pf,{"aria-label":`Close`,...L(Q.close,z(Z(`close`),t?.close),n?.close),children:(0,J.jsx)(lt,{size:14})})]}),y()]})]})})})});bf.displayName=`ToastItem`;var xf=[`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`],Sf={duration:5e3,limit:5,position:`bottom-right`,swipeDirection:[`down`,`right`]},Cf={bottom:_f(),"bottom-left":_f(),"bottom-right":_f(),top:_f(),"top-left":_f(),"top-right":_f()},wf={bottom:new Map,"bottom-left":new Map,"bottom-right":new Map,top:new Map,"top-left":new Map,"top-right":new Map},Tf=e=>Cf[e],Ef=0,Df=()=>`toast-${Date.now().toString(36)}-${(Ef++).toString(36)}`,Of=e=>xf.find(t=>wf[t].has(e)),kf=(e,t)=>Array.from(wf[e].keys()).at(-1)===t,Af=(e,t)=>typeof e==`string`?{description:e,type:t}:{...e,type:t},jf=(e,t)=>({close:()=>wd(()=>Tf(t).close(e)),id:e,update:n=>{wd(()=>Tf(t).update(e,{data:n,description:n.description,title:n.title}))}}),Mf=e=>{let t=e.placement??Sf.position,n=Tf(t),{id:r,onClose:i,onRemove:a}=e;if(r){let e=Of(r);e&&!(e===t&&kf(t,r))&&(wf[e].get(r).superseded=!0,wf[e].delete(r),wd(()=>Tf(e).close(r)))}let o=r??Df(),s={superseded:!1};return wf[t].set(o,s),wd(()=>{n.add({id:o,data:e,description:e.description,onClose:()=>{s.superseded||i?.()},onRemove:()=>{s.superseded||(wf[t].delete(o),a?.())},timeout:e.duration??Sf.duration,title:e.title})}),jf(o,t)},Nf=e=>{if(e)for(let[t,n]of Object.entries(Cf))wf[t].delete(e),wd(()=>n.close(e));else for(let[e,t]of Object.entries(Cf)){let n=Array.from(wf[e].keys());wf[e].clear(),wd(()=>{for(let e of n)t.close(e)})}},Pf=e=>Mf(Af(e,`success`)),Ff=e=>Mf(Af(e,`error`)),If=e=>Mf(Af(e,`info`)),Lf=e=>Mf(Af(e,`warning`)),Rf=e=>Mf({duration:0,...Af(e,`loading`)});async function zf(e,t){let n=Mf({closable:!1,duration:0,type:`loading`,...typeof t.loading==`string`?{description:t.loading}:t.loading});try{let r=await e;return n.close(),Mf({type:`success`,...typeof t.success==`string`?{description:t.success}:typeof t.success==`function`?{description:t.success(r)}:t.success}),r}catch(e){throw n.close(),Mf({type:`error`,...typeof t.error==`string`?{description:t.error}:typeof t.error==`function`?{description:t.error(e)}:t.error}),e}}var Bf=Object.assign(e=>Mf({type:`default`,...e}),{dismiss:Nf,error:Ff,info:If,loading:Rf,promise:zf,success:Pf,warning:Lf}),Vf=(0,Y.memo)(()=>{let{toasts:e}=gf();return e.map(e=>(0,J.jsx)(bf,{toast:e},e.id))});Vf.displayName=`ToastList`;var Hf=(0,Y.memo)(({root:e,className:t,duration:n=5e3,limit:r=5,position:i=`bottom-right`,swipeDirection:a=[`down`,`right`]})=>{let o=E(),s=at(),[c,l]=(0,Y.useState)(void 0),u=(0,Y.useId)();(0,Y.useEffect)(()=>_d(u),[u]);let d=(0,Y.useSyncExternalStore)(yd,()=>vd(u),()=>!1);if((0,Y.useEffect)(()=>{d&&(Sf={duration:n,limit:r,position:i,swipeDirection:a})},[n,r,i,a,d]),(0,Y.useEffect)(()=>{d&&l(Dt(`toast`))},[d]),(0,Y.useEffect)(()=>{if(d&&o)return Td(),()=>{Ed()}},[d,o]),!o||!d)return null;let f=e??s??document.body;return xf.map(e=>(0,J.jsx)(fd,{value:{position:e,swipeDirection:a},children:(0,J.jsx)(Rd,{limit:r,timeout:n,toastManager:Tf(e),children:(0,J.jsx)(hf,{container:f,children:(0,J.jsx)(Vd,{"data-position":e,...L([Q.viewport,Dd[e]],z(Z(`viewport`),t),c===void 0?void 0:{zIndex:c}),children:(0,J.jsx)(Vf,{})})})})},e))});Hf.displayName=`ToastHost`;var Uf=e({Board:()=>Iu,Group:()=>Wf,Item:()=>Au}),Wf=_u(Cl),Gf=e({Reorder:()=>Uf,a:()=>ma,abbr:()=>Ki,address:()=>oa,animate:()=>ki,area:()=>ei,article:()=>Xi,aside:()=>ua,audio:()=>si,b:()=>zi,base:()=>va,bdi:()=>di,bdo:()=>vi,big:()=>ea,blockquote:()=>Ui,body:()=>Ei,button:()=>Si,canvas:()=>Xr,caption:()=>Sa,circle:()=>Pa,cite:()=>ii,clipPath:()=>Aa,code:()=>wr,col:()=>kn,colgroup:()=>Ea,create:()=>ca,data:()=>Or,datalist:()=>In,dd:()=>Nn,defs:()=>fr,del:()=>Ii,desc:()=>Cn,details:()=>Ni,dfn:()=>or,dialog:()=>lr,div:()=>hr,dl:()=>zn,dt:()=>Jn,ellipse:()=>rr,em:()=>xr,embed:()=>Ra,feBlend:()=>En,feColorMatrix:()=>Fr,feComponentTransfer:()=>Gn,feComposite:()=>Mr,feConvolveMatrix:()=>Rr,feDiffuseLighting:()=>Hn,feDisplacementMap:()=>er,feDistantLight:()=>ra,feDropShadow:()=>Zn,feFlood:()=>Wr,feFuncA:()=>Vr,feFuncB:()=>qr,feFuncG:()=>vr,feFuncR:()=>bn,feGaussianBlur:()=>_i,feImage:()=>_a,feMerge:()=>Yi,feMergeNode:()=>la,feMorphology:()=>Mi,feOffset:()=>ri,fePointLight:()=>$i,feSpecularLighting:()=>pa,feSpotLight:()=>ui,feTile:()=>Hi,feTurbulence:()=>xa,fieldset:()=>mi,figcaption:()=>xi,figure:()=>na,filter:()=>Gi,footer:()=>Oi,foreignObject:()=>Ti,form:()=>$r,g:()=>Ta,h1:()=>La,h2:()=>oi,h3:()=>Na,h4:()=>Dr,h5:()=>Mn,h6:()=>ka,head:()=>jr,header:()=>Rn,hgroup:()=>Fn,hr:()=>mr,html:()=>Ri,i:()=>Tn,iframe:()=>Fi,image:()=>cr,img:()=>dr,input:()=>_r,ins:()=>Vn,kbd:()=>Xn,keygen:()=>ar,label:()=>Cr,legend:()=>Ba,li:()=>On,line:()=>Lr,linearGradient:()=>qn,link:()=>Pr,main:()=>Br,map:()=>Wn,mark:()=>nr,marker:()=>aa,mask:()=>$n,menu:()=>Kr,menuitem:()=>Ur,metadata:()=>Yr,meter:()=>br,nav:()=>Sn,object:()=>hi,ol:()=>ha,optgroup:()=>qi,option:()=>sa,output:()=>Ai,p:()=>ti,param:()=>Zi,path:()=>da,pattern:()=>ci,picture:()=>Bi,polygon:()=>ya,polyline:()=>fi,pre:()=>yi,progress:()=>ta,q:()=>Wi,radialGradient:()=>Di,rect:()=>Ci,rp:()=>Zr,rt:()=>Ca,ruby:()=>Fa,s:()=>ai,samp:()=>ja,script:()=>Tr,section:()=>An,select:()=>Da,small:()=>kr,source:()=>Ln,span:()=>Pn,stop:()=>pr,strong:()=>Li,style:()=>wn,sub:()=>Pi,summary:()=>sr,sup:()=>ur,svg:()=>gr,symbol:()=>Bn,table:()=>Yn,tbody:()=>ir,td:()=>Sr,text:()=>za,textPath:()=>Dn,textarea:()=>Ir,tfoot:()=>Kn,th:()=>Nr,thead:()=>zr,time:()=>Un,title:()=>tr,tr:()=>ia,track:()=>Qn,tspan:()=>Gr,u:()=>Hr,ul:()=>Jr,use:()=>yr,video:()=>xn,view:()=>gi,wbr:()=>ga,webview:()=>Ji}),Kf=l();function qf(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var Jf=Nt(),Yf=Y.useInsertionEffect,Xf=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?Y.useLayoutEffect:Y.useEffect,Zf=Yf||Xf,Qf=e=>{let t=Y.useRef([e,(...e)=>t[0](...e)]).current;return Zf(()=>{t[0]=e}),t[1]},$f=[`popstate`,`pushState`,`replaceState`,`hashchange`],ep=[],tp=()=>ep.forEach(e=>e()),np=e=>(ep.push(e)===1&&$f.forEach(e=>addEventListener(e,tp)),()=>{ep=ep.filter(t=>t!==e),ep.length||$f.forEach(e=>removeEventListener(e,tp))}),rp=(e,t)=>(0,Jf.useSyncExternalStore)(np,e,t),ip=()=>location.search,ap=({ssrSearch:e}={})=>rp(ip,e==null?ip:()=>e),op=()=>location.pathname,sp=({ssrPath:e}={})=>rp(op,e==null?op:()=>e),cp=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),lp=e=>[sp(e),cp],up=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[up]===void 0){for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,up,{value:!0})}var dp=(e=``)=>e===`/`?``:e,fp=(e,t)=>e[0]===`~`?e.slice(1):dp(t)+e,pp=(e,t)=>(e=mp(dp(e)),t=mp(t),!e||(t.toLowerCase()+`/`).startsWith(e.toLowerCase()+`/`)?t.slice(e.length)||`/`:`~`+t),mp=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},hp={hook:lp,searchHook:ap,parser:qf,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},gp=(0,Y.createContext)(hp),_p=()=>(0,Y.useContext)(gp);(0,Y.createContext)({});var vp=e=>{let[t,n]=e.hook(e);return[pp(e.base,t),Qf((t,r)=>e.aroundNav(n,fp(t,e.base),r))]},yp=()=>vp(_p());(0,Y.forwardRef)((e,t)=>{let n=_p(),[r,i]=vp(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e;return m.onClick=Qf(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),m.href=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n),u!==void 0&&(m.className=u?.call?u(r===o):u),t&&(m.ref=t),c&&(0,Y.isValidElement)(l)?(0,Y.cloneElement)(l,m):(0,Y.createElement)(`a`,m,l)});function bp(e=window){try{let t=e.parent,n=new URLSearchParams(e.location.search).get(`at`);if(t!==e&&t.location.origin===e.location.origin&&/^\/whiteboard\/[^/]+\/?$/.test(t.location.pathname)&&t.location.pathname===n)return t}catch{}return e}var xp=0,Sp=0,Cp=new Set;function wp(){Sp||xp>0||Cp.size===0||(Sp=requestAnimationFrame(()=>{if(Sp=0,xp>0)return;let e=[...Cp];Cp.clear();for(let t of e)t()}))}function Tp(){return xp+=1,()=>{--xp,wp()}}function Ep({label:e}){return(0,Y.useEffect)(Tp,[]),(0,J.jsx)(o,{stack:!0,label:e,size:32})}var Dp=new Set;function Op(e){return Dp.add(e),()=>{Dp.delete(e)}}function kp(e){for(let t of Dp)t(e)}function Ap(e){return`${e.protocol===`https:`?`wss`:`ws`}://${e.host}/ws?at=${encodeURIComponent(e.pathname)}`}function jp(e,t){let[n,r]=(0,Y.useState)(!1),i=(0,Y.useRef)({onMessage:e,onOpen:t}),a=(0,Y.useRef)(null),o=(0,Y.useRef)([]);return i.current={onMessage:e,onOpen:t},(0,Y.useEffect)(()=>{let e=null,t,n=!1,s=()=>{e=new WebSocket(Ap(location)),a.current=e,e.onopen=()=>{r(!0);for(let t of o.current.splice(0))e?.send(t);i.current.onOpen?.()},e.onclose=()=>{r(!1),n||(t=setTimeout(s,1e3))},e.onmessage=e=>{let t=JSON.parse(String(e.data));i.current.onMessage(t),kp(t)}};return s(),()=>{n=!0,clearTimeout(t),e?.close()}},[]),{live:n,send:(0,Y.useCallback)(e=>{let t=a.current,n=JSON.stringify(e);t?.readyState===WebSocket.OPEN?t.send(n):o.current.length<50&&o.current.push(n)},[])}}function Mp(){let[e,t]=(0,Y.useState)([]);return(0,Y.useEffect)(()=>{let e=null,n,r=!1,i=()=>{e=new WebSocket(Ap(location)),e.onmessage=e=>{let n=JSON.parse(String(e.data));n.type===`agent-status`&&t(n.sessions)},e.onclose=()=>{t([]),r||(n=setTimeout(i,1e3))}};return i(),()=>{r=!0,clearTimeout(n),e?.close()}},[]),e}var Np=(0,Y.lazy)(()=>r(async()=>{let{AgentStatusPill:e}=await import(`./AgentStatusPill-B2LrXApc.js`);return{AgentStatusPill:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url).then(({AgentStatusPill:e})=>({default:e})));function Pp({artifact:e}){let t=Mp();return t.length===0?null:(0,J.jsx)(Y.Suspense,{fallback:null,children:(0,J.jsx)(Np,{artifact:e,sessions:t})})}var Fp=1e3,Ip=`ryugi:embed:hello`,Lp=`ryugi:embed:heartbeat`,Rp=`ryugi:embed:painted`,zp=`ryugi:embed:position`,Bp=`ryugi:embed:positioned`;function Vp({parentOrigin:e,onPosition:t,win:n=window}){let r=(t,r)=>n.parent.postMessage({type:t,...r},e),i=i=>{if(i.origin!==e||i.source!==n.parent)return;let a=i.data;a?.type===zp&&a.anchor&&t&&t(a.anchor).then(()=>r(Bp))};n.addEventListener(`message`,i),r(Ip,t?{position:!0}:void 0);let a=setInterval(()=>r(Lp),Fp),o=!1;return{painted(){o||(o=!0,r(Rp))},close(){clearInterval(a),n.removeEventListener(`message`,i)}}}function Hp(e=document,t=window,n){let r=e.documentElement.dataset.ryugiEmbedParent;return r?Vp({parentOrigin:r,onPosition:n,win:t}):null}var Up=()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e()))),Wp=e=>(we(e),Up()),Gp=(0,Y.createContext)(()=>{});function Kp(){let e=(0,Y.useRef)(null),t=(0,Y.useRef)(!1);return(0,Y.useEffect)(()=>{let n=Hp(document,window,Wp);return e.current=n,t.current&&n?.painted(),()=>{n?.close(),e.current=null}},[]),(0,Y.useCallback)(()=>{t.current=!0,e.current?.painted()},[])}function qp(e){let t=(0,Y.useContext)(Gp);(0,Y.useEffect)(()=>{if(!e)return;let n=0,r=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>{t(),Ae()&&Ne({kind:`painted`})})});return()=>{cancelAnimationFrame(r),cancelAnimationFrame(n)}},[e,t])}var Jp=(0,Y.createContext)(null);function Yp({pageWindow:e,children:t}){return(0,J.jsx)(Jp.Provider,{value:e??null,children:t})}var Xp=()=>(0,Y.useContext)(Jp)??window,Zp=(0,Y.lazy)(()=>r(async()=>{let{AutoPublishBar:e}=await import(`./auto-publish-CPtZZlz2.js`);return{AutoPublishBar:e}},__vite__mapDeps([25,1,26,12,3,27,28,2,4,5,6,7,23]),import.meta.url).then(({AutoPublishBar:e})=>({default:e}))),Qp=(0,Y.lazy)(()=>r(async()=>{let{SettingsDialog:e}=await import(`./settings-CnSJna4w.js`);return{SettingsDialog:e}},__vite__mapDeps([29,1,30,17,3,4,5,10,2,6,7,11,12,13,31,32,33,34,35,23,36,37,27,28,18]),import.meta.url).then(({SettingsDialog:e})=>({default:e}))),$p=(0,Y.lazy)(()=>r(async()=>{let{ArtboardLayout:e}=await import(`./ArtboardLayout-DuPhmI2p.js`);return{ArtboardLayout:e}},__vite__mapDeps([38,1,10,2,3,4,5,6,7,11,12,13,39,40,41,42,43,21,16,17,44,23,45,32,46,47,14,48,31,49,50,15,51,52,53,54,34,18,55,56,9,57,35,58,26,59,60,61,27,28,36,62,63,64,65,66,67,68,33,24,69,70,71,72,73,19,20,74,75,76]),import.meta.url).then(({ArtboardLayout:e})=>({default:e}))),em=(0,Y.lazy)(()=>r(async()=>{let{ArtifactList:e}=await import(`./ArtifactList-Cp_4E7tp.js`);return{ArtifactList:e}},__vite__mapDeps([77,1,10,2,3,4,5,6,7,11,12,13,51,15,33,34,31,50,47,14,48,17,78,65,62,79,18,55,30,53,54,59,27,28,35,23,63,70,68]),import.meta.url).then(({ArtifactList:e})=>({default:e}))),tm=(0,Y.lazy)(()=>r(async()=>{let{DocumentLayout:e}=await import(`./DocumentLayout-CJoYGdTu.js`);return{DocumentLayout:e}},__vite__mapDeps([80,1,3,4,2,5,6,7]),import.meta.url).then(({DocumentLayout:e})=>({default:e}))),nm=(0,Y.lazy)(()=>r(async()=>{let{ReportLayout:e}=await import(`./ReportLayout-DjlI-WU4.js`);return{ReportLayout:e}},__vite__mapDeps([81,1,57,2,3,4,5,6,7,10,11,12,13,47,14,48,17,31,35,58,50,26,59,60,44,23,61,27,28,36,18,75,82,83,79,84,69,70,85,55,73,24,9,15,16,43,56]),import.meta.url).then(({ReportLayout:e})=>({default:e}))),rm=(0,Y.lazy)(()=>r(async()=>{let{HtmlLayout:e}=await import(`./HtmlLayout-L2YY8RF2.js`);return{HtmlLayout:e}},__vite__mapDeps([86,1,3,79,47,2,4,5,6,7,10,11,12,13,14,48,17,31,18,84,69,70,57,35,58,50,26,59,60,44,23,61,27,28,36,75]),import.meta.url).then(({HtmlLayout:e})=>({default:e}))),im=(0,Y.lazy)(()=>r(async()=>{let{SlidesLayout:e}=await import(`./SlidesLayout-DrnbCy4l.js`);return{SlidesLayout:e}},__vite__mapDeps([87,1,57,2,3,4,5,6,7,10,11,12,13,47,14,48,17,31,35,58,50,26,59,60,44,23,61,27,28,36,18,75,88,89,90,84,69,70,43,79,24,56,55,9,15,16,46,49,51,91,83,92,62,53,54,34,33,32,71,20,73,72,67,93,41,94,19,85,95]),import.meta.url).then(({SlidesLayout:e})=>({default:e}))),am=(0,Y.lazy)(()=>r(async()=>{let{VerifyLayout:e}=await import(`./VerifyLayout-Calc3qn5.js`);return{VerifyLayout:e}},__vite__mapDeps([96,1,57,2,3,4,5,6,7,10,11,12,13,47,14,48,17,31,35,58,50,26,59,60,44,23,61,27,28,36,18,97,98,99,62,49,100,91,64,65,32,54,34,101,102,92,72,103,83,93,56,55,9,15,16,78,41,40,21,24,19,20,84,22,37,89,104,66,67,68,43,105,106]),import.meta.url).then(({VerifyLayout:e})=>({default:e}))),om=(0,Y.lazy)(()=>r(async()=>{let{WhiteboardLayout:e}=await import(`./WhiteboardLayout-CAcGLV3D.js`);return{WhiteboardLayout:e}},__vite__mapDeps([107,1,108,99,2,3,4,5,6,7,10,11,12,13,47,14,48,17,31,62,58,49,100,91,64,65,32,54,34,101,90,24,61,28,45,16,21,9,15,18,56,55,23,37,52,53,83,109]),import.meta.url).then(({WhiteboardLayout:e})=>({default:e}))),sm=(0,Y.lazy)(()=>Promise.all([r(()=>import(`./split-B6eupXjE.js`),__vite__mapDeps([110,1,89,10,2,3,4,5,6,7,11,12,13,70,102,73,100,103,72,93,20,94,48,53,54,34,18,23,111,82,112,24,105,109,113]),import.meta.url),r(()=>import(`./local-split-host-Dl9rlSsp.js`).then(e=>e.n),__vite__mapDeps([88,1,89,10,2,3,4,5,6,7,11,12,13,28]),import.meta.url)]).then(([{SplitShell:e},{localSplitHost:t}])=>({default:n=>(0,J.jsx)(e,{...n,host:t})}))),cm=(0,Y.lazy)(()=>r(async()=>{let{PreviewLayout:e}=await import(`./PreviewLayout-Z9Q--w6E.js`).then(e=>e.n);return{PreviewLayout:e}},__vite__mapDeps([114,1,3,28,2,4,5,6,7,39,23]),import.meta.url).then(({PreviewLayout:e})=>({default:e}))),lm=(e,t)=>(0,J.jsxs)(J.Fragment,{children:[e,(0,J.jsx)(Zp,{}),(0,J.jsx)(Qp,{}),t&&(0,J.jsx)(Pp,{artifact:t})]});function um({id:e,type:t}){let n=Kp();return(0,J.jsx)(Gp,{value:n,children:t===`whiteboard`?(0,J.jsx)(Yp,{pageWindow:bp(),children:(0,J.jsx)(om,{id:e})}):t===`document`?(0,J.jsx)(tm,{id:e}):t===`verify`?(0,J.jsx)(am,{id:e}):t===`slides`?(0,J.jsx)(im,{id:e}):(0,J.jsx)($p,{id:e})})}function dm(){let[e]=yp(),t=a(e);if((0,Y.useEffect)(()=>{if(!document.documentElement.dataset.ryugiArtifactId)return;let e=document.querySelector(`link[rel="canonical"]`);if(!e)return;let t=new URL(location.href);t.pathname=c(t.pathname,new URL(e.href).pathname),t.href!==location.href&&history.replaceState(history.state,``,t)},[]),(0,Y.useEffect)(()=>{window.scrollTo(0,0)},[e]),t.kind===`list`)return lm((0,J.jsx)(em,{}));if(t.kind===`unknown`)return(0,J.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k x5yr21d xggk2y7 x1bo0w0s xqfszdh xif65rj`,children:`No artifact lives at this address.`});let n=document.documentElement.dataset.ryugiArtifactId??t.id;return t.kind===`preview`?(0,J.jsx)(cm,{id:n,type:t.type}):t.kind===`embed`?(0,J.jsx)(um,{id:n,type:t.type}):t.type===`html`?lm((0,J.jsx)(rm,{id:n}),`html/${n}`):t.type===`slides`?lm((0,J.jsx)(im,{id:n}),`slides/${n}`):t.type===`report`?lm((0,J.jsx)(nm,{id:n}),`report/${n}`):lm((0,J.jsx)(sm,{id:n,split:Ve(t,location.search)?.split??null,type:t.type}),`${t.type}/${n}`)}function fm(){return(0,J.jsx)(Y.Suspense,{fallback:(0,J.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k x5yr21d xggk2y7 x1bo0w0s xqfszdh xif65rj`,children:(0,J.jsx)(Ep,{label:i(`common.loading`)})}),children:(0,J.jsx)(dm,{})})}re(),document.documentElement.lang=d[s.language];function pm(){return n(),(0,J.jsx)(bl,{features:Zl,children:(0,J.jsxs)(j,{enableCustomFonts:!1,motion:Gf,children:[(0,J.jsx)(fm,{}),(0,J.jsx)(Je,{}),(0,J.jsx)(Hf,{}),(0,J.jsx)(ud,{})]})})}(0,Kf.createRoot)(document.getElementById(`root`)).render((0,J.jsx)(Y.StrictMode,{children:(0,J.jsx)(pm,{})}));export{Ep as a,X as c,Qu as d,Wu as f,Wa as h,jp as i,Ku as l,tu as m,qp as n,Bf as o,Lu as p,Op as r,dd as s,Xp as t,Gu as u};
|