ryugi-artifacts 1.102.1 → 1.102.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +5 -5
- package/dist/server.cjs +1 -1
- package/dist/viewer/{ArtboardLayout-Csu2pQ-T.js → ArtboardLayout-BEcgcFOd.js} +12 -12
- package/dist/viewer/CommentPopover-C3k2ys-1.js +1 -0
- package/dist/viewer/{DocumentLayout-Byaaj0lf.js → DocumentLayout-sTWNaA3o.js} +2 -2
- package/dist/viewer/{DocumentPage-CrVLG3xw.js → DocumentPage-latIEoTp.js} +1 -1
- package/dist/viewer/{PreviewArtifactLayout-BKcZov33.js → PreviewArtifactLayout-CqXcOdxK.js} +1 -1
- package/dist/viewer/{PreviewLayout-h2V6IEPR.js → PreviewLayout-AYrRaL1J.js} +2 -2
- package/dist/viewer/{ReportLayout-C1A2NXor.js → ReportLayout-BlpuIdHN.js} +1 -1
- package/dist/viewer/{SlidesLayout-_aL_Wmn0.js → SlidesLayout-Cg-ZL9W5.js} +6 -6
- package/dist/viewer/{SnapshotDocument-BmyM7kKr.js → SnapshotDocument-B40GdnPe.js} +1 -1
- package/dist/viewer/{StoryboardLayout-DWmYoJbh.js → StoryboardLayout-C2-18dzZ.js} +1 -1
- package/dist/viewer/{ThreadView-uYestFjK.js → ThreadView-CqtHFrk_.js} +1 -1
- package/dist/viewer/{VerifyLayout-D3L_Nyhx.js → VerifyLayout-DNAp5mGi.js} +1 -1
- package/dist/viewer/{VirtualizedEditor-uWe43zaI-BRjchUcR.js → VirtualizedEditor-uWe43zaI-DDsyAsfh.js} +1 -1
- package/dist/viewer/{VirtualizedRenderer-C_d95FXi-BiKuicf_.js → VirtualizedRenderer-C_d95FXi-Vq_z2yPz.js} +1 -1
- package/dist/viewer/WhiteboardLayout-BuyJEwNS.js +4 -0
- package/dist/viewer/{channel-BzQy5yb9.js → channel-WsGYBJN3.js} +3 -3
- package/dist/viewer/{dist-DJbqyYbr.js → dist-BKx2i2Bp.js} +1 -1
- package/dist/viewer/{dist-DSiP1sno.js → dist-BPLTpQo5.js} +1 -1
- package/dist/viewer/{dist-DxrXYjGy.js → dist-BtjjxT9L.js} +1 -1
- package/dist/viewer/{dist-BL7gVqxi.js → dist-C-XNmR5I.js} +1 -1
- package/dist/viewer/{dist-ChnAy31A.js → dist-CD6D4M-i.js} +1 -1
- package/dist/viewer/{dist-r4fmjkHw.js → dist-CSxMxiKd.js} +1 -1
- package/dist/viewer/{dist-Ckvl87v1.js → dist-Cavovuxi.js} +1 -1
- package/dist/viewer/{dist-BI7tUIez.js → dist-ClPH_mrv.js} +1 -1
- package/dist/viewer/{dist-DrVA7ut5.js → dist-Cv9nQ9De.js} +1 -1
- package/dist/viewer/{dist-CO1p9q1Z.js → dist-CyV0Zg_e.js} +1 -1
- package/dist/viewer/{dist-CVt5MFeC.js → dist-D1Rtkih1.js} +1 -1
- package/dist/viewer/{dist-B4EO2CPv.js → dist-DF7PCGc5.js} +1 -1
- package/dist/viewer/{dist-EEnCrnE5.js → dist-DJN0mLSv.js} +1 -1
- package/dist/viewer/{dist-CaBa68Xm.js → dist-DOAwS2QX.js} +1 -1
- package/dist/viewer/{dist-j0019Ujc.js → dist-DPRR6AvE.js} +1 -1
- package/dist/viewer/{dist-DBpGO_S5.js → dist-DQMC6coB.js} +1 -1
- package/dist/viewer/{dist-jEPSRJix.js → dist-DVeGz6Hn.js} +2 -2
- package/dist/viewer/{dist-Cdwc8_lc.js → dist-DWGWdalI.js} +1 -1
- package/dist/viewer/{dist-BHAJ5J6a.js → dist-SlN5ZzHW.js} +1 -1
- package/dist/viewer/{dist-DCj5-otB.js → dist-V5zBu8zr.js} +1 -1
- package/dist/viewer/{dist-Bo83M38T.js → dist-g2vfBPfC.js} +1 -1
- package/dist/viewer/{dist-BP8ay-gZ.js → dist-ghwddng4.js} +1 -1
- package/dist/viewer/{dist-B8JYmYN_.js → dist-nqwTHxZV.js} +1 -1
- package/dist/viewer/{dist-UhLZmzFt.js → dist-oWcL-DZu.js} +1 -1
- package/dist/viewer/{editor-2avuG1le.js → editor-BfOKfIhz.js} +4 -4
- package/dist/viewer/index.js +2 -2
- package/dist/viewer/index5.css +0 -4
- package/dist/viewer/preview.html +1 -1
- package/dist/viewer/preview.js +1 -1
- package/dist/viewer/{printDocument-Bob6oDU4.js → printDocument-DatfOXhT.js} +1 -1
- package/dist/viewer/{viewport-CFJHn_Y6-NgtbO-g_.js → viewport-CFJHn_Y6-C6DdguJp.js} +1 -1
- package/package.json +1 -1
- package/dist/viewer/WhiteboardLayout-BwzWcl_v.js +0 -4
package/dist/viewer/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AgentStatusPill-Dr0IG63t.js","./rolldown-runtime-XKyaHtl9.js","./route-CkVEiakc.js","./bem-vbke-3KC.js","./react-DlmbjZJV.js","./jsx-runtime-LKYXHABd.js","./types-DAs-xbqr.js","./index2.css","./PhoneSheet-RzYP9raH.js","./labels-6JqNXprT.js","./url-64-774qp.js","./mergeRefs-BoWyGCK7.js","./MotionConfigContext-B3czw3wn.js","./useLayerZIndex-t4BgGwYi.js","./is-html-element-DvgHo_1h.js","./arrow-up-kdcWAnXX.js","./stable-DqmWGuUk.js","./icons-DWimed9E.js","./Center-BYaMwBHF.js","./index5.css","./BottomSheet-wczv_s4I.js","./motion-Cy65kd7X.js","./tokens.stylex-No4bA13s.js","./read-resolutions-iX7kD7Xz.js","./useTranslation-ByuUeDLl.js","./useMedia-CFebB4XU.js","./auto-publish-I637YfTf.js","./cloud-upload-DClbwO_k.js","./useCloudStatus-BngR4Pm7.js","./api-DnU71xnS.js","./settings-i1xE8pA8.js","./Avatar-OGhW38pt.js","./isElementDisabled-DWHaZxJe.js","./maximize-2-BEWXAYRs.js","./Segmented-DWi3WMbI.js","./CompositeItem-BLrDOuic.js","./urls-YNuHd8vV.js","./CloudLegalNotice-9Jrnaiz1.js","./preference-oNdcNeml.js","./ArtboardLayout-
|
|
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-CkVEiakc.js";/* empty css */import{$ as f,An as p,Ar as m,At as h,Bt as g,Cr as _,Ct as v,D as y,Dn as b,Dt as x,Et as S,Fn as C,Ft as w,Gn as T,Gt as E,H as D,Ht as O,It as k,Jn as A,Kt as j,Ln as M,Lt as ee,Mt as te,Nn as N,Nt as ne,Ot as re,Pn as ie,Pt as ae,Q as oe,Rn as se,S as ce,Sr as le,St as ue,T as de,Tr as fe,Tt as pe,U as me,Ut as P,Vt as he,W as ge,Wn as _e,Wt as ve,_t as ye,at as F,bn as be,bt as xe,dt as Se,et as Ce,ft as we,gt as Te,h as Ee,ht as De,ir as Oe,it as ke,jn as Ae,jt as je,kt as Me,l as Ne,m as Pe,mt as Fe,nt as Ie,on as Le,ot as I,pt as Re,qn as ze,r as Be,rt as Ve,st as He,tt as Ue,vn as We,vt as Ge,wr as Ke,wt as qe,x as Je,xn as Ye,xr as Xe,xt as Ze,yn as Qe,yt as $e,zt as et}from"./url-64-774qp.js";import{$ as tt,K as nt,Q as rt,U as it,at as L,c as at,ct as ot,it as st,l as ct,o as lt,ot as R,r as ut,rt as dt,s as ft,u as pt}from"./mergeRefs-BoWyGCK7.js";import{n as mt,r as z,t as ht}from"./bem-vbke-3KC.js";import{t as gt}from"./react-DlmbjZJV.js";import{Dn as _t,Ft as vt,J as yt,Jn as bt,Mt as xt,Nt as St,Q as Ct,Rn as wt,Tn as Tt,Vt as Et,an as Dt,b as Ot,bn as kt,g as At,in as jt,n as Mt,on as Nt,rn as Pt,t as Ft,wn as It,x as Lt}from"./useLayerZIndex-t4BgGwYi.js";import{t as Rt}from"./jsx-runtime-LKYXHABd.js";import{$ as zt,B as Bt,Ct as Vt,G as Ht,I as Ut,J as Wt,M as Gt,N as Kt,P as qt,St as Jt,Tt as Yt,U as B,W as V,_t as Xt,a as Zt,bt as Qt,c as $t,ct as en,d as tn,dt as H,et as nn,gt as rn,h as an,ht as on,i as sn,l as cn,m as ln,mt as un,o as dn,p as fn,r as pn,s as mn,st as hn,t as gn,u as _n,ut as vn,wt as yn,xt as bn}from"./MotionConfigContext-B3czw3wn.js";import{$ as xn,$n as Sn,$t as Cn,A as wn,An as Tn,At as En,B as Dn,Bn as On,Bt as kn,C as An,Cn as jn,Cr as Mn,Ct as Nn,D as Pn,Dn as Fn,Dt as In,E as Ln,En as Rn,Et as zn,F as Bn,Fn as Vn,Ft as Hn,G as Un,Gn as Wn,Gt as Gn,H as Kn,Hn as qn,Ht as Jn,I as Yn,In as Xn,It as Zn,J as Qn,Jn as $n,Jt as er,K as tr,Kn as nr,Kt as rr,L as ir,Ln as ar,Lt as or,M as sr,Mn as cr,Mt as lr,N as ur,Nn as dr,Nt as fr,O as pr,On as mr,Ot as hr,P as gr,Pn as _r,Pt as vr,Q as yr,Qn as br,Qt as xr,R as Sr,Rn as Cr,Rt as wr,S as Tr,Sn as Er,Sr as Dr,St as Or,T as kr,Tn as Ar,Tr as jr,Tt as Mr,U as Nr,Un as Pr,Ut as Fr,V as Ir,Vn as Lr,Vt as Rr,W as zr,Wn as Br,Wt as Vr,X as Hr,Xn as Ur,Xt as Wr,Y as Gr,Yn as Kr,Yt as qr,Z as Jr,Zn as Yr,Zt as Xr,_ as Zr,_n as Qr,_r as $r,_t as ei,a as ti,an as ni,ar as ri,at as ii,b as ai,bn as oi,br as U,bt as si,c as ci,cn as li,cr as ui,ct as di,d as fi,dn as pi,dr as mi,dt as hi,en as gi,er as _i,et as vi,f as yi,fn as bi,fr as xi,ft as Si,g as Ci,gn as wi,gr as Ti,gt as Ei,h as Di,hn as Oi,ht as ki,i as Ai,in as ji,ir as Mi,it as Ni,j as Pi,jn as Fi,jt as Ii,k as Li,kn as Ri,kt as zi,l as Bi,ln as Vi,lr as Hi,lt as Ui,m as Wi,mn as Gi,mt as Ki,n as qi,nn as Ji,nr as Yi,nt as Xi,o as Zi,on as Qi,or as $i,ot as ea,p as ta,pn as na,pt as ra,q as ia,qn as aa,qt as oa,r as sa,rn as ca,rr as la,rt as ua,s as da,sn as fa,sr as pa,st as ma,t as ha,tn as ga,tr as _a,tt as va,u as ya,un as ba,ur as xa,ut as Sa,v as Ca,vn as wa,vr as Ta,vt as Ea,w as Da,wn as Oa,wr as ka,wt as Aa,x as ja,xn as Ma,xr as Na,xt as Pa,y as Fa,yn as Ia,yr as La,yt as Ra,z as za,zn as Ba,zt as Va}from"./elements-Coqr6-Yv.js";import{t as Ha}from"./is-html-element-DvgHo_1h.js";var Ua={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`]};Ua.node;var Wa=Yt(Ua),Ga={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`]};Ga.node;var Ka=Yt(Ga);function qa(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 Ja(e,t,n){return jr(e.getProps(),t,n,e)}var Ya=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Xa=e=>Array.isArray(e);function Za(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ln(n))}function Qa(e){return Xa(e)?e[e.length-1]||0:e}function $a(e,t){let{transitionEnd:n={},transition:r={},...i}=Ja(e,t)||{};i={...i,...n};for(let t in i)Za(e,t,Qa(i[t]))}function eo(e){return!!(tn(e)&&e.add)}function to(e,t){let n=e.getValue(`willChange`);if(eo(n))return n.add(t);if(!n&&Qt.WillChange){let n=new Qt.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function no(e){return e.props[ka]}var ro=typeof window<`u`;function io({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function ao(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?ee(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&&io(f,t))continue;let o={delay:n,...k(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(ro&&window.MotionHandoffAnimation){let n=no(e);if(n){let e=window.MotionHandoffAnimation(n,t,V);e!==null&&(o.startTime=e,p=!0)}}to(e,t);let m=l??e.shouldReduceMotion;r.run(w(t,r,i,m&&ne.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>V.update(()=>{o&&$a(e,o)});d.length?Promise.all(d).then(t):t()}return d}function oo(e,t,n={}){let r=Ja(e,t,Ya(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?ao(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(oo(e,t,{...n,delay:r+(typeof o==`function`?0:o)+qa(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 so(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>oo(e,t,n))):typeof t==`string`?oo(e,t,n):Promise.all(ao(e,Ja(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var co=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],lo={value:null,addProjectionMetrics:null,countProjection:void 0};function uo(e,t){let n=vn.now();e=h(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(B(r),e(a-t))};return V.setup(r,!0),Me(()=>B(r))}function fo(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function po(e){return je(e)&&e.tagName===`svg`}var mo=e=>typeof e==`number`?e:parseFloat(e),ho=co.length,go=e=>typeof e==`number`||nn.test(e);function _o(e,t,n,r,i,a){i?(e.opacity=P(0,n.opacity??1,yo(r)),e.opacityExit=P(t.opacity??1,0,bo(r))):a&&(e.opacity=P(t.opacity??1,n.opacity??1,r));for(let i=0;i<ho;i++){let a=co[i],o=vo(t,a),s=vo(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||go(o)===go(s)?(e[a]=Math.max(P(mo(o),mo(s),r),0),(zt.test(s)||zt.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<xe.length;i++){let a=xe[i];(t[a]||n[a])&&(e[a]=P(t[a]||0,n[a]||0,r))}}function vo(e,t){return e[t]===void 0?e.borderRadius:e[t]}var yo=xo(0,.5,ve),bo=xo(.5,.95,Xt);function xo(e,t,n){return r=>r<e?0:r>t?1:n(E(e,t,r))}var So=(e,t,{x:n,y:r})=>{let i=e*e+t*t;return i<1?0:-1e3*(n*e+r*t)/i},Co=(e,t=300)=>{let n=bn(.25,2,t/300),{stiffness:r,damping:i}=g({...e,duration:e.duration&&on(e.duration)});return{...e,stiffness:r,damping:i*Math.sqrt(n),mass:n}};function wo(e,t){e.min=t.min,e.max=t.max}function W(e,t){wo(e.x,t.x),wo(e.y,t.y)}function To(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Eo=.9999,Do=1.0001,Oo=-.01,ko=.01;function G(e){return e.max-e.min}function Ao(e,t,n){return Math.abs(e-t)<=n}function jo(e,t,n,r=.5){e.origin=r,e.originPoint=P(t.min,t.max,e.origin),e.scale=G(n)/G(t),e.translate=P(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Eo&&e.scale<=Do||isNaN(e.scale))&&(e.scale=1),(e.translate>=Oo&&e.translate<=ko||isNaN(e.translate))&&(e.translate=0)}function Mo(e,t,n,r){jo(e.x,t.x,n.x,r?.originX),jo(e.y,t.y,n.y,r?.originY)}function No(e,t,n,r=0){e.min=(r?P(n.min,n.max,r):n.min)+t.min,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=0){let i=r?P(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+G(t)}function Io(e,t,n,r){Fo(e.x,t.x,n.x,r?.x),Fo(e.y,t.y,n.y,r?.y)}function Lo(e,t,n,r,i){return e-=t,e=ye(e,1/n,r),i!==void 0&&(e=ye(e,1/i,r)),e}function Ro(e,t=0,n=1,r=.5,i,a=e,o=e){if(zt.test(t)&&(t=parseFloat(t),t=P(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=P(a.min,a.max,r);e===a&&(s-=t),e.min=Lo(e.min,t,n,s,i),e.max=Lo(e.max,t,n,s,i)}function zo(e,t,[n,r,i],a,o){Ro(e,t[n],t[r],t[i],t.scale,a,o)}var Bo=[`x`,`scaleX`,`originX`],Vo=[`y`,`scaleY`,`originY`];function Ho(e,t,n,r){zo(e.x,t,Bo,n?.x,r?.x),zo(e.y,t,Vo,n?.y,r?.y)}var Uo=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Wo=Uo(`applewebkit/`)&&!Uo(`chrome/`)?Math.round:Xt;function Go(e){e.min=Wo(e.min),e.max=Wo(e.max)}function Ko(e){Go(e.x),Go(e.y)}function qo(e){return e.translate===0&&e.scale===1}function Jo(e){return qo(e.x)&&qo(e.y)}function Yo(e,t){return e.min===t.min&&e.max===t.max}function Xo(e,t){return Yo(e.x,t.x)&&Yo(e.y,t.y)}function Zo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Qo(e,t){return Zo(e.x,t.x)&&Zo(e.y,t.y)}function $o(e){return G(e.x)/G(e.y)}function es(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var ts=class{constructor(){this.members=[]}add(e){Jt(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||(yn(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(yn(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 ns(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var rs={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(nn.test(e))e=parseFloat(e);else return e}return`${ns(e,t.target.x)}% ${ns(e,t.target.y)}%`}},is={borderRadius:Object.assign({},rs,{applyTo:co.slice()}),borderTopLeftRadius:rs,borderTopRightRadius:rs,borderBottomLeftRadius:rs,borderBottomRightRadius:rs,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Wt.parse(e);if(i.length>5)return r;let a=Wt.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=P(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 as(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<xe.length;e++){let t=xe[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 os=(e,t)=>e.depth-t.depth,ss=class{constructor(){this.children=[],this.isDirty=!1}add(e){Jt(this.children,e),this.isDirty=!0}remove(e){yn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(os),this.isDirty=!1,this.children.forEach(e)}},cs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ls=[`z`,`skew`,`skewZ`],us=1e3,ds=0;function fs(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var ps=e=>e.instance&&an.get(e.instance)?.demote()&&e.resetSkewAndRotation();function ms(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=no(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&&ms(r)}function hs(e){if(e)return e.options.allowProjection===!1?hs(e.parent):e.projection}function gs({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(Mn,{...is,...Mn}),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:hs(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&fo(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=ds++,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(ys),this.nodes.forEach(As),this.nodes.forEach(js),this.nodes.forEach(bs),lo.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 ss)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new rn),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=je(t)&&!po(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=uo(i,250),cs.hasAnimatedSinceResize&&(cs.hasAnimatedSinceResize=!1,this.nodes.forEach(ks)))})}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()||Rs,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!Qo(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={...k(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||ks(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(Ms),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&&ms(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;ps(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,ps(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(Cs),this.nodes.forEach(Ss);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ws);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Es),this.nodes.forEach(Ds),this.nodes.forEach(Os),this.nodes.forEach(_s),this.nodes.forEach(vs)):this.nodes.forEach(ws),this.clearAllSnapshots();let e=vn.now();H.delta=bn(0,1e3/60,e-H.timestamp),H.timestamp=e,H.isProcessing=!0,Ht.update.process(H),Ht.preRender.process(H),Ht.render.process(H),H.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,mn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(xs),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&&ps(this);let t=this.projectionDelta&&!Jo(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||qe(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)),Ko(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(Vs))){let{scroll:e}=this.root;e&&($e(t.x,e.offset.x),$e(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),$e(t.x,i.offset.x),$e(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&&($e(a.x,-n.scroll.offset.x),$e(a.y,-n.scroll.offset.y)),qe(n.latestValues)&&Ge(a,n.latestValues,n.layout?.layoutBox)}return!r&&qe(this.latestValues)&&Ge(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(!qe(n.latestValues))continue;let r;n.instance&&(v(n.latestValues)&&n.updateSnapshot(),r=U(),W(r,n.measurePageBox())),Ho(t,n.latestValues,n.snapshot?.layoutBox,r)}return qe(this.latestValues)&&Ho(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(),Po(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),De(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),lo.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||v(this.parent.latestValues)||Ze(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(),Io(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;Te(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():(To(this.prevProjectionDelta.x,this.projectionDelta.x),To(this.prevProjectionDelta.y,this.projectionDelta.y)),Mo(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&es(this.projectionDelta.x,this.prevProjectionDelta.x)&&es(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),lo.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=Na(),this.projectionDelta=Na(),this.projectionDeltaWithTransform=Na()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Na();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(Ls));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?So(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?Ns(o[r],e[r],this.layout.layoutBox[r],l[t*2],l[t*2+1]):Ps(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){Io(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);let e=this.relativeTargetOrigin,t=s;if(Is(this.relativeTarget,e,t,n),this.isSpringLayout){let e=this.relativeTarget,t=this.impulse||0,n=this.relativeStart,r=vn.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&&Xo(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=U(),W(f,this.relativeTarget)}c&&(this.animationValues=a,_o(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(()=>{cs.hasAnimatedSinceResize=!0,this.motionValue||=ln(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=Co(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)=>he({...r,keyframes:n?[e[n-1],0]:r.keyframes,velocity:t})),a=i.length;t&&i.push(he({...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=O(c),c.next(0),this.edgeVelocity=e=>i[e+1].velocity(o),c}}}}}let a=Se(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,Bt(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?.(us),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&&Bs(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||U(),zs(i.x,t.x,e.x),zs(i.y,t.y,e.y)}W(t,i),Ge(t,r),Mo(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ts),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(!ue(t))return;let n={};for(let t=0;t<ls.length;t++)fs(ls[t],e,n,this.animationValues);for(let t=0;t<xe.length;t++)fs(xe[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=Dr(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=Dr(t?.pointerEvents)||``),this.hasProjected&&!qe(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=as(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 Mn){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=Mn[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?Dr(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(Ss),this.root.sharedNodes.clear()}}}function _s(e){e.updateLayout(),Ts(e)}function vs(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`;wo(r[e],a[e])}else Bs(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=Na();Mo(c,n,t.layoutBox);let l=Na();Mo(l,a?e.applyTransform(r,!0):n,s);let u=!Jo(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();Io(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=U();Io(l,n,i.layoutBox,s),a&&o(c,l),Qo(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 ys(e){lo.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 bs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function xs(e){e.clearSnapshot()}function Ss(e){e.clearMeasurements()}function Cs(e){e.isLayoutDirty=!0,e.updateLayout()}function ws(e){e.isLayoutDirty=!1}function Ts(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=>$e(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function Es(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Ds(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Os(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function ks(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function As(e){e.resolveTargetDelta()}function js(e){e.calcProjection()}function Ms(e){e.resetSkewAndRotation()}function Ns(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 Ps(e,t,n){e.translate=P(t.translate,0,n),e.scale=P(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Fs(e,t,n,r){e.min=P(t.min,n.min,r),e.max=P(t.max,n.max,r)}function Is(e,t,n,r){Fs(e.x,t.x,n.x,r),Fs(e.y,t.y,n.y,r)}function Ls(e){return e.animationValues?.opacityExit!==void 0}var Rs={duration:.45,ease:[.4,0,.1,1]};function zs(e,t,n){e.max=G(n)+(e.min=t.min)}function Bs(e,t,n){return e===`position`||e===`preserve-aspect`&&!Ao($o(t),$o(n),.2)}function Vs(e){return e!==e.root&&e.scroll?.wasRoot}function Hs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Us=gs({attachResizeListener:(e,t)=>Hs(e,`resize`,t),measureScroll:we,checkIsScrollRoot:()=>!0}),Ws=gs({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!La.current){let e=new Us({});e.mount(window),e.setOptions({layoutScroll:!0}),La.current=e}return La.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Gs=class extends xi{constructor(){super(...arguments),this.KeyframeResolver=te}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;tn(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ks(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 qs(e){return window.getComputedStyle(e)}var Js=class extends Gs{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ks}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Gt.has(t))return this.projection?.isProjecting?Kt(t):qt(e,t);{let n=qs(e),r=(hn(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Fe(e,t)}build(e,t,n){_n(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return mi(e,t,n)}},Ys=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Xs(e){return{point:{x:e.pageX,y:e.pageY}}}var Zs=e=>t=>Ys(t)&&e(t,Xs(t));function Qs(e,t,n,r){return Hs(e,t,Zs(n),r)}var $s=new WeakMap,ec,tc=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:je(r)&&`getBBox`in r?r.getBBox()[t]:r[n],nc=tc(`inline`,`width`,`offsetWidth`),rc=tc(`block`,`height`,`offsetHeight`);function ic({target:e,borderBoxSize:t}){$s.get(e)?.forEach(n=>{n(e,{get width(){return nc(e,t)},get height(){return rc(e,t)}})})}function ac(e){e.forEach(ic)}function oc(){typeof ResizeObserver<`u`&&(ec=new ResizeObserver(ac))}function sc(e,t){ec||oc();let n=re(e);return n.forEach(e=>{let n=$s.get(e);n||(n=new Set,$s.set(e,n)),n.add(t),ec?.observe(e)}),()=>{n.forEach(e=>{let n=$s.get(e);n?.delete(t),n?.size||ec?.unobserve(e)})}}var cc=new Set,lc;function uc(){lc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};cc.forEach(t=>t(e))},window.addEventListener(`resize`,lc)}function dc(e){return cc.add(e),lc||uc(),()=>{cc.delete(e),!cc.size&&typeof lc==`function`&&(window.removeEventListener(`resize`,lc),lc=void 0)}}function fc(e,t){return Me(typeof e==`function`?dc(e):sc(e,t))}var pc=(e,t)=>Math.abs(e-t);function mc(e,t){let n=pc(e.x,t.x),r=pc(e.y,t.y);return Math.sqrt(n**2+r**2)}var hc=new Set([`auto`,`scroll`]),gc=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=vc(this.lastRawMoveEventInfo,this.transformPagePoint));let e=bc(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=mc(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:vn.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=vc(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=bc(e.type===`pointercancel`?this.lastMoveEventInfo:vc(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!Ys(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=s?0:a,this.contextWindow=r||window;let c=Xs(e),l=vc(c,this.transformPagePoint),{point:u}=l;this.history=[{...u,timestamp:vn.now()}];let{onSessionStart:d}=t;d&&d(e,bc(l,this.history));let f={passive:!0,capture:!0};this.removeListeners=j(Qs(this.contextWindow,`pointermove`,this.handlePointerMove,f),Qs(this.contextWindow,`pointerup`,this.handlePointerUp,f),Qs(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);(hc.has(e.overflowX)||hc.has(e.overflowY))&&this.scrollPositions.set(t,_c(t)),t=t.parentElement}this.scrollPositions.set(window,_c(window)),this.removeScrollListeners=j(Hs(window,`scroll`,this.onElementScroll,{capture:!0}),Hs(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=_c(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)}},_c=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function vc(e,t){return t?{point:t(e.point)}:e}function yc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bc({point:e},t){return{point:e,delta:yc(e,Sc(t)),offset:yc(e,xc(t)),velocity:Cc(t,.1)}}function xc(e){return e[0]}function Sc(e){return e[e.length-1]}function Cc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Sc(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>on(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>on(t)*2&&(r=e[1]);let a=un(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 wc=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Tc(e){return wc.has(e.tagName)||e.isContentEditable===!0}var Ec=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Dc(e){return Ec.has(e.tagName)||e.isContentEditable===!0}var q={x:!1,y:!1};function Oc(){return q.x||q.y}function kc(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 Ac(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?P(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?P(n,e,r.max):Math.min(e,n)),e}function jc(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 Mc(e,{top:t,left:n,bottom:r,right:i}){return{x:jc(e.x,n,i),y:jc(e.y,t,r)}}function Nc(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 Pc(e,t){return{x:Nc(e.x,t.x),y:Nc(e.y,t.y)}}function Fc(e,t){let n=.5,r=G(e),i=G(t);return i>r?n=E(t.min,t.max-r,e.min):r>i&&(n=E(e.min,e.max-i,t.min)),bn(0,1,n)}function Ic(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 Lc=.35;function Rc(e=Lc){return e===!1?e=0:e===!0&&(e=Lc),{x:zc(e,`left`,`right`),y:zc(e,`top`,`bottom`)}}function zc(e,t,n){return{min:Bc(e,t),max:Bc(e,n)}}function Bc(e,t){return typeof e==`number`?e:e[t]||0}function Vc(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 Hc=new WeakMap,Uc=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=kc(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(en(t)&&(t=ae(t,this.visualElement.current)||0),nn.test(t))t=parseFloat(t);else if(zt.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),to(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=Yc(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 gc(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||!Jc(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Ac(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;Wc(e)?this.constraints&&this.scroll===Vc(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?Mc(r.layoutBox,e):!1,this.elastic=Rc(t),i!==this.constraints&&!Wc(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&K(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Ic(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!Wc(e))return!1;let n=Gc(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Vc(r);let i=Re(n,r.root,this.visualElement.getTransformPagePoint()),a=Pc(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(S(a));this.hasMutatedConstraints=!!e,e&&(a=pe(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)&&Jc(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(!Jc(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 to(this.visualElement,e),n.start(w(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(!Jc(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-P(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Wc(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]=Fc({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(!Jc(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(P(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Hc.set(this.visualElement,this);let e=this.visualElement.current,t=Qs(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Dc(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=Wc(t)&&Gc(t);r&&(this.constraints=this.resolveRefConstraints(),n||=qc(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=Hs(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(K(t=>{if(!Jc(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=Lc,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function Wc(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Gc=e=>`current`in e?e.current:e;function Kc(e){let t=!0;return()=>{t?t=!1:e()}}function qc(e,t,n){let r=fc(e,Kc(n)),i=fc(t,Kc(n));return()=>{r(),i()}}function Jc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Yc(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Xc(e,t){let n=re(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Me(()=>r.abort())]}function Zc(e){return!(e.pointerType===`touch`||Oc())}function Qc(e,t,n={}){t=h(t);let[r,i,a]=Xc(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(!Zc(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 $c=(e,t)=>t?e===t||$c(e,t.parentElement):!1,el=new WeakSet;function tl(e){return t=>{t.key===`Enter`&&e(t)}}function nl(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var rl=(e,t)=>{let n=!1,r=tl(()=>{n||el.has(e)||(n=!0,nl(e,`down`))}),i=tl(()=>{n&&(n=!1,nl(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&nl(e,`cancel`)},{...t,once:!0})};function il(e){return Ys(e)&&!Oc()}var al=new WeakSet,ol=100,sl=8,cl=(e,t,n)=>Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)>n,ll=e=>e.preventDefault();function ul(e,t,n={}){t=h(t);let[r,i,a]=Xc(e,n),o=new WeakMap,s=e=>{let r=e.currentTarget;if(!il(e)||al.has(e))return;n.stopPropagation&&al.add(e);let{count:a=1,countTimeout:s=.3,hold:c=0,repeat:l}=n,u=vn.now(),d=on(c),f=on(s),p=o.get(r);p?.expire(cl(p.event,e,ol))?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(el.add(r),p)y=p.handlers;else{let n=t(r,e);y=typeof n==`function`?{onComplete:n}:n||{}}h&&_&&y.onActive?.();let b=on(l),x=d||b,S=u+x,C=!0,w=()=>{if(i.signal.aborted)return B(w);let e=Math.min(1-(S-vn.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(Ys(t)){if(window.removeEventListener(`pointerup`,D,T),window.removeEventListener(`pointercancel`,O,T),window.removeEventListener(`pointermove`,k,T),r.removeEventListener(`contextmenu`,ll),B(w),el.delete(r),Oc()&&(n=!1),n&&!h){let n=vn.now(),a=e=>{let s=i.signal.aborted;if(s||e===!0||vn.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||$c(r,e.target))},O=e=>{E(e,!1)},k=t=>{Ys(t)&&((l||!_)&&cl(e,t,sl)||a>1&&Oc())&&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`,ll,{...i,passive:!1}))};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,s,i),Ha(e)&&(e.addEventListener(`focus`,()=>rl(e,i),i),!Tc(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function dl(...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=et(i,a,o);return t?s(r):s}var fl=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},pl=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 ml(e,t,n,r){Ks(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(pl.has(n)?n:x(n),t.attrs[n])}var hl=class extends Gs{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=U}getBaseTargetFromProps(e,t){return Gt.has(t)?super.getBaseTargetFromProps(e,t)??Kt(t):e[t]}getDefaultValue(e){return Gt.has(e)?this.latestValues[e]??Kt(e):void 0}readValueFromInstance(e,t){if(Gt.has(t)){let e=Ut(t);return e&&e.default||0}if(cn.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=pl.has(t)?t:x(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Hi(e,t,n)}build(e,t,n){$t(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){ml(e,t,n,r)}mount(e){this.isSVGTag=xa(e.tagName),super.mount(e)}};function gl(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 _l=[...Ti].reverse(),vl=e=>e?.out===!0?e:e?.out;function yl(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>so(e,t,n))),n=xl(),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`&&Ja(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&&vl(f(l??(g&&g.props.initial))?.transition);if(_l.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?$r(f)||f===!1?f:void 0:l,y=$r(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||Ta(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=bl(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}=Ja(e,n,Ya(e,t))||{};E={...E,...a,...i},D=vl(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)?!gl(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=Ja(s,n)?.transition?.delayChildren;r.delay=qa(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&&!tn(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=xl(),i=!0}}}function bl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!gl(t,e):!1}function xl(){let e={};for(let t of Ti)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var J=Rt(),Y=t(gt(),1);function Sl({children:e,features:t,strict:n=!1}){let[,r]=(0,Y.useState)(!Cl(t)),i=(0,Y.useRef)(void 0);if(!Cl(t)){let{renderer:e,...n}=t;i.current=e,pa(n)}return(0,Y.useEffect)(()=>{Cl(t)&&t().then(({renderer:e,...t})=>{pa(t),i.current=e,r(!0)})},[]),(0,J.jsx)(ui.Provider,{value:{renderer:i.current,strict:n},children:e})}function Cl(e){return typeof e==`function`}function wl(e,t){if(typeof Proxy>`u`)return Mi;let n=new Map,r=(n,r)=>Mi(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Mi(a,void 0,e,t)),n.get(a))})}var Tl=wl(),El=(e,t)=>t.isSVG??$i(e)?new hl(t):new Js(t,{allowProjection:e!==Y.Fragment}),Dl=class extends fl{constructor(e){super(e),e.animationState||=yl(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Ta(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?.()}},Ol=0,kl={animation:{Feature:Dl},exit:{Feature:class extends fl{constructor(){super(...arguments),this.id=Ol++}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}=Ja(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(){}}}},Al=class extends fl{constructor(e){super(e),this.removeGroupControls=Xt,this.removeListeners=Xt,this.controls=new Uc(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xt}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()}},jl=e=>(t,n)=>{e&&V.update(()=>e(t,n),!1,!0)},Ml=class extends fl{constructor(){super(...arguments),this.removePointerDownListener=Xt}onPointerDown(e){this.session=new gc(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:jl(e),onStart:jl(t),onMove:jl(n),onEnd:(e,t)=>{delete this.session,r&&V.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Qs(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},Nl=!1,Pl=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),Fl=(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)}},Il=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),Nl&&i.root.didUpdate(),i.options.layoutId!==r&&Fl(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Pl(this.props),onExitComplete:()=>this.safeToRemove()})),cs.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(),Fl(o,n)),o.setOptions({...o.options,...Pl(this.props)}),Nl=!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(),mn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Nl=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Ll(e){let[t,n]=ge(),r=(0,Y.useContext)(Zt);return(0,J.jsx)(Il,{...e,layoutGroup:r,switchLayoutGroup:(0,Y.useContext)(ri),isPresent:t,safeToRemove:n})}var Rl={pan:{Feature:Ml},drag:{Feature:Al,ProjectionNode:Ws,MeasureLayout:Ll}};function zl(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,Xs(t)))}var Bl=class extends fl{mount(){let{current:e}=this.node;e&&(this.unmount=Qc(e,(e,t)=>(zl(this.node,t,`Hover`,`Start`),e=>zl(this.node,e,`Hover`,`End`))))}unmount(){}},Vl=class extends fl{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=j(Hs(this.node.current,`focus`,()=>this.onFocus()),Hs(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Hl(e,t,n,r){e.current instanceof HTMLButtonElement&&e.current.disabled||zl(e,t,`Tap`,n,r)}var Ul=class extends fl{constructor(){super(...arguments),this.options={}}mount(){let{current:e}=this.node;e&&(this.update(),this.unmount=ul(e,(e,t)=>(Hl(this.node,t,`Start`),{onComplete:(e,{success:t})=>Hl(this.node,e,t?``:`Cancel`),onRepeat:()=>Hl(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(){}},Wl=new WeakMap,Gl=new WeakMap,Kl=e=>{let t=Wl.get(e.target);t&&t(e)},ql=e=>{e.forEach(Kl)};function Jl({root:e,...t}){let n=e||document;Gl.has(n)||Gl.set(n,{});let r=Gl.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(ql,{root:e,...t})),r[i]}function Yl(e,t,n){let r=Jl(t);return Wl.set(e,n),r.observe(e),()=>{Wl.delete(e),r.unobserve(e)}}var Xl={some:0,all:1},Zl=class extends fl{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:Xl[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=Yl(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(Ql(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Ql({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var $l=Object.assign({},Object.assign({renderer:El},kl,{inView:{Feature:Zl},tap:{Feature:Ul},focus:{Feature:Vl},hover:{Feature:Bl}}),Rl,{layout:{ProjectionNode:Ws,MeasureLayout:Ll}});function eu(e){let t=sn(()=>ln(e)),{isStatic:n}=(0,Y.useContext)(gn);if(n){let[,n]=(0,Y.useState)(e);(0,Y.useEffect)(()=>t.on(`change`,n),[])}return t}function tu(e,t){let n=eu(t()),r=()=>n.set(t());return r(),pn(()=>{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 nu(e){fn.current=[],e();let t=tu(fn.current,e);return fn.current=void 0,t}function ru(e,t,n,r){if(typeof e==`function`)return nu(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return au(e,t,n,r);let i=typeof t==`function`?t:dl(t,n,r),a=Array.isArray(e)?iu(e,i):iu([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 iu(e,t){let n=sn(()=>[]);return tu(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function au(e,t,n,r){let i=sn(()=>Object.keys(n)),a=sn(()=>({}));for(let o of i)a[o]=ru(e,t,n[o],r);return a}var ou=(0,Y.createContext)(null),su=(0,Y.createContext)(null);function cu(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:uu(t.x)+n.x,y:uu(t.y)+n.y},i=du(e),s=i.find(t=>t.items.includes(e[o])),c=i.reduce((e,t)=>fu(r.y,t)<fu(r.y,e)?t:e);if(c!==s)return pu(e,o,r.x,c,a);let l=mu(r,t),u=-1,d=l;return e.forEach((e,t)=>{if(t===o)return;let n=mu(r,e.layout);n<d&&(u=t,d=n)}),u===-1?e:Vt(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=uu(u);return s===1&&l.max+n[i]>d||s===-1&&l.min+n[i]<d?Vt(e,o,o+s):e}function lu(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=du(e).sort((e,t)=>e.min-t.min),r=n[n.findIndex(({items:n})=>n.includes(e[t]))+a],i=n=>Math.abs(uu(n.layout.x)-uu(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 uu=({min:e,max:t})=>P(e,t,.5);function du(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 fu(e,t){return e<t.min?t.min-e:e>t.max?e-t.max:0}function pu(e,t,n,r,i){let a=e.filter((e,n)=>n!==t),o=r.items.find(e=>{let t=uu(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 mu(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 hu=(e,t)=>e.max<=t.min||t.max<=e.min;function gu(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||=hu(e[r].x,e[i].x),n||=hu(e[r].y,e[i].y),t&&n)return`xy`;return t?`x`:`y`}var _u=(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 vu({children:e,as:t=`ul`,axis:n,onReorder:r,values:i,onPointerDownCapture:a,onClickCapture:o,...s},c,l){let u=sn(()=>l[t]),d=(0,Y.useContext)(ou),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?lu(r,i,c,x,!!l&&O()):-1;if(a>-1)n?k(Vt(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=gu(D().map(e=>e.layout));e!==g&&_(e)}},updateOrder:(e,t,n)=>{if(v.current)return;let r=D(),i=cu(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]),pn(()=>d?.add(A));let j={overflowAnchor:`none`,...s.style};return(0,J.jsx)(u,{...s,style:j,ref:_u(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)(su.Provider,{value:A,children:e})})}var yu=e=>(0,Y.forwardRef)((t,n)=>vu(t,n,e)),bu=50,xu=1.5,Su=new Set([`auto`,`scroll`]),Cu={x:new Map,y:new Map};function wu(){Cu.x.clear(),Cu.y.clear()}function Tu(e,t){let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY;return e===document.body||e===document.documentElement||Su.has(r)&&(t===`x`?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight)}function Eu(e,t){let n=e?.parentElement;for(;n;){if(Tu(n,t))return n;n=n.parentElement}return null}function Du(e){let t=Math.min(1,1-e/bu);return xu*t*t*H.delta}function Ou(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<bu?{amount:-Du(o),edge:`start`}:s<bu?{amount:Du(s),edge:`end`}:{amount:0,edge:null}}function ku(e,t,n,r){if(!e)return;let i=Eu(e,n);if(!i)return;let{amount:a,edge:o}=Ou(t-(n===`x`?window.scrollX:window.scrollY),i,n),s=Cu[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 Au(e,t=0){return tn(e)?e:eu(t)}function ju({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)(su),m=(0,Y.useContext)(ou),h=(0,Y.useRef)(null),g=sn(()=>p.proxy[r]),_=(0,Y.useRef)(),v={x:Au(t.x),y:Au(t.y)},y=ru([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),dn.get(e)?.animationState?.setActive(`whileDrag`,!!t)},M=(0,Y.useRef)(!1);return pn(()=>{m?.receive(p,n,h.current,j)&&(M.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)=>{M.current?M.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)ku(m&&!b.includes(e)?m.column(p):C.current,i[e],e,r[e]);a&&a(e,t)},onDragEnd:(e,t)=>{w.current=!1,wu(),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:_u(h,f),ignoreStrict:!0,children:e})}var Mu=(0,Y.forwardRef)(ju),Nu=e=>{let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{x:t+r/2,y:n+i/2}},Pu=e=>{let{x:t,y:n}=Nu(e),{scrollX:r,scrollY:i}=e.ownerDocument.defaultView;return{x:t+r,y:n+i}};function Fu(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 Iu=(e,t)=>{let n=e.groupRef.current,r=t.groupRef.current;return n.contains(r)||r.contains(n)};function Lu(e){let t=new Set,n,r=(t,n,r)=>!Iu(t,n)&&e.current.canMove?.(r,t.values,n.values)!==!1,i,a=(e,t,r,i,a,o)=>{let s=Nu(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=>Fu(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:Pu(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=Pu(o),n.event=s),!0;let c=Nu(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=dn.get(o);return a(e,l,i,o,{controls:u&&Hc.get(u),event:s}),!0},key:(e,n,o,s,c)=>{let l=Nu(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=dn.get(r),o=a&&Hc.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:(mn.read(()=>{if(n!==s)return;n=void 0,dn.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(Pu(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 Ru({children:e,...t}){let n=(0,Y.useRef)(t);return pn(()=>{n.current=t}),(0,J.jsx)(ou.Provider,{value:sn(()=>Lu(n)),children:e})}var zu=e=>{e.stopPropagation()},Bu=e=>{e.preventDefault(),e.stopPropagation(),e.preventBaseUIHandler?.()},Vu={anchor:null,iconSpaceMode:`global`,items:[],open:!1,triggerId:null},Hu=Vu,Uu=new Set,Wu={ready:!1,triggerId:null,x:0,y:0},Gu=()=>{Uu.forEach(e=>e())},Ku=e=>(Uu.add(e),()=>Uu.delete(e)),qu=()=>Hu,Ju=()=>Vu,Yu=e=>{Wu.x=e.clientX,Wu.y=e.clientY,Wu.ready=!0,Wu.triggerId=e.target instanceof Element?e.target.closest(`[data-contextmenu-trigger]`)?.dataset.contextmenuTrigger??null:null},Xu=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})}),Zu=e=>{Hu={...Hu,...e},Gu()},Qu=null,$u=(e,t)=>{let n={x:window.innerWidth/2,y:window.innerHeight/2};Zu({anchor:Xu(Wu.ready?{x:Wu.x,y:Wu.y}:n),footer:t?.footer,header:t?.header,iconAlign:t?.iconAlign,iconSpaceMode:t?.iconSpaceMode??`global`,items:e,listItemHeight:t?.listItemHeight,open:!0,triggerId:Wu.triggerId??null,virtual:t?.virtual})},ed=(e,t)=>{typeof window<`u`&&(Qu?.show?Qu.show(e,t,()=>$u(e,t)):$u(e,t))},td=()=>{Zu({anchor:null,footer:void 0,header:void 0,iconSpaceMode:`global`,items:[],listItemHeight:void 0,open:!1,triggerId:null,virtual:void 0})},nd=()=>{Qu?.close?Qu.close(td):td()};function rd(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=it(),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)(_e.Provider,{value:u,children:(0,J.jsx)(T.Provider,{value:void 0,children:(0,J.jsx)(Ye,{...e})})})}var id=b,X=ht({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`]}),ad=(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}=Ft(`floating`,r),o=typeof t==`function`?e=>({zIndex:i,...t(e)}):{zIndex:i,...t};return(0,J.jsx)(id,{...n,className:z(F.positioner,X(`positioner`)),collisionPadding:e??ze(),ref:a,style:o})});ad.displayName=`ContextMenuSubmenuPositioner`;var od=(0,Y.memo)(()=>{let{t:e}=me(D);return(0,J.jsx)(N,{disabled:!0,className:z(R(I.item,I.empty).className,X(`item`)),children:(0,J.jsx)(`div`,{className:z(F.itemContent,X(`item-content`)),children:(0,J.jsx)(`span`,{className:z(F.label,X(`label`)),children:e(`common.empty`)})})})});od.displayName=`EmptyMenuItem`;var sd=({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)(N,{closeOnClick:n,disabled:a,label:o,className:z(R(I.item,r&&I.danger).className,X(`item`)),onClick:e=>{e.preventDefault(),a||f(!d)},children:[t,(0,J.jsx)(`span`,{className:z(F.switchWrap,X(`switch`)),onFocus:e=>e.stopPropagation(),children:(0,J.jsx)(He,{checked:d,disabled:a,size:`small`,tabIndex:-1,onChange:f,onClick:(e,t)=>t.stopPropagation()})})]})},cd=(e,t,n)=>{let r=Ce(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(F.labelGroup,X(`label-group`)),children:[(0,J.jsx)(`span`,{className:z(F.label,X(`label`)),children:r}),(0,J.jsx)(`span`,{className:z(F.desc,X(`desc`)),children:i})]}):(0,J.jsx)(`span`,{className:z(F.label,X(`label`)),children:r});return(0,J.jsxs)(`div`,{className:z(R(I.itemContent,s&&I.itemContentAlignStart).className,X(`item-content`)),children:[u?(0,J.jsx)(`span`,{"aria-hidden":!l,className:z(R(I.icon,s&&I.iconAlignStart).className,ke.icon,X(`icon`)),children:c?n:l?Ve(e.icon,`small`):null}):null,d,a?(0,J.jsx)(`span`,{className:z(F.extra,X(`extra`)),children:a}):null,o&&n?n:null,t?.submenu?(0,J.jsx)(`span`,{className:z(F.submenuArrow,X(`submenu-arrow`)),children:(0,J.jsx)(oe,{})}):null]})},ld=(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)},ud=(e,t=[],n)=>{let r=n?.iconAlign,i=n?.iconSpaceMode??`global`,a=n?.reserveIconSpace??Ue(e,i===`global`),o=n?.indicatorOnRight??Ie(e);return e.map((e,n)=>{if(!e)return null;let s=`${t.join(`-`)||`root`}-${n}`,c=f(e,s),l=[...t,String(c)];if(e.type===`checkbox`){let t=e,n=Ce(t),i=typeof n==`string`?n:void 0,s=!!t.danger,l=(0,J.jsx)(M,{className:X(`checkbox-indicator`),children:(0,J.jsx)(ut,{icon:fe,size:`small`})});return(0,J.jsx)(se,{checked:t.checked,closeOnClick:t.closeOnClick,defaultChecked:t.defaultChecked,disabled:t.disabled,label:i,className:z(R(I.item,s&&I.danger).className,X(`item`)),onCheckedChange:e=>t.onCheckedChange?.(e),children:cd(t,{iconAlign:r,indicatorOnRight:o,reserveIconSpace:a},l)},c)}if(e.type===`switch`){let t=e,n=Ce(t),i=typeof n==`string`?n:void 0,o=!!t.danger;return(0,J.jsx)(sd,{checked:t.checked,closeOnClick:t.closeOnClick,danger:o,defaultChecked:t.defaultChecked,disabled:t.disabled,label:i,onCheckedChange:t.onCheckedChange,children:cd(t,{iconAlign:r,reserveIconSpace:a})},c)}if(e.type===`divider`)return(0,J.jsx)(Qe,{className:z(F.separator,X(`separator`))},c);if(e.type===`group`){let t=e,n=i===`group`?t.children?Ue(t.children):!1:a,o=t.children?Ie(t.children):!1;return(0,J.jsxs)(C,{className:X(`group`),children:[t.label?(0,J.jsx)(ie,{className:z(F.groupLabel,X(`group-label`)),children:t.label}):null,t.children?ud(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=Ce(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?ud(t.children,l,{iconAlign:r,iconSpaceMode:i}):(0,J.jsx)(od,{});return(0,J.jsxs)(be,{defaultOpen:t.defaultOpen,open:t.open,onOpenChange:t.onOpenChange,children:[(0,J.jsx)(We,{...t.triggerProps,closeDelay:t.closeDelay,delay:t.delay,disabled:t.disabled,label:o,openOnHover:t.openOnHover,className:z(R(I.item,s&&I.danger).className,X(`item`)),onClick:t.onClick,children:cd(t,{iconAlign:r,reserveIconSpace:a,submenu:!0})}),(0,J.jsx)(p,{children:(0,J.jsx)(ad,{alignOffset:-4,"data-submenu":``,sideOffset:-1,onContextMenu:Bu,children:(0,J.jsxs)(Ae,{className:z(R(I.popup,u&&I.popupWithSlots).className,ke.popup,X()),children:[t.header==null?null:(0,J.jsx)(`div`,{className:z(F.header,X(`header`)),children:t.header}),u?(0,J.jsx)(`div`,{className:z(F.slotViewport,X(`viewport`)),children:d}):d,t.footer==null?null:(0,J.jsx)(`div`,{className:z(F.footer,X(`footer`)),children:t.footer})]})})})]},c)}let u=e,d=Ce(u),m=typeof d==`string`?d:void 0,h=`danger`in u&&!!u.danger;return(0,J.jsx)(N,{closeOnClick:u.closeOnClick,disabled:u.disabled,label:m,className:z(R(I.item,h&&I.danger).className,X(`item`)),onClick:e=>ld(u,l,e),children:cd(u,{iconAlign:r,reserveIconSpace:a})},c)})},dd={"--lobe-dropdown-animation-duration":`0ms`},fd=(0,Y.memo)(()=>{let e=A(),t=ot(),n=(0,Y.useSyncExternalStore)(Ku,qu,Ju);(0,Y.useEffect)(()=>{},[e]),(0,Y.useEffect)(()=>{let e=e=>Yu(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)(()=>ud(n.items,[],{iconAlign:n.iconAlign,iconSpaceMode:n.iconSpaceMode}),[n.items,n.iconAlign,n.iconSpaceMode]),{zIndex:i,ref:a}=Ft(`floating`),o=n.header!=null||n.footer!=null;return!e||!n.open&&n.items.length===0?null:(0,J.jsx)(rd,{open:n.open,onOpenChange:e=>{e?Zu({open:e}):nd()},children:(0,J.jsx)(p,{container:t,children:(0,J.jsx)(id,{anchor:n.anchor??void 0,className:z(F.positioner,X(`positioner`)),collisionPadding:ze(),ref:a,sideOffset:6,style:{...dd,zIndex:i},children:(0,J.jsxs)(Ae,{"data-has-footer":n.footer==null?void 0:``,"data-has-header":n.header==null?void 0:``,className:z(R(I.popup,o&&I.popupWithSlots).className,ke.popup,X()),onContextMenu:Bu,children:[n.header==null?null:(0,J.jsx)(`div`,{className:z(F.header,X(`header`)),children:n.header}),n.virtual?(0,J.jsx)(Le,{className:X(`viewport`),itemSize:n.listItemHeight,children:r}):o?(0,J.jsx)(`div`,{className:z(F.slotViewport,X(`viewport`)),children:r}):r,n.footer==null?null:(0,J.jsx)(`div`,{className:z(F.footer,X(`footer`)),children:n.footer})]})})})})});fd.displayName=`ContextMenuHost`;function pd(e,t){let n=(t??wt(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 md=Y.createContext(void 0);function hd(){let e=Y.useContext(md);if(!e)throw Error(rt(73));return e}var gd=0;function _d(e){return gd+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${gd}`}function vd(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 yd(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 bd(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 Z={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},xd=class extends Ot{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:yd(e.toasts)},{},Z)}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=bd(this.state.toasts,t);r.toasts=e,r.toastMetadata=yd(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=Z.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||_d(`toast`);if(e.id){let t=Z.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(bd(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),Z.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{let n=Z.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=Z.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)),Z.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=Z.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=bd(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=vd(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=vd(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=vd(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??=at.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=Nt(e);Dt(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=Z.expandedOrOutOfFocus(this.state)?void 0:at.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:yd(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=Pt(_t(this.state.viewport));if(!this.state.viewport||!Dt(this.state.viewport,t)||!Et(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=Z.toasts(this.state),r=Z.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()}},Sd=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=st(()=>new xd({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return pt(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)(md.Provider,{value:a,children:[(0,J.jsx)(Cd,{store:a,timeout:n,limit:r}),t]})};function Cd(e){let{store:t,timeout:n,limit:r}=e;return tt(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var wd=`--toast-frontmost-height`,Td=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=hd(),c=ct(),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=wt(e),n=_t(e);function r(t){t.key===`F6`&&Nt(t)!==e&&(t.preventDefault(),s.set(`prevFocusElement`,Pt(n)),e?.focus({preventScroll:!0}),s.pauseTimers(),s.set(`focused`,!0))}function i(e){Nt(e)===t&&(s.set(`isWindowFocused`,!1),s.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=Nt(n),i=Pt(_t(e));r!==t&&Dt(e,r)&&Et(i)||s.resumeTimers(),c.start(0,()=>s.set(`isWindowFocused`,!0))}return vt(It(t,`keydown`,r),It(t,`blur`,i,!0),It(t,`focus`,a,!0),It(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&&Nt(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||Et(Pt(_t(s.state.viewport)))&&(s.set(`focused`,!0),s.pauseTimers())}function O(e){m&&!Dt(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:{[wd]:_?`${_}px`:void 0}},A={expanded:h},j=!f&&g&&(0,J.jsx)(xt,{onFocus:b}),M=nt(`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,M,!m&&y.length>0&&(0,J.jsx)(`div`,{style:St,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))})]})}),Ed=Y.createContext(void 0);function Dd(){let e=Y.useContext(Ed);if(!e)throw Error(rt(66));return e}function Od(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 kd=`--toast-index`,Ad=`--toast-offset-y`,jd=`--toast-height`,Md=`--toast-swipe-movement-x`,Nd=`--toast-swipe-movement-y`,Pd=`data-swipe-direction`,Fd=t(u(),1),Id={...bt,swipeDirection(e){return e?{[Pd]:e}:null}},Ld=40,Rd=10,zd=.5,Bd=1,Vd=`${yt},${Ct}`,Hd=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=hd(),[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}),M=Y.useRef(void 0),ee=Y.useRef(0),te=Y.useRef(!1),N=Y.useRef({x:0,y:0}),ne=Y.useRef(!1),re=Y.useRef({x:0,y:0}),ie=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`);kt({open:n.transitionStatus!==`ending`,ref:O,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let de=dt((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?Fd.flushSync(a):a()});tt(()=>{let e=k.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(p(void 0),x({x:0,y:0,scale:1}),fe({x:0,y:0})),k.current=n.id,de())},[de,n.id,n.transitionStatus]);function fe(e){re.current=e,y(e)}tt(()=>()=>{ae.current?.abort()},[]);function pe(e,t){let n=e=>e>0?e**zd:-(Math.abs(e)**zd),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 me=dt(e=>{if(e.pointerId!==ie.current)return;ie.current=null,ae.current?.abort(),ae.current=null,h(!1),_(!1),D(null);let t=j.current;if(e.type===`pointercancel`||te.current){fe({x:t.x,y:t.y}),p(void 0);return}let r=re.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of l)if(Od(e,i,a)>Ld){o=e;break}o?(p(o),d.closeToast(n.id)):(fe({x:t.x,y:t.y}),p(void 0))});function P(e){if(e.button!==0)return;e.pointerType===`touch`&&d.pauseTimers();let t=Nt(e.nativeEvent);if(jt(t,`button,a,input,textarea,[role="button"],${Vd}`))return;te.current=!1,M.current=void 0,ee.current=0,ie.current=e.pointerId,A.current={x:e.clientX,y:e.clientY},N.current=A.current;let n=e.currentTarget,r=pd(n);j.current=r,x(r),fe({x:r.x,y:r.y}),d.set(`hovering`,!0),h(!0),_(!1),D(null),ne.current=!0,ae.current?.abort();let i=new AbortController;ae.current=i;let a=_t(n);a.addEventListener(`pointerup`,me,{signal:i.signal}),a.addEventListener(`pointercancel`,me,{signal:i.signal}),n.setPointerCapture?.(e.pointerId)}function he(e){if(e.pointerId!==ie.current)return;e.preventDefault(),ne.current&&=(A.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>N.current.y||i>0&&t<N.current.y)&&(N.current={x:N.current.x,y:t}),(r<0&&n>N.current.x||r>0&&n<N.current.x)&&(N.current={x:n,y:N.current.y});let a=n-A.current.x,o=t-A.current.y,s=t-N.current.y,c=n-N.current.x,u=E;if(!g&&Math.sqrt(a*a+o*o)>=Bd){_(!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(!M.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)&&(M.current=d,ee.current=Od(d,a,o),p(d));else{let e=M.current,t=Od(e,c,s);t>Ld?(te.current=!1,p(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&ee.current-t>=Rd&&(te.current=!0)}let f=pe(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),fe({x:m,y:h})}function ge(e){if(e.key===`Escape`){if(!O.current||!Dt(O.current,Pt(_t(O.current))))return;d.closeToast(n.id)}}Y.useEffect(()=>{let e=O.current;if(!u||!e)return;function t(t){ie.current!==null&&Dt(e,Nt(t))&&t.preventDefault()}return It(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,[Md]:`${e}px`,[Nd]:`${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?P:void 0,onPointerMove:u?he:void 0,onPointerUp:u?me:void 0,onPointerCancel:u?me:void 0,onKeyDown:ge,inert:At(n.limited),style:{..._e(),[kd]:n.transitionStatus===`ending`?oe:se,[Ad]:`${ce}px`,[jd]:n.height?`${n.height}px`:void 0}},F=Y.useMemo(()=>({toast:n,setTitleId:C,setDescriptionId:T,recalculateHeight:de,visibleIndex:se,expanded:ue}),[n,C,T,de,se,ue]),be={transitionStatus:n.transitionStatus,expanded:ue,limited:n.limited||!1,type:n.type,swiping:m,swipeDirection:f},xe=nt(`div`,e,{ref:[t,O],state:be,stateAttributesMapping:Id,props:[ye,s]});return(0,J.jsx)(Ed.Provider,{value:F,children:xe})}),Ud=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=Dd(),l=Y.useRef(null);return tt(()=>{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]),nt(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})});function Wd(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(Wd)}function Gd(e){return Y.isValidElement(e)&&Wd(e.props.children)}function Kd(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=Dd(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:it(e),children:s,type:r.type,setId:o}}function qd(e,t,n){let r=Gd(e);return tt(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var Jd=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}=Kd(a,o,`description`);return qd(nt(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Yd=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}=Kd(a,o,`title`);return qd(nt(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Xd=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=hd(),{toast:l,expanded:u}=Dd(),[d,f]=Y.useState(!1),{getButtonProps:p,buttonRef:m}=Tt({disabled:a,native:o}),h={type:l.type};return nt(`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]})}),Zd=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=Dd(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=Tt({disabled:a,native:o}),f={type:c.type},p=nt(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return Gd(p)?p:null}),Qd=Y.forwardRef(function(e,t){return(0,J.jsx)(Oe,{ref:t,...e})});function $d(){let e=hd(),t=e.useState(`toasts`);return Y.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function ef(){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||_d(`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 tf=(0,Y.createContext)({position:`bottom-right`,swipeDirection:[`down`,`right`]}),nf=()=>(0,Y.useContext)(tf),rf=[],af=new Set,of=()=>{for(let e of af)e()},sf=e=>(rf.push(e),of(),()=>{let t=rf.indexOf(e);t!==-1&&rf.splice(t,1),of()}),cf=e=>rf[0]===e,lf=e=>(af.add(e),()=>{af.delete(e)}),uf=20,df=5e3,ff=!1,pf=[],mf=e=>{ff?e():(pf.length>=uf&&pf.shift(),pf.push({queuedAt:Date.now(),run:e}))},hf=()=>{ff=!0;let e=pf;pf=[];let t=Date.now();for(let n of e)t-n.queuedAt<=df&&n.run()},gf=()=>{ff=!1},Q=ht({block:`toast`,dataAttributes:[`type`,`position`],elements:[`viewport`,`content`,`body`,`icon`,`main`,`title-row`,`title`,`close`,`description`,`actions`,`action`]}),$={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}},_f={bottom:$.viewportBottom,"bottom-left":$.viewportBottomLeft,"bottom-right":$.viewportBottomRight,top:$.viewportTop,"top-left":$.viewportTopLeft,"top-right":$.viewportTopRight},vf={bottom:$.rootBottom,"bottom-left":$.rootBottom,"bottom-right":$.rootBottom,top:$.rootTop,"top-left":$.rootTop,"top-right":$.rootTop},yf={danger:$.actionDanger,ghost:$.actionGhost,primary:$.actionPrimary,secondary:$.actionSecondary,text:$.actionText},bf={default:Ke,error:Ka,info:Ke,loading:_,success:Wa,warning:le},xf={default:Xe.colorText,error:Xe.colorError,info:Xe.colorInfo,loading:Xe.colorPrimary,success:Xe.colorSuccess,warning:Xe.colorWarning},Sf=(0,Y.memo)(({toast:e,classNames:t,styles:n})=>{let{position:r,swipeDirection:i}=nf(),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=xf[o],g=u??bf[o],_=o===`loading`,v=()=>g?(0,J.jsx)(`div`,{...L($.icon,z(Q(`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($.actions,z(Q(`actions`),t?.actions),n?.actions),children:m.map((e,r)=>(0,J.jsx)(Zd,{...L([$.action,lt.info,yf[e.variant??`primary`]],z(Q(`action`),t?.action),n?.action),onClick:e.onClick,...e.props,children:e.label},r))}):p?(0,J.jsx)(Zd,{...L([$.action,lt.info,$.actionPrimary],z(Q(`action`),t?.action),n?.action),...p}):null;return(0,J.jsx)(Hd,{swipeDirection:i,toast:e,...mt({position:r,type:o}),...L([$.root,vf[r]],z(Q(),t?.root),{...n?.root,...a?.style}),children:(0,J.jsx)(Ud,{...L($.content,z(Q(`content`),t?.content),n?.content),children:(0,J.jsxs)(`div`,{...L($.toastBody,Q(`body`)),children:[v(),(0,J.jsxs)(`div`,{...L($.contentArea,Q(`main`)),children:[d?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{...L($.titleRow,Q(`title-row`)),children:[(0,J.jsx)(Yd,{...L($.title,z(Q(`title`),t?.title),n?.title),children:d}),l&&(0,J.jsx)(Xd,{"aria-label":`Close`,...L($.close,z(Q(`close`),t?.close),n?.close),children:(0,J.jsx)(ft,{size:14})})]}),f&&(0,J.jsx)(Jd,{...L([$.description,$.descriptionWithTitle],z(Q(`description`),t?.description),n?.description),children:f})]}):f&&(0,J.jsxs)(`div`,{...L($.titleRow,Q(`title-row`)),children:[(0,J.jsx)(Jd,{...L([$.description,$.descriptionStandalone],z(Q(`description`),t?.description),n?.description),children:f}),l&&(0,J.jsx)(Xd,{"aria-label":`Close`,...L($.close,z(Q(`close`),t?.close),n?.close),children:(0,J.jsx)(ft,{size:14})})]}),y()]})]})})})});Sf.displayName=`ToastItem`;var Cf=[`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`],wf={duration:5e3,limit:5,position:`bottom-right`,swipeDirection:[`down`,`right`]},Tf={bottom:ef(),"bottom-left":ef(),"bottom-right":ef(),top:ef(),"top-left":ef(),"top-right":ef()},Ef={bottom:new Map,"bottom-left":new Map,"bottom-right":new Map,top:new Map,"top-left":new Map,"top-right":new Map},Df=e=>Tf[e],Of=0,kf=()=>`toast-${Date.now().toString(36)}-${(Of++).toString(36)}`,Af=e=>Cf.find(t=>Ef[t].has(e)),jf=(e,t)=>Array.from(Ef[e].keys()).at(-1)===t,Mf=(e,t)=>typeof e==`string`?{description:e,type:t}:{...e,type:t},Nf=(e,t)=>({close:()=>mf(()=>Df(t).close(e)),id:e,update:n=>{mf(()=>Df(t).update(e,{data:n,description:n.description,title:n.title}))}}),Pf=e=>{let t=e.placement??wf.position,n=Df(t),{id:r,onClose:i,onRemove:a}=e;if(r){let e=Af(r);e&&!(e===t&&jf(t,r))&&(Ef[e].get(r).superseded=!0,Ef[e].delete(r),mf(()=>Df(e).close(r)))}let o=r??kf(),s={superseded:!1};return Ef[t].set(o,s),mf(()=>{n.add({id:o,data:e,description:e.description,onClose:()=>{s.superseded||i?.()},onRemove:()=>{s.superseded||(Ef[t].delete(o),a?.())},timeout:e.duration??wf.duration,title:e.title})}),Nf(o,t)},Ff=e=>{if(e)for(let[t,n]of Object.entries(Tf))Ef[t].delete(e),mf(()=>n.close(e));else for(let[e,t]of Object.entries(Tf)){let n=Array.from(Ef[e].keys());Ef[e].clear(),mf(()=>{for(let e of n)t.close(e)})}},If=e=>Pf(Mf(e,`success`)),Lf=e=>Pf(Mf(e,`error`)),Rf=e=>Pf(Mf(e,`info`)),zf=e=>Pf(Mf(e,`warning`)),Bf=e=>Pf({duration:0,...Mf(e,`loading`)});async function Vf(e,t){let n=Pf({closable:!1,duration:0,type:`loading`,...typeof t.loading==`string`?{description:t.loading}:t.loading});try{let r=await e;return n.close(),Pf({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(),Pf({type:`error`,...typeof t.error==`string`?{description:t.error}:typeof t.error==`function`?{description:t.error(e)}:t.error}),e}}var Hf=Object.assign(e=>Pf({type:`default`,...e}),{dismiss:Ff,error:Lf,info:Rf,loading:Bf,promise:Vf,success:If,warning:zf}),Uf=(0,Y.memo)(()=>{let{toasts:e}=$d();return e.map(e=>(0,J.jsx)(Sf,{toast:e},e.id))});Uf.displayName=`ToastList`;var Wf=(0,Y.memo)(({root:e,className:t,duration:n=5e3,limit:r=5,position:i=`bottom-right`,swipeDirection:a=[`down`,`right`]})=>{let o=A(),s=ot(),[c,l]=(0,Y.useState)(void 0),u=(0,Y.useId)();(0,Y.useEffect)(()=>sf(u),[u]);let d=(0,Y.useSyncExternalStore)(lf,()=>cf(u),()=>!1);if((0,Y.useEffect)(()=>{d&&(wf={duration:n,limit:r,position:i,swipeDirection:a})},[n,r,i,a,d]),(0,Y.useEffect)(()=>{d&&l(Mt(`toast`))},[d]),(0,Y.useEffect)(()=>{if(d&&o)return hf(),()=>{gf()}},[d,o]),!o||!d)return null;let f=e??s??document.body;return Cf.map(e=>(0,J.jsx)(tf,{value:{position:e,swipeDirection:a},children:(0,J.jsx)(Sd,{limit:r,timeout:n,toastManager:Df(e),children:(0,J.jsx)(Qd,{container:f,children:(0,J.jsx)(Td,{"data-position":e,...L([$.viewport,_f[e]],z(Q(`viewport`),t),c===void 0?void 0:{zIndex:c}),children:(0,J.jsx)(Uf,{})})})})},e))});Wf.displayName=`ToastHost`;var Gf=e({Board:()=>Ru,Group:()=>Kf,Item:()=>Mu}),Kf=yu(Tl),qf=e({Reorder:()=>Gf,a:()=>ha,abbr:()=>qi,address:()=>sa,animate:()=>Ai,area:()=>ti,article:()=>Zi,aside:()=>da,audio:()=>ci,b:()=>Bi,base:()=>ya,bdi:()=>fi,bdo:()=>yi,big:()=>ta,blockquote:()=>Wi,body:()=>Di,button:()=>Ci,canvas:()=>Zr,caption:()=>Ca,circle:()=>Fa,cite:()=>ai,clipPath:()=>ja,code:()=>Tr,col:()=>An,colgroup:()=>Da,create:()=>la,data:()=>kr,datalist:()=>Ln,dd:()=>Pn,defs:()=>pr,del:()=>Li,desc:()=>wn,details:()=>Pi,dfn:()=>sr,dialog:()=>ur,div:()=>gr,dl:()=>Bn,dt:()=>Yn,ellipse:()=>ir,em:()=>Sr,embed:()=>za,feBlend:()=>Dn,feColorMatrix:()=>Ir,feComponentTransfer:()=>Kn,feComposite:()=>Nr,feConvolveMatrix:()=>zr,feDiffuseLighting:()=>Un,feDisplacementMap:()=>tr,feDistantLight:()=>ia,feDropShadow:()=>Qn,feFlood:()=>Gr,feFuncA:()=>Hr,feFuncB:()=>Jr,feFuncG:()=>yr,feFuncR:()=>xn,feGaussianBlur:()=>vi,feImage:()=>va,feMerge:()=>Xi,feMergeNode:()=>ua,feMorphology:()=>Ni,feOffset:()=>ii,fePointLight:()=>ea,feSpecularLighting:()=>ma,feSpotLight:()=>di,feTile:()=>Ui,feTurbulence:()=>Sa,fieldset:()=>hi,figcaption:()=>Si,figure:()=>ra,filter:()=>Ki,footer:()=>ki,foreignObject:()=>Ei,form:()=>ei,g:()=>Ea,h1:()=>Ra,h2:()=>si,h3:()=>Pa,h4:()=>Or,h5:()=>Nn,h6:()=>Aa,head:()=>Mr,header:()=>zn,hgroup:()=>In,hr:()=>hr,html:()=>zi,i:()=>En,iframe:()=>Ii,image:()=>lr,img:()=>fr,input:()=>vr,ins:()=>Hn,kbd:()=>Zn,keygen:()=>or,label:()=>wr,legend:()=>Va,li:()=>kn,line:()=>Rr,linearGradient:()=>Jn,link:()=>Fr,main:()=>Vr,map:()=>Gn,mark:()=>rr,marker:()=>oa,mask:()=>er,menu:()=>qr,menuitem:()=>Wr,metadata:()=>Xr,meter:()=>xr,nav:()=>Cn,object:()=>gi,ol:()=>ga,optgroup:()=>Ji,option:()=>ca,output:()=>ji,p:()=>ni,param:()=>Qi,path:()=>fa,pattern:()=>li,picture:()=>Vi,polygon:()=>ba,polyline:()=>pi,pre:()=>bi,progress:()=>na,q:()=>Gi,radialGradient:()=>Oi,rect:()=>wi,rp:()=>Qr,rt:()=>wa,ruby:()=>Ia,s:()=>oi,samp:()=>Ma,script:()=>Er,section:()=>jn,select:()=>Oa,small:()=>Ar,source:()=>Rn,span:()=>Fn,stop:()=>mr,strong:()=>Ri,style:()=>Tn,sub:()=>Fi,summary:()=>cr,sup:()=>dr,svg:()=>_r,symbol:()=>Vn,table:()=>Xn,tbody:()=>ar,td:()=>Cr,text:()=>Ba,textPath:()=>On,textarea:()=>Lr,tfoot:()=>qn,th:()=>Pr,thead:()=>Br,time:()=>Wn,title:()=>nr,tr:()=>aa,track:()=>$n,tspan:()=>Kr,u:()=>Ur,ul:()=>Yr,use:()=>br,video:()=>Sn,view:()=>_i,wbr:()=>_a,webview:()=>Yi}),Jf=l();function Yf(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 Xf=Lt(),Zf=Y.useInsertionEffect,Qf=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?Y.useLayoutEffect:Y.useEffect,$f=Zf||Qf,ep=e=>{let t=Y.useRef([e,(...e)=>t[0](...e)]).current;return $f(()=>{t[0]=e}),t[1]},tp=[`popstate`,`pushState`,`replaceState`,`hashchange`],np=[],rp=()=>np.forEach(e=>e()),ip=e=>(np.push(e)===1&&tp.forEach(e=>addEventListener(e,rp)),()=>{np=np.filter(t=>t!==e),np.length||tp.forEach(e=>removeEventListener(e,rp))}),ap=(e,t)=>(0,Xf.useSyncExternalStore)(ip,e,t),op=()=>location.search,sp=({ssrSearch:e}={})=>ap(op,e==null?op:()=>e),cp=()=>location.pathname,lp=({ssrPath:e}={})=>ap(cp,e==null?cp:()=>e),up=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),dp=e=>[lp(e),up],fp=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[fp]===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,fp,{value:!0})}var pp=(e=``)=>e===`/`?``:e,mp=(e,t)=>e[0]===`~`?e.slice(1):pp(t)+e,hp=(e,t)=>(e=gp(pp(e)),t=gp(t),!e||(t.toLowerCase()+`/`).startsWith(e.toLowerCase()+`/`)?t.slice(e.length)||`/`:`~`+t),gp=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},_p={hook:dp,searchHook:sp,parser:Yf,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},vp=(0,Y.createContext)(_p),yp=()=>(0,Y.useContext)(vp);(0,Y.createContext)({});var bp=e=>{let[t,n]=e.hook(e);return[hp(e.base,t),ep((t,r)=>e.aroundNav(n,mp(t,e.base),r))]},xp=()=>bp(yp());(0,Y.forwardRef)((e,t)=>{let n=yp(),[r,i]=bp(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=ep(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 Sp(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 Cp=0,wp=0,Tp=new Set;function Ep(){wp||Cp>0||Tp.size===0||(wp=requestAnimationFrame(()=>{if(wp=0,Cp>0)return;let e=[...Tp];Tp.clear();for(let t of e)t()}))}function Dp(){return Cp+=1,()=>{--Cp,Ep()}}function Op({label:e}){return(0,Y.useEffect)(Dp,[]),(0,J.jsx)(o,{stack:!0,label:e,size:32})}var kp=new Set;function Ap(e){return kp.add(e),()=>{kp.delete(e)}}function jp(e){for(let t of kp)t(e)}function Mp(e){return`${e.protocol===`https:`?`wss`:`ws`}://${e.host}/ws?at=${encodeURIComponent(e.pathname)}`}function Np(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(Mp(location)),a.current=e,e.onopen=()=>{r(!0),ce();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),Je(t),jp(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 Pp(){let[e,t]=(0,Y.useState)([]);return(0,Y.useEffect)(()=>{let e=null,n,r=!1,i=()=>{e=new WebSocket(Mp(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 Fp=(0,Y.lazy)(()=>r(async()=>{let{AgentStatusPill:e}=await import(`./AgentStatusPill-Dr0IG63t.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,25]),import.meta.url).then(({AgentStatusPill:e})=>({default:e})));function Ip({artifact:e}){let t=Pp();return t.length===0?null:(0,J.jsx)(Y.Suspense,{fallback:null,children:(0,J.jsx)(Fp,{artifact:e,sessions:t})})}var Lp=1e3,Rp=`ryugi:embed:hello`,zp=`ryugi:embed:heartbeat`,Bp=`ryugi:embed:painted`,Vp=`ryugi:embed:position`,Hp=`ryugi:embed:positioned`;function Up({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===Vp&&a.anchor&&t&&t(a.anchor).then(()=>r(Hp))};n.addEventListener(`message`,i),r(Rp,t?{position:!0}:void 0);let a=setInterval(()=>r(zp),Lp),o=!1;return{painted(){o||(o=!0,r(Bp))},close(){clearInterval(a),n.removeEventListener(`message`,i)}}}function Wp(e=document,t=window,n){let r=e.documentElement.dataset.ryugiEmbedParent;return r?Up({parentOrigin:r,onPosition:n,win:t}):null}var Gp=()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e()))),Kp=e=>(Ee(e),Gp()),qp=(0,Y.createContext)(()=>{});function Jp(){let e=(0,Y.useRef)(null),t=(0,Y.useRef)(!1);return(0,Y.useEffect)(()=>{let n=Wp(document,window,Kp);return e.current=n,t.current&&n?.painted(),()=>{n?.close(),e.current=null}},[]),(0,Y.useCallback)(()=>{t.current=!0,e.current?.painted()},[])}function Yp(e){let t=(0,Y.useContext)(qp);(0,Y.useEffect)(()=>{if(!e)return;let n=0,r=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>{t(),Ne()&&Pe({kind:`painted`})})});return()=>{cancelAnimationFrame(r),cancelAnimationFrame(n)}},[e,t])}var Xp=(0,Y.createContext)(null);function Zp({pageWindow:e,children:t}){return(0,J.jsx)(Xp.Provider,{value:e??null,children:t})}var Qp=()=>(0,Y.useContext)(Xp)??window,$p=(0,Y.lazy)(()=>r(async()=>{let{AutoPublishBar:e}=await import(`./auto-publish-I637YfTf.js`);return{AutoPublishBar:e}},__vite__mapDeps([26,1,27,12,4,28,29,2,3,5,6,7,24]),import.meta.url).then(({AutoPublishBar:e})=>({default:e}))),em=(0,Y.lazy)(()=>r(async()=>{let{SettingsDialog:e}=await import(`./settings-i1xE8pA8.js`);return{SettingsDialog:e}},__vite__mapDeps([30,1,31,5,4,3,10,2,6,7,11,12,13,14,18,32,33,34,35,36,24,37,38,28,29,19]),import.meta.url).then(({SettingsDialog:e})=>({default:e}))),tm=(0,Y.lazy)(()=>r(async()=>{let{ArtboardLayout:e}=await import(`./ArtboardLayout-Csu2pQ-T.js`);return{ArtboardLayout:e}},__vite__mapDeps([39,1,10,2,3,4,5,6,7,11,12,13,14,40,41,42,43,44,22,17,18,24,45,33,46,47,48,49,15,50,32,51,52,53,16,54,55,56,57,35,19,58,59,60,61,9,62,63,64,36,65,27,66,67,68,28,29,37,69,70,71,72,34,25,73,74,75,76,77,78,79,80,20,21,81,82,83]),import.meta.url).then(({ArtboardLayout:e})=>({default:e}))),nm=(0,Y.lazy)(()=>r(async()=>{let{ArtifactList:e}=await import(`./ArtifactList-DsM43F_P.js`);return{ArtifactList:e}},__vite__mapDeps([84,1,10,2,3,4,5,6,7,11,12,13,14,54,16,34,35,32,51,50,52,49,15,18,85,59,86,29,87,70,62,88,19,31,56,57,24,66,28,36,63,74,78]),import.meta.url).then(({ArtifactList:e})=>({default:e}))),rm=(0,Y.lazy)(()=>r(async()=>{let{DocumentLayout:e}=await import(`./DocumentLayout-Byaaj0lf.js`);return{DocumentLayout:e}},__vite__mapDeps([89,1,4,5,2,3,6,7]),import.meta.url).then(({DocumentLayout:e})=>({default:e}))),im=(0,Y.lazy)(()=>r(async()=>{let{StoryboardLayout:e}=await import(`./StoryboardLayout-DWmYoJbh.js`);return{StoryboardLayout:e}},__vite__mapDeps([90,1,4,64,2,3,5,6,7,10,11,12,13,14,49,15,50,18,32,36,65,51,52,27,66,67,47,24,68,28,29,37,19,82,91,44,92,88,73,74,93,79,72,94,9,16,17,95,61,59,96,97,80,42,33,46,86,60,98,71,99]),import.meta.url).then(({StoryboardLayout:e})=>({default:e}))),am=(0,Y.lazy)(()=>r(async()=>{let{StoryboardRenderLayout:e}=await import(`./StoryboardRender-Bz4HnHfj.js`);return{StoryboardRenderLayout:e}},__vite__mapDeps([100,1,91,2,3,4,5,6,7,44,92,82,29]),import.meta.url).then(({StoryboardRenderLayout:e})=>({default:e}))),om=(0,Y.lazy)(()=>r(async()=>{let{PreviewArtifactLayout:e}=await import(`./PreviewArtifactLayout-BKcZov33.js`);return{PreviewArtifactLayout:e}},__vite__mapDeps([101,1,4,10,2,3,5,6,7,11,12,13,14,29,59,49,15,50,18,32,56,57,35,54,16,34,102,71,58,103,75,87,104,97,80,25,19,61,9,17,24,88,22]),import.meta.url).then(({PreviewArtifactLayout:e})=>({default:e}))),sm=(0,Y.lazy)(()=>r(async()=>{let{ReportLayout:e}=await import(`./ReportLayout-C1A2NXor.js`);return{ReportLayout:e}},__vite__mapDeps([105,1,64,2,3,4,5,6,7,10,11,12,13,14,49,15,50,18,32,36,65,51,52,27,66,67,47,24,68,28,29,37,19,82,106,95,88,92,73,74,104,97,80,59,25,9,16,17,44,61]),import.meta.url).then(({ReportLayout:e})=>({default:e}))),cm=(0,Y.lazy)(()=>r(async()=>{let{HtmlLayout:e}=await import(`./HtmlLayout-p52oMbkD.js`);return{HtmlLayout:e}},__vite__mapDeps([107,1,4,88,49,2,3,5,6,7,10,11,12,13,14,15,50,18,32,19,92,73,74,64,36,65,51,52,27,66,67,47,24,68,28,29,37,82]),import.meta.url).then(({HtmlLayout:e})=>({default:e}))),lm=(0,Y.lazy)(()=>r(async()=>{let{SlidesLayout:e}=await import(`./SlidesLayout-_aL_Wmn0.js`);return{SlidesLayout:e}},__vite__mapDeps([108,1,64,2,3,4,5,6,7,10,11,12,13,14,49,15,50,18,32,36,65,51,52,27,66,67,47,24,68,28,29,37,19,82,109,110,111,92,73,74,44,88,25,61,59,9,16,17,48,53,54,112,95,60,113,62,56,57,35,34,98,86,33,75,21,80,76,102,71,72,114,42,115,20,94,97,116]),import.meta.url).then(({SlidesLayout:e})=>({default:e}))),um=(0,Y.lazy)(()=>r(async()=>{let{VerifyLayout:e}=await import(`./VerifyLayout-D3L_Nyhx.js`);return{VerifyLayout:e}},__vite__mapDeps([117,1,64,2,3,4,5,6,7,10,11,12,13,14,49,15,50,18,32,36,65,51,52,27,66,67,47,24,68,28,29,37,19,118,119,120,62,60,121,112,69,70,99,33,71,53,86,98,57,35,122,123,113,76,124,95,114,61,59,9,16,17,85,42,96,94,41,22,25,20,21,92,23,38,110,125,77,78,44,126,127]),import.meta.url).then(({VerifyLayout:e})=>({default:e}))),dm=(0,Y.lazy)(()=>r(async()=>{let{WhiteboardLayout:e}=await import(`./WhiteboardLayout-BwzWcl_v.js`);return{WhiteboardLayout:e}},__vite__mapDeps([128,1,129,120,2,3,4,5,6,7,10,11,12,13,14,49,15,50,18,32,62,65,60,121,52,112,69,70,99,33,71,53,86,98,57,35,122,111,25,68,29,45,17,22,9,16,19,61,59,24,38,55,56,95,130]),import.meta.url).then(({WhiteboardLayout:e})=>({default:e}))),fm=(0,Y.lazy)(()=>Promise.all([r(()=>import(`./split-C-_Iw2K0.js`),__vite__mapDeps([131,1,110,10,2,3,4,5,6,7,11,12,13,14,74,123,80,93,121,124,76,114,21,115,50,56,57,35,19,24,132,106,133,25,126,130,134]),import.meta.url),r(()=>import(`./local-split-host-kaL99YNI.js`).then(e=>e.n),__vite__mapDeps([109,1,110,10,2,3,4,5,6,7,11,12,13,14,29]),import.meta.url)]).then(([{SplitShell:e},{localSplitHost:t}])=>({default:n=>(0,J.jsx)(e,{...n,host:t})}))),pm=(0,Y.lazy)(()=>r(async()=>{let{PreviewLayout:e}=await import(`./PreviewLayout-h2V6IEPR.js`).then(e=>e.n);return{PreviewLayout:e}},__vite__mapDeps([135,1,4,29,2,3,5,6,7,40,24]),import.meta.url).then(({PreviewLayout:e})=>({default:e}))),mm=(e,t)=>(0,J.jsxs)(J.Fragment,{children:[e,(0,J.jsx)($p,{}),(0,J.jsx)(em,{}),t&&(0,J.jsx)(Ip,{artifact:t})]});function hm({id:e,type:t}){let n=Jp();return(0,J.jsx)(qp,{value:n,children:t===`whiteboard`?(0,J.jsx)(Zp,{pageWindow:Sp(),children:(0,J.jsx)(dm,{id:e})}):t===`document`?(0,J.jsx)(rm,{id:e}):t===`verify`?(0,J.jsx)(um,{id:e}):t===`slides`?(0,J.jsx)(lm,{id:e}):(0,J.jsx)(tm,{id:e})})}function gm(){let[e]=xp(),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 mm((0,J.jsx)(nm,{}));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)(pm,{id:n,type:t.type}):t.kind===`dev-preview`?mm((0,J.jsx)(om,{id:n}),`preview/${n}`):t.kind===`embed`?(0,J.jsx)(hm,{id:n,type:t.type}):t.kind===`render`?(0,J.jsx)(am,{id:n}):t.type===`html`?mm((0,J.jsx)(cm,{id:n}),`html/${n}`):t.type===`slides`?mm((0,J.jsx)(lm,{id:n}),`slides/${n}`):t.type===`report`?mm((0,J.jsx)(sm,{id:n}),`report/${n}`):t.type===`storyboard`?mm((0,J.jsx)(im,{id:n}),`storyboard/${n}`):mm((0,J.jsx)(fm,{id:n,split:Be(t,location.search)?.split??null,type:t.type}),`${t.type}/${n}`)}function _m(){return(0,J.jsx)(Y.Suspense,{fallback:(0,J.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k x5yr21d xggk2y7 x1bo0w0s xqfszdh xif65rj`,children:(0,J.jsx)(Op,{label:i(`common.loading`)})}),children:(0,J.jsx)(gm,{})})}de(),document.documentElement.lang=d[s.language];function vm(){return n(),(0,J.jsx)(Sl,{features:$l,children:(0,J.jsxs)(m,{enableCustomFonts:!1,motion:qf,children:[(0,J.jsx)(_m,{}),(0,J.jsx)(y,{}),(0,J.jsx)(Wf,{}),(0,J.jsx)(fd,{})]})})}(0,Jf.createRoot)(document.getElementById(`root`)).render((0,J.jsx)(Y.StrictMode,{children:(0,J.jsx)(vm,{})}));export{Op as a,X as c,ed as d,Ku as f,Np as i,Ju as l,ru as m,Yp as n,Hf as o,zu as p,Ap as r,pd as s,Qp as t,qu as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./AgentStatusPill-Dr0IG63t.js","./rolldown-runtime-XKyaHtl9.js","./route-CkVEiakc.js","./bem-vbke-3KC.js","./react-DlmbjZJV.js","./jsx-runtime-LKYXHABd.js","./types-DAs-xbqr.js","./index2.css","./PhoneSheet-RzYP9raH.js","./labels-6JqNXprT.js","./url-64-774qp.js","./mergeRefs-BoWyGCK7.js","./MotionConfigContext-B3czw3wn.js","./useLayerZIndex-t4BgGwYi.js","./is-html-element-DvgHo_1h.js","./arrow-up-kdcWAnXX.js","./stable-DqmWGuUk.js","./icons-DWimed9E.js","./Center-BYaMwBHF.js","./index5.css","./BottomSheet-wczv_s4I.js","./motion-Cy65kd7X.js","./tokens.stylex-No4bA13s.js","./read-resolutions-iX7kD7Xz.js","./useTranslation-ByuUeDLl.js","./useMedia-CFebB4XU.js","./auto-publish-I637YfTf.js","./cloud-upload-DClbwO_k.js","./useCloudStatus-BngR4Pm7.js","./api-DnU71xnS.js","./settings-i1xE8pA8.js","./Avatar-OGhW38pt.js","./isElementDisabled-DWHaZxJe.js","./maximize-2-BEWXAYRs.js","./Segmented-DWi3WMbI.js","./CompositeItem-BLrDOuic.js","./urls-YNuHd8vV.js","./CloudLegalNotice-9Jrnaiz1.js","./preference-oNdcNeml.js","./ArtboardLayout-BEcgcFOd.js","./view-BnFGOXLi.js","./rounds-BLj-tfMG.js","./sliders-horizontal-BD0nAOF2.js","./Canvas-C9BgB5Vk.js","./cssVar.stylex-CGbpAC1Y.js","./WritingCursor-BgZ_CXA8.js","./PlaybackIcon-CRhSd8TP.js","./elements-Coqr6-Yv.js","./snap-BoMEN-8e.js","./Popover-CI2fBO-6.js","./parseTrigger-dhvXKZoS.js","./Select-C3XqBQ1N.js","./SelectScrollUpArrow-DccpygLx.js","./stringifyLocale-Dx2d4AZJ.js","./Input-BPP1bIR7.js","./PhoneArtboardBar-BLmC5n92.js","./DropdownMenu-D8PSw8rX.js","./MenuTrigger-CJXtjCtF.js","./crop-encode-DKOXrrBx.js","./ActionIcon-BmG7lBfd.js","./ellipsis-BN0LovOQ.js","./ThreadView-CqtHFrk_.js","./type-DA3yqyzM.js","./folder-DAgV-D-C.js","./PublishMenu-I7yHr3IR.js","./minus-YVaskeP9.js","./globe-IX-8l1m2.js","./link-2-CdvyBGG6.js","./usePageQuery-h2vHVMBa.js","./ruler-C-6kncvn.js","./image-DSbKs3OG.js","./mouse-pointer-2-FWjclmSy.js","./play-BT1pPvq4.js","./useTypeFavicon-yXOsFZBx.js","./type-icons-CxYXZlMj.js","./ActionBar-DFtKepA7.js","./CommentPopover-C3k2ys-1.js","./file-text-CBItcVAp.js","./GroupVerdict-B4YWlFtx.js","./artifact-list-DLC6w9uW.js","./film-DVL7eEoM.js","./chevron-left-BwjnhkoQ.js","./selection-BWCQd_Fn.js","./useArtifactFeed-CojHZEow.js","./ArtboardLayout-DLyi-yDq.css","./ArtifactList-DsM43F_P.js","./search-ClR54veT.js","./plus-DOEIgzPd.js","./RyugiMark-D6HsF-eP.js","./WarningsBadge-t_H3hA4c.js","./DocumentLayout-sTWNaA3o.js","./StoryboardLayout-C2-18dzZ.js","./useStoryboardData-B1gfG0bU.js","./useSandboxFrame-CJmSnwgG.js","./clapperboard-BOY4Zk3L.js","./video-AtRALBjj.js","./message-square-D1ap_NhC.js","./upload-Prmd81Mo.js","./DraggablePanel-D2U_w1Mh.js","./trash-BZS14NA2.js","./zoom-out-DsqNailP.js","./StoryboardRender-Bz4HnHfj.js","./PreviewArtifactLayout-CqXcOdxK.js","./monitor-Clr3Uc8A.js","./rotate-cw-Cj00Ku5M.js","./SideDrawer-DtqMHMZa.js","./ReportLayout-BlpuIdHN.js","./rotate-ccw-clock-CzXnXfrp.js","./HtmlLayout-p52oMbkD.js","./SlidesLayout-Cg-ZL9W5.js","./local-split-host-kaL99YNI.js","./ref-CG33owdM.js","./pages-DWkRbog-.js","./text-align-start-CvIfWAwj.js","./underline-D5npPcgf.js","./presentation-CrG2a4R-.js","./DocumentExportMenu-CxdmnnnP.js","./SlidesLayout-Bjds2UXz.css","./VerifyLayout-DNAp5mGi.js","./useAssetBase-4Ut9QhBI.js","./editor-BfOKfIhz.js","./WhiteboardEditor-cZ32fLqJ-DHGUDfT6.js","./code-DZDLeByL.js","./index3.css","./pen-tool-BwPmMqqj.js","./external-link-CxwFOzUH.js","./index4.css","./fit-BLbHgoq2.js","./VerifyLayout-B9e4RHAZ.css","./WhiteboardLayout-BuyJEwNS.js","./shims-s-YVfIlz.js","./backlinks-C_k8-LL2.js","./split-C-_Iw2K0.js","./route-messages-BblikCub.js","./SplitFrame-DY4Pomig.js","./split-C1umM5Fz.css","./PreviewLayout-AYrRaL1J.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-CkVEiakc.js";/* empty css */import{$ as f,An as p,Ar as m,At as h,Bt as g,Cr as _,Ct as v,D as y,Dn as b,Dt as x,Et as S,Fn as C,Ft as w,Gn as T,Gt as E,H as D,Ht as O,It as k,Jn as A,Kt as j,Ln as M,Lt as ee,Mt as te,Nn as N,Nt as ne,Ot as re,Pn as ie,Pt as ae,Q as oe,Rn as se,S as ce,Sr as le,St as ue,T as de,Tr as fe,Tt as pe,U as me,Ut as P,Vt as he,W as ge,Wn as _e,Wt as ve,_t as ye,at as F,bn as be,bt as xe,dt as Se,et as Ce,ft as we,gt as Te,h as Ee,ht as De,ir as Oe,it as ke,jn as Ae,jt as je,kt as Me,l as Ne,m as Pe,mt as Fe,nt as Ie,on as Le,ot as I,pt as Re,qn as ze,r as Be,rt as Ve,st as He,tt as Ue,vn as We,vt as Ge,wr as Ke,wt as qe,x as Je,xn as Ye,xr as Xe,xt as Ze,yn as Qe,yt as $e,zt as et}from"./url-64-774qp.js";import{$ as tt,K as nt,Q as rt,U as it,at as L,c as at,ct as ot,it as st,l as ct,o as lt,ot as R,r as ut,rt as dt,s as ft,u as pt}from"./mergeRefs-BoWyGCK7.js";import{n as mt,r as z,t as ht}from"./bem-vbke-3KC.js";import{t as gt}from"./react-DlmbjZJV.js";import{Dn as _t,Ft as vt,J as yt,Jn as bt,Mt as xt,Nt as St,Q as Ct,Rn as wt,Tn as Tt,Vt as Et,an as Dt,b as Ot,bn as kt,g as At,in as jt,n as Mt,on as Nt,rn as Pt,t as Ft,wn as It,x as Lt}from"./useLayerZIndex-t4BgGwYi.js";import{t as Rt}from"./jsx-runtime-LKYXHABd.js";import{$ as zt,B as Bt,Ct as Vt,G as Ht,I as Ut,J as Wt,M as Gt,N as Kt,P as qt,St as Jt,Tt as Yt,U as B,W as V,_t as Xt,a as Zt,bt as Qt,c as $t,ct as en,d as tn,dt as H,et as nn,gt as rn,h as an,ht as on,i as sn,l as cn,m as ln,mt as un,o as dn,p as fn,r as pn,s as mn,st as hn,t as gn,u as _n,ut as vn,wt as yn,xt as bn}from"./MotionConfigContext-B3czw3wn.js";import{$ as xn,$n as Sn,$t as Cn,A as wn,An as Tn,At as En,B as Dn,Bn as On,Bt as kn,C as An,Cn as jn,Cr as Mn,Ct as Nn,D as Pn,Dn as Fn,Dt as In,E as Ln,En as Rn,Et as zn,F as Bn,Fn as Vn,Ft as Hn,G as Un,Gn as Wn,Gt as Gn,H as Kn,Hn as qn,Ht as Jn,I as Yn,In as Xn,It as Zn,J as Qn,Jn as $n,Jt as er,K as tr,Kn as nr,Kt as rr,L as ir,Ln as ar,Lt as or,M as sr,Mn as cr,Mt as lr,N as ur,Nn as dr,Nt as fr,O as pr,On as mr,Ot as hr,P as gr,Pn as _r,Pt as vr,Q as yr,Qn as br,Qt as xr,R as Sr,Rn as Cr,Rt as wr,S as Tr,Sn as Er,Sr as Dr,St as Or,T as kr,Tn as Ar,Tr as jr,Tt as Mr,U as Nr,Un as Pr,Ut as Fr,V as Ir,Vn as Lr,Vt as Rr,W as zr,Wn as Br,Wt as Vr,X as Hr,Xn as Ur,Xt as Wr,Y as Gr,Yn as Kr,Yt as qr,Z as Jr,Zn as Yr,Zt as Xr,_ as Zr,_n as Qr,_r as $r,_t as ei,a as ti,an as ni,ar as ri,at as ii,b as ai,bn as oi,br as U,bt as si,c as ci,cn as li,cr as ui,ct as di,d as fi,dn as pi,dr as mi,dt as hi,en as gi,er as _i,et as vi,f as yi,fn as bi,fr as xi,ft as Si,g as Ci,gn as wi,gr as Ti,gt as Ei,h as Di,hn as Oi,ht as ki,i as Ai,in as ji,ir as Mi,it as Ni,j as Pi,jn as Fi,jt as Ii,k as Li,kn as Ri,kt as zi,l as Bi,ln as Vi,lr as Hi,lt as Ui,m as Wi,mn as Gi,mt as Ki,n as qi,nn as Ji,nr as Yi,nt as Xi,o as Zi,on as Qi,or as $i,ot as ea,p as ta,pn as na,pt as ra,q as ia,qn as aa,qt as oa,r as sa,rn as ca,rr as la,rt as ua,s as da,sn as fa,sr as pa,st as ma,t as ha,tn as ga,tr as _a,tt as va,u as ya,un as ba,ur as xa,ut as Sa,v as Ca,vn as wa,vr as Ta,vt as Ea,w as Da,wn as Oa,wr as ka,wt as Aa,x as ja,xn as Ma,xr as Na,xt as Pa,y as Fa,yn as Ia,yr as La,yt as Ra,z as za,zn as Ba,zt as Va}from"./elements-Coqr6-Yv.js";import{t as Ha}from"./is-html-element-DvgHo_1h.js";var Ua={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`]};Ua.node;var Wa=Yt(Ua),Ga={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`]};Ga.node;var Ka=Yt(Ga);function qa(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 Ja(e,t,n){return jr(e.getProps(),t,n,e)}var Ya=(e,t)=>t===`exit`?e.presenceContext?.custom:void 0,Xa=e=>Array.isArray(e);function Za(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ln(n))}function Qa(e){return Xa(e)?e[e.length-1]||0:e}function $a(e,t){let{transitionEnd:n={},transition:r={},...i}=Ja(e,t)||{};i={...i,...n};for(let t in i)Za(e,t,Qa(i[t]))}function eo(e){return!!(tn(e)&&e.add)}function to(e,t){let n=e.getValue(`willChange`);if(eo(n))return n.add(t);if(!n&&Qt.WillChange){let n=new Qt.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function no(e){return e.props[ka]}var ro=typeof window<`u`;function io({protectedKeys:e,needsAnimating:t},n){let r=n in e&&!t[n];return t[n]=!1,r}function ao(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?ee(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&&io(f,t))continue;let o={delay:n,...k(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(ro&&window.MotionHandoffAnimation){let n=no(e);if(n){let e=window.MotionHandoffAnimation(n,t,V);e!==null&&(o.startTime=e,p=!0)}}to(e,t);let m=l??e.shouldReduceMotion;r.run(w(t,r,i,m&&ne.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>V.update(()=>{o&&$a(e,o)});d.length?Promise.all(d).then(t):t()}return d}function oo(e,t,n={}){let r=Ja(e,t,Ya(e,n.type)),i=n.transitionOverride||(r?.transition??(e.getDefaultTransition()||{})),a=()=>Promise.all(r?ao(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(oo(e,t,{...n,delay:r+(typeof o==`function`?0:o)+qa(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 so(e,t,n={}){return e.notify(`AnimationStart`,t),(Array.isArray(t)?Promise.all(t.map(t=>oo(e,t,n))):typeof t==`string`?oo(e,t,n):Promise.all(ao(e,Ja(e,t,n.custom),n))).then(()=>{e.notify(`AnimationComplete`,t)})}var co=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],lo={value:null,addProjectionMetrics:null,countProjection:void 0};function uo(e,t){let n=vn.now();e=h(e);let r=({timestamp:i})=>{let a=i-n;a>=t&&(B(r),e(a-t))};return V.setup(r,!0),Me(()=>B(r))}function fo(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function po(e){return je(e)&&e.tagName===`svg`}var mo=e=>typeof e==`number`?e:parseFloat(e),ho=co.length,go=e=>typeof e==`number`||nn.test(e);function _o(e,t,n,r,i,a){i?(e.opacity=P(0,n.opacity??1,yo(r)),e.opacityExit=P(t.opacity??1,0,bo(r))):a&&(e.opacity=P(t.opacity??1,n.opacity??1,r));for(let i=0;i<ho;i++){let a=co[i],o=vo(t,a),s=vo(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||go(o)===go(s)?(e[a]=Math.max(P(mo(o),mo(s),r),0),(zt.test(s)||zt.test(o))&&(e[a]+=`%`)):e[a]=s)}for(let i=0;i<xe.length;i++){let a=xe[i];(t[a]||n[a])&&(e[a]=P(t[a]||0,n[a]||0,r))}}function vo(e,t){return e[t]===void 0?e.borderRadius:e[t]}var yo=xo(0,.5,ve),bo=xo(.5,.95,Xt);function xo(e,t,n){return r=>r<e?0:r>t?1:n(E(e,t,r))}var So=(e,t,{x:n,y:r})=>{let i=e*e+t*t;return i<1?0:-1e3*(n*e+r*t)/i},Co=(e,t=300)=>{let n=bn(.25,2,t/300),{stiffness:r,damping:i}=g({...e,duration:e.duration&&on(e.duration)});return{...e,stiffness:r,damping:i*Math.sqrt(n),mass:n}};function wo(e,t){e.min=t.min,e.max=t.max}function W(e,t){wo(e.x,t.x),wo(e.y,t.y)}function To(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Eo=.9999,Do=1.0001,Oo=-.01,ko=.01;function G(e){return e.max-e.min}function Ao(e,t,n){return Math.abs(e-t)<=n}function jo(e,t,n,r=.5){e.origin=r,e.originPoint=P(t.min,t.max,e.origin),e.scale=G(n)/G(t),e.translate=P(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Eo&&e.scale<=Do||isNaN(e.scale))&&(e.scale=1),(e.translate>=Oo&&e.translate<=ko||isNaN(e.translate))&&(e.translate=0)}function Mo(e,t,n,r){jo(e.x,t.x,n.x,r?.originX),jo(e.y,t.y,n.y,r?.originY)}function No(e,t,n,r=0){e.min=(r?P(n.min,n.max,r):n.min)+t.min,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=0){let i=r?P(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+G(t)}function Io(e,t,n,r){Fo(e.x,t.x,n.x,r?.x),Fo(e.y,t.y,n.y,r?.y)}function Lo(e,t,n,r,i){return e-=t,e=ye(e,1/n,r),i!==void 0&&(e=ye(e,1/i,r)),e}function Ro(e,t=0,n=1,r=.5,i,a=e,o=e){if(zt.test(t)&&(t=parseFloat(t),t=P(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=P(a.min,a.max,r);e===a&&(s-=t),e.min=Lo(e.min,t,n,s,i),e.max=Lo(e.max,t,n,s,i)}function zo(e,t,[n,r,i],a,o){Ro(e,t[n],t[r],t[i],t.scale,a,o)}var Bo=[`x`,`scaleX`,`originX`],Vo=[`y`,`scaleY`,`originY`];function Ho(e,t,n,r){zo(e.x,t,Bo,n?.x,r?.x),zo(e.y,t,Vo,n?.y,r?.y)}var Uo=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Wo=Uo(`applewebkit/`)&&!Uo(`chrome/`)?Math.round:Xt;function Go(e){e.min=Wo(e.min),e.max=Wo(e.max)}function Ko(e){Go(e.x),Go(e.y)}function qo(e){return e.translate===0&&e.scale===1}function Jo(e){return qo(e.x)&&qo(e.y)}function Yo(e,t){return e.min===t.min&&e.max===t.max}function Xo(e,t){return Yo(e.x,t.x)&&Yo(e.y,t.y)}function Zo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Qo(e,t){return Zo(e.x,t.x)&&Zo(e.y,t.y)}function $o(e){return G(e.x)/G(e.y)}function es(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var ts=class{constructor(){this.members=[]}add(e){Jt(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||(yn(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(yn(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 ns(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var rs={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(nn.test(e))e=parseFloat(e);else return e}return`${ns(e,t.target.x)}% ${ns(e,t.target.y)}%`}},is={borderRadius:Object.assign({},rs,{applyTo:co.slice()}),borderTopLeftRadius:rs,borderTopRightRadius:rs,borderBottomLeftRadius:rs,borderBottomRightRadius:rs,boxShadow:{correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Wt.parse(e);if(i.length>5)return r;let a=Wt.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=P(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 as(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<xe.length;e++){let t=xe[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 os=(e,t)=>e.depth-t.depth,ss=class{constructor(){this.children=[],this.isDirty=!1}add(e){Jt(this.children,e),this.isDirty=!0}remove(e){yn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(os),this.isDirty=!1,this.children.forEach(e)}},cs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ls=[`z`,`skew`,`skewZ`],us=1e3,ds=0;function fs(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}var ps=e=>e.instance&&an.get(e.instance)?.demote()&&e.resetSkewAndRotation();function ms(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=no(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&&ms(r)}function hs(e){if(e)return e.options.allowProjection===!1?hs(e.parent):e.projection}function gs({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return Object.assign(Mn,{...is,...Mn}),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:hs(e.parent));d.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||o&&fo(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=ds++,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(ys),this.nodes.forEach(As),this.nodes.forEach(js),this.nodes.forEach(bs),lo.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 ss)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new rn),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=je(t)&&!po(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=uo(i,250),cs.hasAnimatedSinceResize&&(cs.hasAnimatedSinceResize=!1,this.nodes.forEach(ks)))})}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()||Rs,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=n.getProps(),c=!this.targetLayout||!Qo(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={...k(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||ks(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(Ms),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&&ms(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;ps(this),this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,ps(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(Cs),this.nodes.forEach(Ss);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ws);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Es),this.nodes.forEach(Ds),this.nodes.forEach(Os),this.nodes.forEach(_s),this.nodes.forEach(vs)):this.nodes.forEach(ws),this.clearAllSnapshots();let e=vn.now();H.delta=bn(0,1e3/60,e-H.timestamp),H.timestamp=e,H.isProcessing=!0,Ht.update.process(H),Ht.preRender.process(H),Ht.render.process(H),H.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,mn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(xs),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&&ps(this);let t=this.projectionDelta&&!Jo(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||qe(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)),Ko(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(Vs))){let{scroll:e}=this.root;e&&($e(t.x,e.offset.x),$e(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),$e(t.x,i.offset.x),$e(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&&($e(a.x,-n.scroll.offset.x),$e(a.y,-n.scroll.offset.y)),qe(n.latestValues)&&Ge(a,n.latestValues,n.layout?.layoutBox)}return!r&&qe(this.latestValues)&&Ge(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(!qe(n.latestValues))continue;let r;n.instance&&(v(n.latestValues)&&n.updateSnapshot(),r=U(),W(r,n.measurePageBox())),Ho(t,n.latestValues,n.snapshot?.layoutBox,r)}return qe(this.latestValues)&&Ho(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(),Po(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),De(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),lo.countProjection?.(1))}getClosestProjectingParent(){if(!(!this.parent||v(this.parent.latestValues)||Ze(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(),Io(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;Te(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():(To(this.prevProjectionDelta.x,this.projectionDelta.x),To(this.prevProjectionDelta.y,this.projectionDelta.y)),Mo(this.projectionDelta,this.layoutCorrected,s,this.latestValues),this.treeScale.x===a&&this.treeScale.y===o&&es(this.projectionDelta.x,this.prevProjectionDelta.x)&&es(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),lo.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=Na(),this.projectionDelta=Na(),this.projectionDeltaWithTransform=Na()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Na();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(Ls));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?So(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?Ns(o[r],e[r],this.layout.layoutBox[r],l[t*2],l[t*2+1]):Ps(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){Io(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);let e=this.relativeTargetOrigin,t=s;if(Is(this.relativeTarget,e,t,n),this.isSpringLayout){let e=this.relativeTarget,t=this.impulse||0,n=this.relativeStart,r=vn.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&&Xo(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=U(),W(f,this.relativeTarget)}c&&(this.animationValues=a,_o(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(()=>{cs.hasAnimatedSinceResize=!0,this.motionValue||=ln(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=Co(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)=>he({...r,keyframes:n?[e[n-1],0]:r.keyframes,velocity:t})),a=i.length;t&&i.push(he({...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=O(c),c.next(0),this.edgeVelocity=e=>i[e+1].velocity(o),c}}}}}let a=Se(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,Bt(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?.(us),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&&Bs(this.options.animationType,this.layout.layoutBox,n.layoutBox)){let{layoutBox:e}=this.layout,t=i;i=this.target||U(),zs(i.x,t.x,e.x),zs(i.y,t.y,e.y)}W(t,i),Ge(t,r),Mo(this.projectionDeltaWithTransform,this.layoutCorrected,t,r)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ts),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(!ue(t))return;let n={};for(let t=0;t<ls.length;t++)fs(ls[t],e,n,this.animationValues);for(let t=0;t<xe.length;t++)fs(xe[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=Dr(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=Dr(t?.pointerEvents)||``),this.hasProjected&&!qe(this.latestValues)&&(e.transform=r?r({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=n.animationValues||n.latestValues;this.applyTransformsToTarget();let a=as(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 Mn){if(i[t]===void 0)continue;let{correct:r,applyTo:o,isCSSVariable:s}=Mn[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?Dr(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(Ss),this.root.sharedNodes.clear()}}}function _s(e){e.updateLayout(),Ts(e)}function vs(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`;wo(r[e],a[e])}else Bs(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=Na();Mo(c,n,t.layoutBox);let l=Na();Mo(l,a?e.applyTransform(r,!0):n,s);let u=!Jo(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();Io(c,a?e.resumeFrom.applyTransform(t.layoutBox,!0,void 0,!0,f.depth+1):t.layoutBox,r.layoutBox,s);let l=U();Io(l,n,i.layoutBox,s),a&&o(c,l),Qo(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 ys(e){lo.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 bs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function xs(e){e.clearSnapshot()}function Ss(e){e.clearMeasurements()}function Cs(e){e.isLayoutDirty=!0,e.updateLayout()}function ws(e){e.isLayoutDirty=!1}function Ts(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=>$e(t.layoutBox[e],r.layoutBox[e].min-i.layoutBox[e].min))}function Es(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.dragSnapshot||e.layout,e.isLayoutDirty=!0)}function Ds(e){e.relativeTarget&&e.relativeParent?.isLayoutDirty&&(e.currentAnimation?e.isLayoutDirty=!0:(e.targetDelta=void 0,e.removeRelativeTarget()))}function Os(e){let{visualElement:t}=e.options;t?.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function ks(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function As(e){e.resolveTargetDelta()}function js(e){e.calcProjection()}function Ms(e){e.resetSkewAndRotation()}function Ns(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 Ps(e,t,n){e.translate=P(t.translate,0,n),e.scale=P(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Fs(e,t,n,r){e.min=P(t.min,n.min,r),e.max=P(t.max,n.max,r)}function Is(e,t,n,r){Fs(e.x,t.x,n.x,r),Fs(e.y,t.y,n.y,r)}function Ls(e){return e.animationValues?.opacityExit!==void 0}var Rs={duration:.45,ease:[.4,0,.1,1]};function zs(e,t,n){e.max=G(n)+(e.min=t.min)}function Bs(e,t,n){return e===`position`||e===`preserve-aspect`&&!Ao($o(t),$o(n),.2)}function Vs(e){return e!==e.root&&e.scroll?.wasRoot}function Hs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Us=gs({attachResizeListener:(e,t)=>Hs(e,`resize`,t),measureScroll:we,checkIsScrollRoot:()=>!0}),Ws=gs({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!La.current){let e=new Us({});e.mount(window),e.setOptions({layoutScroll:!0}),La.current=e}return La.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Gs=class extends xi{constructor(){super(...arguments),this.KeyframeResolver=te}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;tn(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function Ks(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 qs(e){return window.getComputedStyle(e)}var Js=class extends Gs{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ks}mount(e){super.mount(e)}readValueFromInstance(e,t){if(Gt.has(t))return this.projection?.isProjecting?Kt(t):qt(e,t);{let n=qs(e),r=(hn(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Fe(e,t)}build(e,t,n){_n(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return mi(e,t,n)}},Ys=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1;function Xs(e){return{point:{x:e.pageX,y:e.pageY}}}var Zs=e=>t=>Ys(t)&&e(t,Xs(t));function Qs(e,t,n,r){return Hs(e,t,Zs(n),r)}var $s=new WeakMap,ec,tc=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:je(r)&&`getBBox`in r?r.getBBox()[t]:r[n],nc=tc(`inline`,`width`,`offsetWidth`),rc=tc(`block`,`height`,`offsetHeight`);function ic({target:e,borderBoxSize:t}){$s.get(e)?.forEach(n=>{n(e,{get width(){return nc(e,t)},get height(){return rc(e,t)}})})}function ac(e){e.forEach(ic)}function oc(){typeof ResizeObserver<`u`&&(ec=new ResizeObserver(ac))}function sc(e,t){ec||oc();let n=re(e);return n.forEach(e=>{let n=$s.get(e);n||(n=new Set,$s.set(e,n)),n.add(t),ec?.observe(e)}),()=>{n.forEach(e=>{let n=$s.get(e);n?.delete(t),n?.size||ec?.unobserve(e)})}}var cc=new Set,lc;function uc(){lc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};cc.forEach(t=>t(e))},window.addEventListener(`resize`,lc)}function dc(e){return cc.add(e),lc||uc(),()=>{cc.delete(e),!cc.size&&typeof lc==`function`&&(window.removeEventListener(`resize`,lc),lc=void 0)}}function fc(e,t){return Me(typeof e==`function`?dc(e):sc(e,t))}var pc=(e,t)=>Math.abs(e-t);function mc(e,t){let n=pc(e.x,t.x),r=pc(e.y,t.y);return Math.sqrt(n**2+r**2)}var hc=new Set([`auto`,`scroll`]),gc=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=vc(this.lastRawMoveEventInfo,this.transformPagePoint));let e=bc(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=mc(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:vn.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=vc(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=bc(e.type===`pointercancel`?this.lastMoveEventInfo:vc(t,this.transformPagePoint),this.history);this.startEvent&&n?.(e,a),r?.(e,a)},!Ys(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=s?0:a,this.contextWindow=r||window;let c=Xs(e),l=vc(c,this.transformPagePoint),{point:u}=l;this.history=[{...u,timestamp:vn.now()}];let{onSessionStart:d}=t;d&&d(e,bc(l,this.history));let f={passive:!0,capture:!0};this.removeListeners=j(Qs(this.contextWindow,`pointermove`,this.handlePointerMove,f),Qs(this.contextWindow,`pointerup`,this.handlePointerUp,f),Qs(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);(hc.has(e.overflowX)||hc.has(e.overflowY))&&this.scrollPositions.set(t,_c(t)),t=t.parentElement}this.scrollPositions.set(window,_c(window)),this.removeScrollListeners=j(Hs(window,`scroll`,this.onElementScroll,{capture:!0}),Hs(window,`scroll`,this.onWindowScroll,{}))}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=_c(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)}},_c=e=>e===window?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop};function vc(e,t){return t?{point:t(e.point)}:e}function yc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bc({point:e},t){return{point:e,delta:yc(e,Sc(t)),offset:yc(e,xc(t)),velocity:Cc(t,.1)}}function xc(e){return e[0]}function Sc(e){return e[e.length-1]}function Cc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Sc(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>on(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>on(t)*2&&(r=e[1]);let a=un(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 wc=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Tc(e){return wc.has(e.tagName)||e.isContentEditable===!0}var Ec=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Dc(e){return Ec.has(e.tagName)||e.isContentEditable===!0}var q={x:!1,y:!1};function Oc(){return q.x||q.y}function kc(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 Ac(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?P(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?P(n,e,r.max):Math.min(e,n)),e}function jc(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 Mc(e,{top:t,left:n,bottom:r,right:i}){return{x:jc(e.x,n,i),y:jc(e.y,t,r)}}function Nc(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 Pc(e,t){return{x:Nc(e.x,t.x),y:Nc(e.y,t.y)}}function Fc(e,t){let n=.5,r=G(e),i=G(t);return i>r?n=E(t.min,t.max-r,e.min):r>i&&(n=E(e.min,e.max-i,t.min)),bn(0,1,n)}function Ic(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 Lc=.35;function Rc(e=Lc){return e===!1?e=0:e===!0&&(e=Lc),{x:zc(e,`left`,`right`),y:zc(e,`top`,`bottom`)}}function zc(e,t,n){return{min:Bc(e,t),max:Bc(e,n)}}function Bc(e,t){return typeof e==`number`?e:e[t]||0}function Vc(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 Hc=new WeakMap,Uc=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=kc(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(en(t)&&(t=ae(t,this.visualElement.current)||0),nn.test(t))t=parseFloat(t);else if(zt.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),to(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=Yc(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 gc(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||!Jc(e,n,this.currentDirection))return;let r=this.getAxisMotionValue(e),i=this.originPoint[e]+t[e],a=this.constraints&&this.constraints[e];a&&(i=Ac(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;Wc(e)?this.constraints&&this.scroll===Vc(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=e&&r&&typeof e==`object`?Mc(r.layoutBox,e):!1,this.elastic=Rc(t),i!==this.constraints&&!Wc(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&K(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Ic(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!Wc(e))return!1;let n=Gc(e),{projection:r}=this.visualElement;if(!r||!r.layout)return!1;this.scroll=Vc(r);let i=Re(n,r.root,this.visualElement.getTransformPagePoint()),a=Pc(r.layout.layoutBox,r.removeElementScroll(i));if(t){let e=t(S(a));this.hasMutatedConstraints=!!e,e&&(a=pe(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)&&Jc(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(!Jc(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 to(this.visualElement,e),n.start(w(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(!Jc(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-P(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Wc(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]=Fc({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(!Jc(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(P(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Hc.set(this.visualElement,this);let e=this.visualElement.current,t=Qs(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Dc(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps(),r=Wc(t)&&Gc(t);r&&(this.constraints=this.resolveRefConstraints(),n||=qc(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=Hs(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(K(t=>{if(!Jc(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=Lc,dragMomentum:n=!0}=e;return{...e,dragElastic:t,dragMomentum:n}}};function Wc(e){return!!e&&typeof e==`object`&&(`current`in e||`nodeType`in e)}var Gc=e=>`current`in e?e.current:e;function Kc(e){let t=!0;return()=>{t?t=!1:e()}}function qc(e,t,n){let r=fc(e,Kc(n)),i=fc(t,Kc(n));return()=>{r(),i()}}function Jc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Yc(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}function Xc(e,t){let n=re(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},Me(()=>r.abort())]}function Zc(e){return!(e.pointerType===`touch`||Oc())}function Qc(e,t,n={}){t=h(t);let[r,i,a]=Xc(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(!Zc(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 $c=(e,t)=>t?e===t||$c(e,t.parentElement):!1,el=new WeakSet;function tl(e){return t=>{t.key===`Enter`&&e(t)}}function nl(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var rl=(e,t)=>{let n=!1,r=tl(()=>{n||el.has(e)||(n=!0,nl(e,`down`))}),i=tl(()=>{n&&(n=!1,nl(e,`up`))});e.addEventListener(`keydown`,r,t),e.addEventListener(`keyup`,i,t),e.addEventListener(`blur`,()=>{e.removeEventListener(`keydown`,r),e.removeEventListener(`keyup`,i),n&&nl(e,`cancel`)},{...t,once:!0})};function il(e){return Ys(e)&&!Oc()}var al=new WeakSet,ol=100,sl=8,cl=(e,t,n)=>Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)>n,ll=e=>e.preventDefault();function ul(e,t,n={}){t=h(t);let[r,i,a]=Xc(e,n),o=new WeakMap,s=e=>{let r=e.currentTarget;if(!il(e)||al.has(e))return;n.stopPropagation&&al.add(e);let{count:a=1,countTimeout:s=.3,hold:c=0,repeat:l}=n,u=vn.now(),d=on(c),f=on(s),p=o.get(r);p?.expire(cl(p.event,e,ol))?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(el.add(r),p)y=p.handlers;else{let n=t(r,e);y=typeof n==`function`?{onComplete:n}:n||{}}h&&_&&y.onActive?.();let b=on(l),x=d||b,S=u+x,C=!0,w=()=>{if(i.signal.aborted)return B(w);let e=Math.min(1-(S-vn.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(Ys(t)){if(window.removeEventListener(`pointerup`,D,T),window.removeEventListener(`pointercancel`,O,T),window.removeEventListener(`pointermove`,k,T),r.removeEventListener(`contextmenu`,ll),B(w),el.delete(r),Oc()&&(n=!1),n&&!h){let n=vn.now(),a=e=>{let s=i.signal.aborted;if(s||e===!0||vn.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||$c(r,e.target))},O=e=>{E(e,!1)},k=t=>{Ys(t)&&((l||!_)&&cl(e,t,sl)||a>1&&Oc())&&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`,ll,{...i,passive:!1}))};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,s,i),Ha(e)&&(e.addEventListener(`focus`,()=>rl(e,i),i),!Tc(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function dl(...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=et(i,a,o);return t?s(r):s}var fl=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},pl=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 ml(e,t,n,r){Ks(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(pl.has(n)?n:x(n),t.attrs[n])}var hl=class extends Gs{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=U}getBaseTargetFromProps(e,t){return Gt.has(t)?super.getBaseTargetFromProps(e,t)??Kt(t):e[t]}getDefaultValue(e){return Gt.has(e)?this.latestValues[e]??Kt(e):void 0}readValueFromInstance(e,t){if(Gt.has(t)){let e=Ut(t);return e&&e.default||0}if(cn.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=pl.has(t)?t:x(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Hi(e,t,n)}build(e,t,n){$t(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){ml(e,t,n,r)}mount(e){this.isSVGTag=xa(e.tagName),super.mount(e)}};function gl(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 _l=[...Ti].reverse(),vl=e=>e?.out===!0?e:e?.out;function yl(e){let t=t=>Promise.all(t.map(({animation:t,options:n})=>so(e,t,n))),n=xl(),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`&&Ja(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&&vl(f(l??(g&&g.props.initial))?.transition);if(_l.forEach((t,r)=>{let i=n[t],l=o[t],f=g&&g.props[t],v=l===void 0?$r(f)||f===!1?f:void 0:l,y=$r(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||Ta(v)||typeof v==`boolean`)return;if(b===!1&&(h=r),t===`exit`&&i.isActive&&b!==!0){m={...m,...i.prevResolvedValues};return}let S=bl(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}=Ja(e,n,Ya(e,t))||{};E={...E,...a,...i},D=vl(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)?!gl(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=Ja(s,n)?.transition?.delayChildren;r.delay=qa(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&&!tn(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=xl(),i=!0}}}function bl(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!gl(t,e):!1}function xl(){let e={};for(let t of Ti)e[t]={isActive:t===`animate`,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return e}var J=Rt(),Y=t(gt(),1);function Sl({children:e,features:t,strict:n=!1}){let[,r]=(0,Y.useState)(!Cl(t)),i=(0,Y.useRef)(void 0);if(!Cl(t)){let{renderer:e,...n}=t;i.current=e,pa(n)}return(0,Y.useEffect)(()=>{Cl(t)&&t().then(({renderer:e,...t})=>{pa(t),i.current=e,r(!0)})},[]),(0,J.jsx)(ui.Provider,{value:{renderer:i.current,strict:n},children:e})}function Cl(e){return typeof e==`function`}function wl(e,t){if(typeof Proxy>`u`)return Mi;let n=new Map,r=(n,r)=>Mi(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Mi(a,void 0,e,t)),n.get(a))})}var Tl=wl(),El=(e,t)=>t.isSVG??$i(e)?new hl(t):new Js(t,{allowProjection:e!==Y.Fragment}),Dl=class extends fl{constructor(e){super(e),e.animationState||=yl(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Ta(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?.()}},Ol=0,kl={animation:{Feature:Dl},exit:{Feature:class extends fl{constructor(){super(...arguments),this.id=Ol++}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}=Ja(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(){}}}},Al=class extends fl{constructor(e){super(e),this.removeGroupControls=Xt,this.removeListeners=Xt,this.controls=new Uc(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Xt}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()}},jl=e=>(t,n)=>{e&&V.update(()=>e(t,n),!1,!0)},Ml=class extends fl{constructor(){super(...arguments),this.removePointerDownListener=Xt}onPointerDown(e){this.session=new gc(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:jl(e),onStart:jl(t),onMove:jl(n),onEnd:(e,t)=>{delete this.session,r&&V.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Qs(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}},Nl=!1,Pl=({layout:e,layoutDependency:t,layoutAnchor:n})=>({layout:e,layoutDependency:t,layoutAnchor:n,animationType:typeof e==`string`?e:`both`}),Fl=(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)}},Il=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),Nl&&i.root.didUpdate(),i.options.layoutId!==r&&Fl(i,r)?.(),i.addEventListener(`animationComplete`,()=>this.safeToRemove()),i.setOptions({...i.options,...Pl(this.props),onExitComplete:()=>this.safeToRemove()})),cs.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(),Fl(o,n)),o.setOptions({...o.options,...Pl(this.props)}),Nl=!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(),mn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Nl=!0,r&&(r.scheduleCheckAfterUnmount(),t.group?.remove(r),n?.deregister?.(r))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}};function Ll(e){let[t,n]=ge(),r=(0,Y.useContext)(Zt);return(0,J.jsx)(Il,{...e,layoutGroup:r,switchLayoutGroup:(0,Y.useContext)(ri),isPresent:t,safeToRemove:n})}var Rl={pan:{Feature:Ml},drag:{Feature:Al,ProjectionNode:Ws,MeasureLayout:Ll}};function zl(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,Xs(t)))}var Bl=class extends fl{mount(){let{current:e}=this.node;e&&(this.unmount=Qc(e,(e,t)=>(zl(this.node,t,`Hover`,`Start`),e=>zl(this.node,e,`Hover`,`End`))))}unmount(){}},Vl=class extends fl{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=j(Hs(this.node.current,`focus`,()=>this.onFocus()),Hs(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Hl(e,t,n,r){e.current instanceof HTMLButtonElement&&e.current.disabled||zl(e,t,`Tap`,n,r)}var Ul=class extends fl{constructor(){super(...arguments),this.options={}}mount(){let{current:e}=this.node;e&&(this.update(),this.unmount=ul(e,(e,t)=>(Hl(this.node,t,`Start`),{onComplete:(e,{success:t})=>Hl(this.node,e,t?``:`Cancel`),onRepeat:()=>Hl(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(){}},Wl=new WeakMap,Gl=new WeakMap,Kl=e=>{let t=Wl.get(e.target);t&&t(e)},ql=e=>{e.forEach(Kl)};function Jl({root:e,...t}){let n=e||document;Gl.has(n)||Gl.set(n,{});let r=Gl.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(ql,{root:e,...t})),r[i]}function Yl(e,t,n){let r=Jl(t);return Wl.set(e,n),r.observe(e),()=>{Wl.delete(e),r.unobserve(e)}}var Xl={some:0,all:1},Zl=class extends fl{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:Xl[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=Yl(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(Ql(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Ql({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var $l=Object.assign({},Object.assign({renderer:El},kl,{inView:{Feature:Zl},tap:{Feature:Ul},focus:{Feature:Vl},hover:{Feature:Bl}}),Rl,{layout:{ProjectionNode:Ws,MeasureLayout:Ll}});function eu(e){let t=sn(()=>ln(e)),{isStatic:n}=(0,Y.useContext)(gn);if(n){let[,n]=(0,Y.useState)(e);(0,Y.useEffect)(()=>t.on(`change`,n),[])}return t}function tu(e,t){let n=eu(t()),r=()=>n.set(t());return r(),pn(()=>{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 nu(e){fn.current=[],e();let t=tu(fn.current,e);return fn.current=void 0,t}function ru(e,t,n,r){if(typeof e==`function`)return nu(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return au(e,t,n,r);let i=typeof t==`function`?t:dl(t,n,r),a=Array.isArray(e)?iu(e,i):iu([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 iu(e,t){let n=sn(()=>[]);return tu(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function au(e,t,n,r){let i=sn(()=>Object.keys(n)),a=sn(()=>({}));for(let o of i)a[o]=ru(e,t,n[o],r);return a}var ou=(0,Y.createContext)(null),su=(0,Y.createContext)(null);function cu(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:uu(t.x)+n.x,y:uu(t.y)+n.y},i=du(e),s=i.find(t=>t.items.includes(e[o])),c=i.reduce((e,t)=>fu(r.y,t)<fu(r.y,e)?t:e);if(c!==s)return pu(e,o,r.x,c,a);let l=mu(r,t),u=-1,d=l;return e.forEach((e,t)=>{if(t===o)return;let n=mu(r,e.layout);n<d&&(u=t,d=n)}),u===-1?e:Vt(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=uu(u);return s===1&&l.max+n[i]>d||s===-1&&l.min+n[i]<d?Vt(e,o,o+s):e}function lu(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=du(e).sort((e,t)=>e.min-t.min),r=n[n.findIndex(({items:n})=>n.includes(e[t]))+a],i=n=>Math.abs(uu(n.layout.x)-uu(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 uu=({min:e,max:t})=>P(e,t,.5);function du(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 fu(e,t){return e<t.min?t.min-e:e>t.max?e-t.max:0}function pu(e,t,n,r,i){let a=e.filter((e,n)=>n!==t),o=r.items.find(e=>{let t=uu(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 mu(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 hu=(e,t)=>e.max<=t.min||t.max<=e.min;function gu(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||=hu(e[r].x,e[i].x),n||=hu(e[r].y,e[i].y),t&&n)return`xy`;return t?`x`:`y`}var _u=(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 vu({children:e,as:t=`ul`,axis:n,onReorder:r,values:i,onPointerDownCapture:a,onClickCapture:o,...s},c,l){let u=sn(()=>l[t]),d=(0,Y.useContext)(ou),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?lu(r,i,c,x,!!l&&O()):-1;if(a>-1)n?k(Vt(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=gu(D().map(e=>e.layout));e!==g&&_(e)}},updateOrder:(e,t,n)=>{if(v.current)return;let r=D(),i=cu(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]),pn(()=>d?.add(A));let j={overflowAnchor:`none`,...s.style};return(0,J.jsx)(u,{...s,style:j,ref:_u(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)(su.Provider,{value:A,children:e})})}var yu=e=>(0,Y.forwardRef)((t,n)=>vu(t,n,e)),bu=50,xu=1.5,Su=new Set([`auto`,`scroll`]),Cu={x:new Map,y:new Map};function wu(){Cu.x.clear(),Cu.y.clear()}function Tu(e,t){let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY;return e===document.body||e===document.documentElement||Su.has(r)&&(t===`x`?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight)}function Eu(e,t){let n=e?.parentElement;for(;n;){if(Tu(n,t))return n;n=n.parentElement}return null}function Du(e){let t=Math.min(1,1-e/bu);return xu*t*t*H.delta}function Ou(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<bu?{amount:-Du(o),edge:`start`}:s<bu?{amount:Du(s),edge:`end`}:{amount:0,edge:null}}function ku(e,t,n,r){if(!e)return;let i=Eu(e,n);if(!i)return;let{amount:a,edge:o}=Ou(t-(n===`x`?window.scrollX:window.scrollY),i,n),s=Cu[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 Au(e,t=0){return tn(e)?e:eu(t)}function ju({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)(su),m=(0,Y.useContext)(ou),h=(0,Y.useRef)(null),g=sn(()=>p.proxy[r]),_=(0,Y.useRef)(),v={x:Au(t.x),y:Au(t.y)},y=ru([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),dn.get(e)?.animationState?.setActive(`whileDrag`,!!t)},M=(0,Y.useRef)(!1);return pn(()=>{m?.receive(p,n,h.current,j)&&(M.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)=>{M.current?M.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)ku(m&&!b.includes(e)?m.column(p):C.current,i[e],e,r[e]);a&&a(e,t)},onDragEnd:(e,t)=>{w.current=!1,wu(),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:_u(h,f),ignoreStrict:!0,children:e})}var Mu=(0,Y.forwardRef)(ju),Nu=e=>{let{left:t,top:n,width:r,height:i}=e.getBoundingClientRect();return{x:t+r/2,y:n+i/2}},Pu=e=>{let{x:t,y:n}=Nu(e),{scrollX:r,scrollY:i}=e.ownerDocument.defaultView;return{x:t+r,y:n+i}};function Fu(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 Iu=(e,t)=>{let n=e.groupRef.current,r=t.groupRef.current;return n.contains(r)||r.contains(n)};function Lu(e){let t=new Set,n,r=(t,n,r)=>!Iu(t,n)&&e.current.canMove?.(r,t.values,n.values)!==!1,i,a=(e,t,r,i,a,o)=>{let s=Nu(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=>Fu(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:Pu(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=Pu(o),n.event=s),!0;let c=Nu(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=dn.get(o);return a(e,l,i,o,{controls:u&&Hc.get(u),event:s}),!0},key:(e,n,o,s,c)=>{let l=Nu(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=dn.get(r),o=a&&Hc.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:(mn.read(()=>{if(n!==s)return;n=void 0,dn.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(Pu(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 Ru({children:e,...t}){let n=(0,Y.useRef)(t);return pn(()=>{n.current=t}),(0,J.jsx)(ou.Provider,{value:sn(()=>Lu(n)),children:e})}var zu=e=>{e.stopPropagation()},Bu=e=>{e.preventDefault(),e.stopPropagation(),e.preventBaseUIHandler?.()},Vu={anchor:null,iconSpaceMode:`global`,items:[],open:!1,triggerId:null},Hu=Vu,Uu=new Set,Wu={ready:!1,triggerId:null,x:0,y:0},Gu=()=>{Uu.forEach(e=>e())},Ku=e=>(Uu.add(e),()=>Uu.delete(e)),qu=()=>Hu,Ju=()=>Vu,Yu=e=>{Wu.x=e.clientX,Wu.y=e.clientY,Wu.ready=!0,Wu.triggerId=e.target instanceof Element?e.target.closest(`[data-contextmenu-trigger]`)?.dataset.contextmenuTrigger??null:null},Xu=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})}),Zu=e=>{Hu={...Hu,...e},Gu()},Qu=null,$u=(e,t)=>{let n={x:window.innerWidth/2,y:window.innerHeight/2};Zu({anchor:Xu(Wu.ready?{x:Wu.x,y:Wu.y}:n),footer:t?.footer,header:t?.header,iconAlign:t?.iconAlign,iconSpaceMode:t?.iconSpaceMode??`global`,items:e,listItemHeight:t?.listItemHeight,open:!0,triggerId:Wu.triggerId??null,virtual:t?.virtual})},ed=(e,t)=>{typeof window<`u`&&(Qu?.show?Qu.show(e,t,()=>$u(e,t)):$u(e,t))},td=()=>{Zu({anchor:null,footer:void 0,header:void 0,iconSpaceMode:`global`,items:[],listItemHeight:void 0,open:!1,triggerId:null,virtual:void 0})},nd=()=>{Qu?.close?Qu.close(td):td()};function rd(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=it(),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)(_e.Provider,{value:u,children:(0,J.jsx)(T.Provider,{value:void 0,children:(0,J.jsx)(Ye,{...e})})})}var id=b,X=ht({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`]}),ad=(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}=Ft(`floating`,r),o=typeof t==`function`?e=>({zIndex:i,...t(e)}):{zIndex:i,...t};return(0,J.jsx)(id,{...n,className:z(F.positioner,X(`positioner`)),collisionPadding:e??ze(),ref:a,style:o})});ad.displayName=`ContextMenuSubmenuPositioner`;var od=(0,Y.memo)(()=>{let{t:e}=me(D);return(0,J.jsx)(N,{disabled:!0,className:z(R(I.item,I.empty).className,X(`item`)),children:(0,J.jsx)(`div`,{className:z(F.itemContent,X(`item-content`)),children:(0,J.jsx)(`span`,{className:z(F.label,X(`label`)),children:e(`common.empty`)})})})});od.displayName=`EmptyMenuItem`;var sd=({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)(N,{closeOnClick:n,disabled:a,label:o,className:z(R(I.item,r&&I.danger).className,X(`item`)),onClick:e=>{e.preventDefault(),a||f(!d)},children:[t,(0,J.jsx)(`span`,{className:z(F.switchWrap,X(`switch`)),onFocus:e=>e.stopPropagation(),children:(0,J.jsx)(He,{checked:d,disabled:a,size:`small`,tabIndex:-1,onChange:f,onClick:(e,t)=>t.stopPropagation()})})]})},cd=(e,t,n)=>{let r=Ce(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(F.labelGroup,X(`label-group`)),children:[(0,J.jsx)(`span`,{className:z(F.label,X(`label`)),children:r}),(0,J.jsx)(`span`,{className:z(F.desc,X(`desc`)),children:i})]}):(0,J.jsx)(`span`,{className:z(F.label,X(`label`)),children:r});return(0,J.jsxs)(`div`,{className:z(R(I.itemContent,s&&I.itemContentAlignStart).className,X(`item-content`)),children:[u?(0,J.jsx)(`span`,{"aria-hidden":!l,className:z(R(I.icon,s&&I.iconAlignStart).className,ke.icon,X(`icon`)),children:c?n:l?Ve(e.icon,`small`):null}):null,d,a?(0,J.jsx)(`span`,{className:z(F.extra,X(`extra`)),children:a}):null,o&&n?n:null,t?.submenu?(0,J.jsx)(`span`,{className:z(F.submenuArrow,X(`submenu-arrow`)),children:(0,J.jsx)(oe,{})}):null]})},ld=(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)},ud=(e,t=[],n)=>{let r=n?.iconAlign,i=n?.iconSpaceMode??`global`,a=n?.reserveIconSpace??Ue(e,i===`global`),o=n?.indicatorOnRight??Ie(e);return e.map((e,n)=>{if(!e)return null;let s=`${t.join(`-`)||`root`}-${n}`,c=f(e,s),l=[...t,String(c)];if(e.type===`checkbox`){let t=e,n=Ce(t),i=typeof n==`string`?n:void 0,s=!!t.danger,l=(0,J.jsx)(M,{className:X(`checkbox-indicator`),children:(0,J.jsx)(ut,{icon:fe,size:`small`})});return(0,J.jsx)(se,{checked:t.checked,closeOnClick:t.closeOnClick,defaultChecked:t.defaultChecked,disabled:t.disabled,label:i,className:z(R(I.item,s&&I.danger).className,X(`item`)),onCheckedChange:e=>t.onCheckedChange?.(e),children:cd(t,{iconAlign:r,indicatorOnRight:o,reserveIconSpace:a},l)},c)}if(e.type===`switch`){let t=e,n=Ce(t),i=typeof n==`string`?n:void 0,o=!!t.danger;return(0,J.jsx)(sd,{checked:t.checked,closeOnClick:t.closeOnClick,danger:o,defaultChecked:t.defaultChecked,disabled:t.disabled,label:i,onCheckedChange:t.onCheckedChange,children:cd(t,{iconAlign:r,reserveIconSpace:a})},c)}if(e.type===`divider`)return(0,J.jsx)(Qe,{className:z(F.separator,X(`separator`))},c);if(e.type===`group`){let t=e,n=i===`group`?t.children?Ue(t.children):!1:a,o=t.children?Ie(t.children):!1;return(0,J.jsxs)(C,{className:X(`group`),children:[t.label?(0,J.jsx)(ie,{className:z(F.groupLabel,X(`group-label`)),children:t.label}):null,t.children?ud(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=Ce(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?ud(t.children,l,{iconAlign:r,iconSpaceMode:i}):(0,J.jsx)(od,{});return(0,J.jsxs)(be,{defaultOpen:t.defaultOpen,open:t.open,onOpenChange:t.onOpenChange,children:[(0,J.jsx)(We,{...t.triggerProps,closeDelay:t.closeDelay,delay:t.delay,disabled:t.disabled,label:o,openOnHover:t.openOnHover,className:z(R(I.item,s&&I.danger).className,X(`item`)),onClick:t.onClick,children:cd(t,{iconAlign:r,reserveIconSpace:a,submenu:!0})}),(0,J.jsx)(p,{children:(0,J.jsx)(ad,{alignOffset:-4,"data-submenu":``,sideOffset:-1,onContextMenu:Bu,children:(0,J.jsxs)(Ae,{className:z(R(I.popup,u&&I.popupWithSlots).className,ke.popup,X()),children:[t.header==null?null:(0,J.jsx)(`div`,{className:z(F.header,X(`header`)),children:t.header}),u?(0,J.jsx)(`div`,{className:z(F.slotViewport,X(`viewport`)),children:d}):d,t.footer==null?null:(0,J.jsx)(`div`,{className:z(F.footer,X(`footer`)),children:t.footer})]})})})]},c)}let u=e,d=Ce(u),m=typeof d==`string`?d:void 0,h=`danger`in u&&!!u.danger;return(0,J.jsx)(N,{closeOnClick:u.closeOnClick,disabled:u.disabled,label:m,className:z(R(I.item,h&&I.danger).className,X(`item`)),onClick:e=>ld(u,l,e),children:cd(u,{iconAlign:r,reserveIconSpace:a})},c)})},dd={"--lobe-dropdown-animation-duration":`0ms`},fd=(0,Y.memo)(()=>{let e=A(),t=ot(),n=(0,Y.useSyncExternalStore)(Ku,qu,Ju);(0,Y.useEffect)(()=>{},[e]),(0,Y.useEffect)(()=>{let e=e=>Yu(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)(()=>ud(n.items,[],{iconAlign:n.iconAlign,iconSpaceMode:n.iconSpaceMode}),[n.items,n.iconAlign,n.iconSpaceMode]),{zIndex:i,ref:a}=Ft(`floating`),o=n.header!=null||n.footer!=null;return!e||!n.open&&n.items.length===0?null:(0,J.jsx)(rd,{open:n.open,onOpenChange:e=>{e?Zu({open:e}):nd()},children:(0,J.jsx)(p,{container:t,children:(0,J.jsx)(id,{anchor:n.anchor??void 0,className:z(F.positioner,X(`positioner`)),collisionPadding:ze(),ref:a,sideOffset:6,style:{...dd,zIndex:i},children:(0,J.jsxs)(Ae,{"data-has-footer":n.footer==null?void 0:``,"data-has-header":n.header==null?void 0:``,className:z(R(I.popup,o&&I.popupWithSlots).className,ke.popup,X()),onContextMenu:Bu,children:[n.header==null?null:(0,J.jsx)(`div`,{className:z(F.header,X(`header`)),children:n.header}),n.virtual?(0,J.jsx)(Le,{className:X(`viewport`),itemSize:n.listItemHeight,children:r}):o?(0,J.jsx)(`div`,{className:z(F.slotViewport,X(`viewport`)),children:r}):r,n.footer==null?null:(0,J.jsx)(`div`,{className:z(F.footer,X(`footer`)),children:n.footer})]})})})})});fd.displayName=`ContextMenuHost`;function pd(e,t){let n=(t??wt(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 md=Y.createContext(void 0);function hd(){let e=Y.useContext(md);if(!e)throw Error(rt(73));return e}var gd=0;function _d(e){return gd+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${gd}`}function vd(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 yd(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 bd(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 Z={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},xd=class extends Ot{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:yd(e.toasts)},{},Z)}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=bd(this.state.toasts,t);r.toasts=e,r.toastMetadata=yd(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=Z.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||_d(`toast`);if(e.id){let t=Z.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(bd(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),Z.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{let n=Z.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=Z.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)),Z.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=Z.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=bd(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=vd(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=vd(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=vd(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??=at.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=Nt(e);Dt(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=Z.expandedOrOutOfFocus(this.state)?void 0:at.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:yd(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=Pt(_t(this.state.viewport));if(!this.state.viewport||!Dt(this.state.viewport,t)||!Et(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=Z.toasts(this.state),r=Z.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()}},Sd=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=st(()=>new xd({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return pt(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)(md.Provider,{value:a,children:[(0,J.jsx)(Cd,{store:a,timeout:n,limit:r}),t]})};function Cd(e){let{store:t,timeout:n,limit:r}=e;return tt(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var wd=`--toast-frontmost-height`,Td=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=hd(),c=ct(),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=wt(e),n=_t(e);function r(t){t.key===`F6`&&Nt(t)!==e&&(t.preventDefault(),s.set(`prevFocusElement`,Pt(n)),e?.focus({preventScroll:!0}),s.pauseTimers(),s.set(`focused`,!0))}function i(e){Nt(e)===t&&(s.set(`isWindowFocused`,!1),s.pauseTimers())}function a(n){if(n.relatedTarget)return;let r=Nt(n),i=Pt(_t(e));r!==t&&Dt(e,r)&&Et(i)||s.resumeTimers(),c.start(0,()=>s.set(`isWindowFocused`,!0))}return vt(It(t,`keydown`,r),It(t,`blur`,i,!0),It(t,`focus`,a,!0),It(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&&Nt(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||Et(Pt(_t(s.state.viewport)))&&(s.set(`focused`,!0),s.pauseTimers())}function O(e){m&&!Dt(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:{[wd]:_?`${_}px`:void 0}},A={expanded:h},j=!f&&g&&(0,J.jsx)(xt,{onFocus:b}),M=nt(`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,M,!m&&y.length>0&&(0,J.jsx)(`div`,{style:St,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))})]})}),Ed=Y.createContext(void 0);function Dd(){let e=Y.useContext(Ed);if(!e)throw Error(rt(66));return e}function Od(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 kd=`--toast-index`,Ad=`--toast-offset-y`,jd=`--toast-height`,Md=`--toast-swipe-movement-x`,Nd=`--toast-swipe-movement-y`,Pd=`data-swipe-direction`,Fd=t(u(),1),Id={...bt,swipeDirection(e){return e?{[Pd]:e}:null}},Ld=40,Rd=10,zd=.5,Bd=1,Vd=`${yt},${Ct}`,Hd=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=hd(),[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}),M=Y.useRef(void 0),ee=Y.useRef(0),te=Y.useRef(!1),N=Y.useRef({x:0,y:0}),ne=Y.useRef(!1),re=Y.useRef({x:0,y:0}),ie=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`);kt({open:n.transitionStatus!==`ending`,ref:O,onComplete(){n.transitionStatus===`ending`&&d.removeToast(n.id)}});let de=dt((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?Fd.flushSync(a):a()});tt(()=>{let e=k.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(p(void 0),x({x:0,y:0,scale:1}),fe({x:0,y:0})),k.current=n.id,de())},[de,n.id,n.transitionStatus]);function fe(e){re.current=e,y(e)}tt(()=>()=>{ae.current?.abort()},[]);function pe(e,t){let n=e=>e>0?e**zd:-(Math.abs(e)**zd),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 me=dt(e=>{if(e.pointerId!==ie.current)return;ie.current=null,ae.current?.abort(),ae.current=null,h(!1),_(!1),D(null);let t=j.current;if(e.type===`pointercancel`||te.current){fe({x:t.x,y:t.y}),p(void 0);return}let r=re.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of l)if(Od(e,i,a)>Ld){o=e;break}o?(p(o),d.closeToast(n.id)):(fe({x:t.x,y:t.y}),p(void 0))});function P(e){if(e.button!==0)return;e.pointerType===`touch`&&d.pauseTimers();let t=Nt(e.nativeEvent);if(jt(t,`button,a,input,textarea,[role="button"],${Vd}`))return;te.current=!1,M.current=void 0,ee.current=0,ie.current=e.pointerId,A.current={x:e.clientX,y:e.clientY},N.current=A.current;let n=e.currentTarget,r=pd(n);j.current=r,x(r),fe({x:r.x,y:r.y}),d.set(`hovering`,!0),h(!0),_(!1),D(null),ne.current=!0,ae.current?.abort();let i=new AbortController;ae.current=i;let a=_t(n);a.addEventListener(`pointerup`,me,{signal:i.signal}),a.addEventListener(`pointercancel`,me,{signal:i.signal}),n.setPointerCapture?.(e.pointerId)}function he(e){if(e.pointerId!==ie.current)return;e.preventDefault(),ne.current&&=(A.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>N.current.y||i>0&&t<N.current.y)&&(N.current={x:N.current.x,y:t}),(r<0&&n>N.current.x||r>0&&n<N.current.x)&&(N.current={x:n,y:N.current.y});let a=n-A.current.x,o=t-A.current.y,s=t-N.current.y,c=n-N.current.x,u=E;if(!g&&Math.sqrt(a*a+o*o)>=Bd){_(!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(!M.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)&&(M.current=d,ee.current=Od(d,a,o),p(d));else{let e=M.current,t=Od(e,c,s);t>Ld?(te.current=!1,p(e)):!(l.includes(`left`)&&l.includes(`right`))&&!(l.includes(`up`)&&l.includes(`down`))&&ee.current-t>=Rd&&(te.current=!0)}let f=pe(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),fe({x:m,y:h})}function ge(e){if(e.key===`Escape`){if(!O.current||!Dt(O.current,Pt(_t(O.current))))return;d.closeToast(n.id)}}Y.useEffect(()=>{let e=O.current;if(!u||!e)return;function t(t){ie.current!==null&&Dt(e,Nt(t))&&t.preventDefault()}return It(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,[Md]:`${e}px`,[Nd]:`${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?P:void 0,onPointerMove:u?he:void 0,onPointerUp:u?me:void 0,onPointerCancel:u?me:void 0,onKeyDown:ge,inert:At(n.limited),style:{..._e(),[kd]:n.transitionStatus===`ending`?oe:se,[Ad]:`${ce}px`,[jd]:n.height?`${n.height}px`:void 0}},F=Y.useMemo(()=>({toast:n,setTitleId:C,setDescriptionId:T,recalculateHeight:de,visibleIndex:se,expanded:ue}),[n,C,T,de,se,ue]),be={transitionStatus:n.transitionStatus,expanded:ue,limited:n.limited||!1,type:n.type,swiping:m,swipeDirection:f},xe=nt(`div`,e,{ref:[t,O],state:be,stateAttributesMapping:Id,props:[ye,s]});return(0,J.jsx)(Ed.Provider,{value:F,children:xe})}),Ud=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=Dd(),l=Y.useRef(null);return tt(()=>{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]),nt(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})});function Wd(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(Wd)}function Gd(e){return Y.isValidElement(e)&&Wd(e.props.children)}function Kd(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=Dd(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:it(e),children:s,type:r.type,setId:o}}function qd(e,t,n){let r=Gd(e);return tt(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var Jd=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}=Kd(a,o,`description`);return qd(nt(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Yd=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}=Kd(a,o,`title`);return qd(nt(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Xd=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=hd(),{toast:l,expanded:u}=Dd(),[d,f]=Y.useState(!1),{getButtonProps:p,buttonRef:m}=Tt({disabled:a,native:o}),h={type:l.type};return nt(`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]})}),Zd=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=Dd(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=Tt({disabled:a,native:o}),f={type:c.type},p=nt(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return Gd(p)?p:null}),Qd=Y.forwardRef(function(e,t){return(0,J.jsx)(Oe,{ref:t,...e})});function $d(){let e=hd(),t=e.useState(`toasts`);return Y.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function ef(){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||_d(`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 tf=(0,Y.createContext)({position:`bottom-right`,swipeDirection:[`down`,`right`]}),nf=()=>(0,Y.useContext)(tf),rf=[],af=new Set,of=()=>{for(let e of af)e()},sf=e=>(rf.push(e),of(),()=>{let t=rf.indexOf(e);t!==-1&&rf.splice(t,1),of()}),cf=e=>rf[0]===e,lf=e=>(af.add(e),()=>{af.delete(e)}),uf=20,df=5e3,ff=!1,pf=[],mf=e=>{ff?e():(pf.length>=uf&&pf.shift(),pf.push({queuedAt:Date.now(),run:e}))},hf=()=>{ff=!0;let e=pf;pf=[];let t=Date.now();for(let n of e)t-n.queuedAt<=df&&n.run()},gf=()=>{ff=!1},Q=ht({block:`toast`,dataAttributes:[`type`,`position`],elements:[`viewport`,`content`,`body`,`icon`,`main`,`title-row`,`title`,`close`,`description`,`actions`,`action`]}),$={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}},_f={bottom:$.viewportBottom,"bottom-left":$.viewportBottomLeft,"bottom-right":$.viewportBottomRight,top:$.viewportTop,"top-left":$.viewportTopLeft,"top-right":$.viewportTopRight},vf={bottom:$.rootBottom,"bottom-left":$.rootBottom,"bottom-right":$.rootBottom,top:$.rootTop,"top-left":$.rootTop,"top-right":$.rootTop},yf={danger:$.actionDanger,ghost:$.actionGhost,primary:$.actionPrimary,secondary:$.actionSecondary,text:$.actionText},bf={default:Ke,error:Ka,info:Ke,loading:_,success:Wa,warning:le},xf={default:Xe.colorText,error:Xe.colorError,info:Xe.colorInfo,loading:Xe.colorPrimary,success:Xe.colorSuccess,warning:Xe.colorWarning},Sf=(0,Y.memo)(({toast:e,classNames:t,styles:n})=>{let{position:r,swipeDirection:i}=nf(),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=xf[o],g=u??bf[o],_=o===`loading`,v=()=>g?(0,J.jsx)(`div`,{...L($.icon,z(Q(`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($.actions,z(Q(`actions`),t?.actions),n?.actions),children:m.map((e,r)=>(0,J.jsx)(Zd,{...L([$.action,lt.info,yf[e.variant??`primary`]],z(Q(`action`),t?.action),n?.action),onClick:e.onClick,...e.props,children:e.label},r))}):p?(0,J.jsx)(Zd,{...L([$.action,lt.info,$.actionPrimary],z(Q(`action`),t?.action),n?.action),...p}):null;return(0,J.jsx)(Hd,{swipeDirection:i,toast:e,...mt({position:r,type:o}),...L([$.root,vf[r]],z(Q(),t?.root),{...n?.root,...a?.style}),children:(0,J.jsx)(Ud,{...L($.content,z(Q(`content`),t?.content),n?.content),children:(0,J.jsxs)(`div`,{...L($.toastBody,Q(`body`)),children:[v(),(0,J.jsxs)(`div`,{...L($.contentArea,Q(`main`)),children:[d?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{...L($.titleRow,Q(`title-row`)),children:[(0,J.jsx)(Yd,{...L($.title,z(Q(`title`),t?.title),n?.title),children:d}),l&&(0,J.jsx)(Xd,{"aria-label":`Close`,...L($.close,z(Q(`close`),t?.close),n?.close),children:(0,J.jsx)(ft,{size:14})})]}),f&&(0,J.jsx)(Jd,{...L([$.description,$.descriptionWithTitle],z(Q(`description`),t?.description),n?.description),children:f})]}):f&&(0,J.jsxs)(`div`,{...L($.titleRow,Q(`title-row`)),children:[(0,J.jsx)(Jd,{...L([$.description,$.descriptionStandalone],z(Q(`description`),t?.description),n?.description),children:f}),l&&(0,J.jsx)(Xd,{"aria-label":`Close`,...L($.close,z(Q(`close`),t?.close),n?.close),children:(0,J.jsx)(ft,{size:14})})]}),y()]})]})})})});Sf.displayName=`ToastItem`;var Cf=[`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`],wf={duration:5e3,limit:5,position:`bottom-right`,swipeDirection:[`down`,`right`]},Tf={bottom:ef(),"bottom-left":ef(),"bottom-right":ef(),top:ef(),"top-left":ef(),"top-right":ef()},Ef={bottom:new Map,"bottom-left":new Map,"bottom-right":new Map,top:new Map,"top-left":new Map,"top-right":new Map},Df=e=>Tf[e],Of=0,kf=()=>`toast-${Date.now().toString(36)}-${(Of++).toString(36)}`,Af=e=>Cf.find(t=>Ef[t].has(e)),jf=(e,t)=>Array.from(Ef[e].keys()).at(-1)===t,Mf=(e,t)=>typeof e==`string`?{description:e,type:t}:{...e,type:t},Nf=(e,t)=>({close:()=>mf(()=>Df(t).close(e)),id:e,update:n=>{mf(()=>Df(t).update(e,{data:n,description:n.description,title:n.title}))}}),Pf=e=>{let t=e.placement??wf.position,n=Df(t),{id:r,onClose:i,onRemove:a}=e;if(r){let e=Af(r);e&&!(e===t&&jf(t,r))&&(Ef[e].get(r).superseded=!0,Ef[e].delete(r),mf(()=>Df(e).close(r)))}let o=r??kf(),s={superseded:!1};return Ef[t].set(o,s),mf(()=>{n.add({id:o,data:e,description:e.description,onClose:()=>{s.superseded||i?.()},onRemove:()=>{s.superseded||(Ef[t].delete(o),a?.())},timeout:e.duration??wf.duration,title:e.title})}),Nf(o,t)},Ff=e=>{if(e)for(let[t,n]of Object.entries(Tf))Ef[t].delete(e),mf(()=>n.close(e));else for(let[e,t]of Object.entries(Tf)){let n=Array.from(Ef[e].keys());Ef[e].clear(),mf(()=>{for(let e of n)t.close(e)})}},If=e=>Pf(Mf(e,`success`)),Lf=e=>Pf(Mf(e,`error`)),Rf=e=>Pf(Mf(e,`info`)),zf=e=>Pf(Mf(e,`warning`)),Bf=e=>Pf({duration:0,...Mf(e,`loading`)});async function Vf(e,t){let n=Pf({closable:!1,duration:0,type:`loading`,...typeof t.loading==`string`?{description:t.loading}:t.loading});try{let r=await e;return n.close(),Pf({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(),Pf({type:`error`,...typeof t.error==`string`?{description:t.error}:typeof t.error==`function`?{description:t.error(e)}:t.error}),e}}var Hf=Object.assign(e=>Pf({type:`default`,...e}),{dismiss:Ff,error:Lf,info:Rf,loading:Bf,promise:Vf,success:If,warning:zf}),Uf=(0,Y.memo)(()=>{let{toasts:e}=$d();return e.map(e=>(0,J.jsx)(Sf,{toast:e},e.id))});Uf.displayName=`ToastList`;var Wf=(0,Y.memo)(({root:e,className:t,duration:n=5e3,limit:r=5,position:i=`bottom-right`,swipeDirection:a=[`down`,`right`]})=>{let o=A(),s=ot(),[c,l]=(0,Y.useState)(void 0),u=(0,Y.useId)();(0,Y.useEffect)(()=>sf(u),[u]);let d=(0,Y.useSyncExternalStore)(lf,()=>cf(u),()=>!1);if((0,Y.useEffect)(()=>{d&&(wf={duration:n,limit:r,position:i,swipeDirection:a})},[n,r,i,a,d]),(0,Y.useEffect)(()=>{d&&l(Mt(`toast`))},[d]),(0,Y.useEffect)(()=>{if(d&&o)return hf(),()=>{gf()}},[d,o]),!o||!d)return null;let f=e??s??document.body;return Cf.map(e=>(0,J.jsx)(tf,{value:{position:e,swipeDirection:a},children:(0,J.jsx)(Sd,{limit:r,timeout:n,toastManager:Df(e),children:(0,J.jsx)(Qd,{container:f,children:(0,J.jsx)(Td,{"data-position":e,...L([$.viewport,_f[e]],z(Q(`viewport`),t),c===void 0?void 0:{zIndex:c}),children:(0,J.jsx)(Uf,{})})})})},e))});Wf.displayName=`ToastHost`;var Gf=e({Board:()=>Ru,Group:()=>Kf,Item:()=>Mu}),Kf=yu(Tl),qf=e({Reorder:()=>Gf,a:()=>ha,abbr:()=>qi,address:()=>sa,animate:()=>Ai,area:()=>ti,article:()=>Zi,aside:()=>da,audio:()=>ci,b:()=>Bi,base:()=>ya,bdi:()=>fi,bdo:()=>yi,big:()=>ta,blockquote:()=>Wi,body:()=>Di,button:()=>Ci,canvas:()=>Zr,caption:()=>Ca,circle:()=>Fa,cite:()=>ai,clipPath:()=>ja,code:()=>Tr,col:()=>An,colgroup:()=>Da,create:()=>la,data:()=>kr,datalist:()=>Ln,dd:()=>Pn,defs:()=>pr,del:()=>Li,desc:()=>wn,details:()=>Pi,dfn:()=>sr,dialog:()=>ur,div:()=>gr,dl:()=>Bn,dt:()=>Yn,ellipse:()=>ir,em:()=>Sr,embed:()=>za,feBlend:()=>Dn,feColorMatrix:()=>Ir,feComponentTransfer:()=>Kn,feComposite:()=>Nr,feConvolveMatrix:()=>zr,feDiffuseLighting:()=>Un,feDisplacementMap:()=>tr,feDistantLight:()=>ia,feDropShadow:()=>Qn,feFlood:()=>Gr,feFuncA:()=>Hr,feFuncB:()=>Jr,feFuncG:()=>yr,feFuncR:()=>xn,feGaussianBlur:()=>vi,feImage:()=>va,feMerge:()=>Xi,feMergeNode:()=>ua,feMorphology:()=>Ni,feOffset:()=>ii,fePointLight:()=>ea,feSpecularLighting:()=>ma,feSpotLight:()=>di,feTile:()=>Ui,feTurbulence:()=>Sa,fieldset:()=>hi,figcaption:()=>Si,figure:()=>ra,filter:()=>Ki,footer:()=>ki,foreignObject:()=>Ei,form:()=>ei,g:()=>Ea,h1:()=>Ra,h2:()=>si,h3:()=>Pa,h4:()=>Or,h5:()=>Nn,h6:()=>Aa,head:()=>Mr,header:()=>zn,hgroup:()=>In,hr:()=>hr,html:()=>zi,i:()=>En,iframe:()=>Ii,image:()=>lr,img:()=>fr,input:()=>vr,ins:()=>Hn,kbd:()=>Zn,keygen:()=>or,label:()=>wr,legend:()=>Va,li:()=>kn,line:()=>Rr,linearGradient:()=>Jn,link:()=>Fr,main:()=>Vr,map:()=>Gn,mark:()=>rr,marker:()=>oa,mask:()=>er,menu:()=>qr,menuitem:()=>Wr,metadata:()=>Xr,meter:()=>xr,nav:()=>Cn,object:()=>gi,ol:()=>ga,optgroup:()=>Ji,option:()=>ca,output:()=>ji,p:()=>ni,param:()=>Qi,path:()=>fa,pattern:()=>li,picture:()=>Vi,polygon:()=>ba,polyline:()=>pi,pre:()=>bi,progress:()=>na,q:()=>Gi,radialGradient:()=>Oi,rect:()=>wi,rp:()=>Qr,rt:()=>wa,ruby:()=>Ia,s:()=>oi,samp:()=>Ma,script:()=>Er,section:()=>jn,select:()=>Oa,small:()=>Ar,source:()=>Rn,span:()=>Fn,stop:()=>mr,strong:()=>Ri,style:()=>Tn,sub:()=>Fi,summary:()=>cr,sup:()=>dr,svg:()=>_r,symbol:()=>Vn,table:()=>Xn,tbody:()=>ar,td:()=>Cr,text:()=>Ba,textPath:()=>On,textarea:()=>Lr,tfoot:()=>qn,th:()=>Pr,thead:()=>Br,time:()=>Wn,title:()=>nr,tr:()=>aa,track:()=>$n,tspan:()=>Kr,u:()=>Ur,ul:()=>Yr,use:()=>br,video:()=>Sn,view:()=>_i,wbr:()=>_a,webview:()=>Yi}),Jf=l();function Yf(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 Xf=Lt(),Zf=Y.useInsertionEffect,Qf=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?Y.useLayoutEffect:Y.useEffect,$f=Zf||Qf,ep=e=>{let t=Y.useRef([e,(...e)=>t[0](...e)]).current;return $f(()=>{t[0]=e}),t[1]},tp=[`popstate`,`pushState`,`replaceState`,`hashchange`],np=[],rp=()=>np.forEach(e=>e()),ip=e=>(np.push(e)===1&&tp.forEach(e=>addEventListener(e,rp)),()=>{np=np.filter(t=>t!==e),np.length||tp.forEach(e=>removeEventListener(e,rp))}),ap=(e,t)=>(0,Xf.useSyncExternalStore)(ip,e,t),op=()=>location.search,sp=({ssrSearch:e}={})=>ap(op,e==null?op:()=>e),cp=()=>location.pathname,lp=({ssrPath:e}={})=>ap(cp,e==null?cp:()=>e),up=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),dp=e=>[lp(e),up],fp=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[fp]===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,fp,{value:!0})}var pp=(e=``)=>e===`/`?``:e,mp=(e,t)=>e[0]===`~`?e.slice(1):pp(t)+e,hp=(e,t)=>(e=gp(pp(e)),t=gp(t),!e||(t.toLowerCase()+`/`).startsWith(e.toLowerCase()+`/`)?t.slice(e.length)||`/`:`~`+t),gp=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},_p={hook:dp,searchHook:sp,parser:Yf,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},vp=(0,Y.createContext)(_p),yp=()=>(0,Y.useContext)(vp);(0,Y.createContext)({});var bp=e=>{let[t,n]=e.hook(e);return[hp(e.base,t),ep((t,r)=>e.aroundNav(n,mp(t,e.base),r))]},xp=()=>bp(yp());(0,Y.forwardRef)((e,t)=>{let n=yp(),[r,i]=bp(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=ep(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 Sp(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 Cp=0,wp=0,Tp=new Set;function Ep(){wp||Cp>0||Tp.size===0||(wp=requestAnimationFrame(()=>{if(wp=0,Cp>0)return;let e=[...Tp];Tp.clear();for(let t of e)t()}))}function Dp(){return Cp+=1,()=>{--Cp,Ep()}}function Op({label:e}){return(0,Y.useEffect)(Dp,[]),(0,J.jsx)(o,{stack:!0,label:e,size:32})}var kp=new Set;function Ap(e){return kp.add(e),()=>{kp.delete(e)}}function jp(e){for(let t of kp)t(e)}function Mp(e){return`${e.protocol===`https:`?`wss`:`ws`}://${e.host}/ws?at=${encodeURIComponent(e.pathname)}`}function Np(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(Mp(location)),a.current=e,e.onopen=()=>{r(!0),ce();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),Je(t),jp(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 Pp(){let[e,t]=(0,Y.useState)([]);return(0,Y.useEffect)(()=>{let e=null,n,r=!1,i=()=>{e=new WebSocket(Mp(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 Fp=(0,Y.lazy)(()=>r(async()=>{let{AgentStatusPill:e}=await import(`./AgentStatusPill-Dr0IG63t.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,25]),import.meta.url).then(({AgentStatusPill:e})=>({default:e})));function Ip({artifact:e}){let t=Pp();return t.length===0?null:(0,J.jsx)(Y.Suspense,{fallback:null,children:(0,J.jsx)(Fp,{artifact:e,sessions:t})})}var Lp=1e3,Rp=`ryugi:embed:hello`,zp=`ryugi:embed:heartbeat`,Bp=`ryugi:embed:painted`,Vp=`ryugi:embed:position`,Hp=`ryugi:embed:positioned`;function Up({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===Vp&&a.anchor&&t&&t(a.anchor).then(()=>r(Hp))};n.addEventListener(`message`,i),r(Rp,t?{position:!0}:void 0);let a=setInterval(()=>r(zp),Lp),o=!1;return{painted(){o||(o=!0,r(Bp))},close(){clearInterval(a),n.removeEventListener(`message`,i)}}}function Wp(e=document,t=window,n){let r=e.documentElement.dataset.ryugiEmbedParent;return r?Up({parentOrigin:r,onPosition:n,win:t}):null}var Gp=()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e()))),Kp=e=>(Ee(e),Gp()),qp=(0,Y.createContext)(()=>{});function Jp(){let e=(0,Y.useRef)(null),t=(0,Y.useRef)(!1);return(0,Y.useEffect)(()=>{let n=Wp(document,window,Kp);return e.current=n,t.current&&n?.painted(),()=>{n?.close(),e.current=null}},[]),(0,Y.useCallback)(()=>{t.current=!0,e.current?.painted()},[])}function Yp(e){let t=(0,Y.useContext)(qp);(0,Y.useEffect)(()=>{if(!e)return;let n=0,r=requestAnimationFrame(()=>{n=requestAnimationFrame(()=>{t(),Ne()&&Pe({kind:`painted`})})});return()=>{cancelAnimationFrame(r),cancelAnimationFrame(n)}},[e,t])}var Xp=(0,Y.createContext)(null);function Zp({pageWindow:e,children:t}){return(0,J.jsx)(Xp.Provider,{value:e??null,children:t})}var Qp=()=>(0,Y.useContext)(Xp)??window,$p=(0,Y.lazy)(()=>r(async()=>{let{AutoPublishBar:e}=await import(`./auto-publish-I637YfTf.js`);return{AutoPublishBar:e}},__vite__mapDeps([26,1,27,12,4,28,29,2,3,5,6,7,24]),import.meta.url).then(({AutoPublishBar:e})=>({default:e}))),em=(0,Y.lazy)(()=>r(async()=>{let{SettingsDialog:e}=await import(`./settings-i1xE8pA8.js`);return{SettingsDialog:e}},__vite__mapDeps([30,1,31,5,4,3,10,2,6,7,11,12,13,14,18,32,33,34,35,36,24,37,38,28,29,19]),import.meta.url).then(({SettingsDialog:e})=>({default:e}))),tm=(0,Y.lazy)(()=>r(async()=>{let{ArtboardLayout:e}=await import(`./ArtboardLayout-BEcgcFOd.js`);return{ArtboardLayout:e}},__vite__mapDeps([39,1,10,2,3,4,5,6,7,11,12,13,14,40,41,42,43,44,22,17,18,24,45,33,46,47,48,49,15,50,32,51,52,53,16,54,55,56,57,35,19,58,59,60,61,9,62,63,64,36,65,27,66,67,68,28,29,37,69,70,71,72,34,25,73,74,75,76,77,78,79,80,81,20,21,82,83,84]),import.meta.url).then(({ArtboardLayout:e})=>({default:e}))),nm=(0,Y.lazy)(()=>r(async()=>{let{ArtifactList:e}=await import(`./ArtifactList-DsM43F_P.js`);return{ArtifactList:e}},__vite__mapDeps([85,1,10,2,3,4,5,6,7,11,12,13,14,54,16,34,35,32,51,50,52,49,15,18,86,59,87,29,88,70,62,89,19,31,56,57,24,66,28,36,63,74,79]),import.meta.url).then(({ArtifactList:e})=>({default:e}))),rm=(0,Y.lazy)(()=>r(async()=>{let{DocumentLayout:e}=await import(`./DocumentLayout-sTWNaA3o.js`);return{DocumentLayout:e}},__vite__mapDeps([90,1,4,5,2,3,6,7]),import.meta.url).then(({DocumentLayout:e})=>({default:e}))),im=(0,Y.lazy)(()=>r(async()=>{let{StoryboardLayout:e}=await import(`./StoryboardLayout-C2-18dzZ.js`);return{StoryboardLayout:e}},__vite__mapDeps([91,1,4,64,2,3,5,6,7,10,11,12,13,14,49,15,50,18,32,36,65,51,52,27,66,67,47,24,68,28,29,37,19,83,92,44,93,89,73,74,94,80,72,95,9,16,17,96,61,59,97,98,81,42,33,46,87,60,99,71,100]),import.meta.url).then(({StoryboardLayout:e})=>({default:e}))),am=(0,Y.lazy)(()=>r(async()=>{let{StoryboardRenderLayout:e}=await import(`./StoryboardRender-Bz4HnHfj.js`);return{StoryboardRenderLayout:e}},__vite__mapDeps([101,1,92,2,3,4,5,6,7,44,93,83,29]),import.meta.url).then(({StoryboardRenderLayout:e})=>({default:e}))),om=(0,Y.lazy)(()=>r(async()=>{let{PreviewArtifactLayout:e}=await import(`./PreviewArtifactLayout-CqXcOdxK.js`);return{PreviewArtifactLayout:e}},__vite__mapDeps([102,1,4,10,2,3,5,6,7,11,12,13,14,29,59,49,15,50,18,32,56,57,35,54,16,34,103,71,58,104,75,88,105,98,81,25,19,61,9,17,24,89,22]),import.meta.url).then(({PreviewArtifactLayout:e})=>({default:e}))),sm=(0,Y.lazy)(()=>r(async()=>{let{ReportLayout:e}=await import(`./ReportLayout-BlpuIdHN.js`);return{ReportLayout:e}},__vite__mapDeps([106,1,64,2,3,4,5,6,7,10,11,12,13,14,49,15,50,18,32,36,65,51,52,27,66,67,47,24,68,28,29,37,19,83,107,96,89,93,73,74,105,98,81,59,25,9,16,17,44,61]),import.meta.url).then(({ReportLayout:e})=>({default:e}))),cm=(0,Y.lazy)(()=>r(async()=>{let{HtmlLayout:e}=await import(`./HtmlLayout-p52oMbkD.js`);return{HtmlLayout:e}},__vite__mapDeps([108,1,4,89,49,2,3,5,6,7,10,11,12,13,14,15,50,18,32,19,93,73,74,64,36,65,51,52,27,66,67,47,24,68,28,29,37,83]),import.meta.url).then(({HtmlLayout:e})=>({default:e}))),lm=(0,Y.lazy)(()=>r(async()=>{let{SlidesLayout:e}=await import(`./SlidesLayout-Cg-ZL9W5.js`);return{SlidesLayout:e}},__vite__mapDeps([109,1,64,2,3,4,5,6,7,10,11,12,13,14,49,15,50,18,32,36,65,51,52,27,66,67,47,24,68,28,29,37,19,83,110,111,112,93,73,74,44,89,25,61,59,9,16,17,48,53,54,113,96,60,114,62,56,57,35,34,99,87,33,75,21,81,77,103,71,72,115,42,116,20,76,95,98,117]),import.meta.url).then(({SlidesLayout:e})=>({default:e}))),um=(0,Y.lazy)(()=>r(async()=>{let{VerifyLayout:e}=await import(`./VerifyLayout-DNAp5mGi.js`);return{VerifyLayout:e}},__vite__mapDeps([118,1,64,2,3,4,5,6,7,10,11,12,13,14,49,15,50,18,32,36,65,51,52,27,66,67,47,24,68,28,29,37,19,119,120,121,62,60,122,113,69,70,100,33,71,53,87,99,57,35,123,124,114,77,125,96,115,61,59,9,16,17,86,42,97,95,41,22,25,20,21,93,23,38,111,126,78,79,44,127,128]),import.meta.url).then(({VerifyLayout:e})=>({default:e}))),dm=(0,Y.lazy)(()=>r(async()=>{let{WhiteboardLayout:e}=await import(`./WhiteboardLayout-BuyJEwNS.js`);return{WhiteboardLayout:e}},__vite__mapDeps([129,1,130,121,2,3,4,5,6,7,10,11,12,13,14,49,15,50,18,32,62,65,60,122,52,113,69,70,100,33,71,53,87,99,57,35,123,112,25,68,29,45,17,22,9,16,19,76,61,59,24,38,55,56,96,131]),import.meta.url).then(({WhiteboardLayout:e})=>({default:e}))),fm=(0,Y.lazy)(()=>Promise.all([r(()=>import(`./split-C-_Iw2K0.js`),__vite__mapDeps([132,1,111,10,2,3,4,5,6,7,11,12,13,14,74,124,81,94,122,125,77,115,21,116,50,56,57,35,19,24,133,107,134,25,127,131,135]),import.meta.url),r(()=>import(`./local-split-host-kaL99YNI.js`).then(e=>e.n),__vite__mapDeps([110,1,111,10,2,3,4,5,6,7,11,12,13,14,29]),import.meta.url)]).then(([{SplitShell:e},{localSplitHost:t}])=>({default:n=>(0,J.jsx)(e,{...n,host:t})}))),pm=(0,Y.lazy)(()=>r(async()=>{let{PreviewLayout:e}=await import(`./PreviewLayout-AYrRaL1J.js`).then(e=>e.n);return{PreviewLayout:e}},__vite__mapDeps([136,1,4,29,2,3,5,6,7,40,24]),import.meta.url).then(({PreviewLayout:e})=>({default:e}))),mm=(e,t)=>(0,J.jsxs)(J.Fragment,{children:[e,(0,J.jsx)($p,{}),(0,J.jsx)(em,{}),t&&(0,J.jsx)(Ip,{artifact:t})]});function hm({id:e,type:t}){let n=Jp();return(0,J.jsx)(qp,{value:n,children:t===`whiteboard`?(0,J.jsx)(Zp,{pageWindow:Sp(),children:(0,J.jsx)(dm,{id:e})}):t===`document`?(0,J.jsx)(rm,{id:e}):t===`verify`?(0,J.jsx)(um,{id:e}):t===`slides`?(0,J.jsx)(lm,{id:e}):(0,J.jsx)(tm,{id:e})})}function gm(){let[e]=xp(),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 mm((0,J.jsx)(nm,{}));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)(pm,{id:n,type:t.type}):t.kind===`dev-preview`?mm((0,J.jsx)(om,{id:n}),`preview/${n}`):t.kind===`embed`?(0,J.jsx)(hm,{id:n,type:t.type}):t.kind===`render`?(0,J.jsx)(am,{id:n}):t.type===`html`?mm((0,J.jsx)(cm,{id:n}),`html/${n}`):t.type===`slides`?mm((0,J.jsx)(lm,{id:n}),`slides/${n}`):t.type===`report`?mm((0,J.jsx)(sm,{id:n}),`report/${n}`):t.type===`storyboard`?mm((0,J.jsx)(im,{id:n}),`storyboard/${n}`):mm((0,J.jsx)(fm,{id:n,split:Be(t,location.search)?.split??null,type:t.type}),`${t.type}/${n}`)}function _m(){return(0,J.jsx)(Y.Suspense,{fallback:(0,J.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k x5yr21d xggk2y7 x1bo0w0s xqfszdh xif65rj`,children:(0,J.jsx)(Op,{label:i(`common.loading`)})}),children:(0,J.jsx)(gm,{})})}de(),document.documentElement.lang=d[s.language];function vm(){return n(),(0,J.jsx)(Sl,{features:$l,children:(0,J.jsxs)(m,{enableCustomFonts:!1,motion:qf,children:[(0,J.jsx)(_m,{}),(0,J.jsx)(y,{}),(0,J.jsx)(Wf,{}),(0,J.jsx)(fd,{})]})})}(0,Jf.createRoot)(document.getElementById(`root`)).render((0,J.jsx)(Y.StrictMode,{children:(0,J.jsx)(vm,{})}));export{Op as a,X as c,ed as d,Ku as f,Np as i,Ju as l,ru as m,Yp as n,Hf as o,zu as p,Ap as r,pd as s,Qp as t,qu as u};
|