@wasp.sh/wasp-cli-darwin-arm64-unknown 0.20.2 → 0.21.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/Cli/starters/basic/README.md +1 -1
- package/data/Cli/starters/basic/package.json +10 -7
- package/data/Cli/starters/basic/src/App.css +30 -12
- package/data/Cli/starters/basic/src/App.tsx +1 -1
- package/data/Cli/starters/basic/src/auth/AuthLayout.tsx +3 -1
- package/data/Cli/starters/basic/src/auth/email/EmailVerificationPage.tsx +2 -2
- package/data/Cli/starters/basic/src/auth/email/LoginPage.tsx +3 -3
- package/data/Cli/starters/basic/src/auth/email/PasswordResetPage.tsx +2 -2
- package/data/Cli/starters/basic/src/auth/email/SignupPage.tsx +2 -2
- package/data/Cli/starters/basic/src/shared/components/Button.tsx +3 -2
- package/data/Cli/starters/basic/src/shared/components/Dialog.tsx +23 -41
- package/data/Cli/starters/basic/src/shared/components/Header.tsx +2 -2
- package/data/Cli/starters/basic/src/shared/components/Input.tsx +25 -28
- package/data/Cli/starters/basic/src/tags/components/ColorRadioButton.tsx +8 -9
- package/data/Cli/starters/basic/src/tags/components/CreateTagDialog.tsx +29 -29
- package/data/Cli/starters/basic/src/tags/components/CreateTagForm.tsx +6 -8
- package/data/Cli/starters/basic/src/tasks/components/CreateTaskForm.tsx +2 -2
- package/data/Cli/starters/basic/src/tasks/components/TaskListItem.tsx +3 -2
- package/data/Cli/starters/basic/vite.config.ts +3 -0
- package/data/Cli/starters/minimal/package.json +2 -3
- package/data/Cli/starters/minimal/vite.config.ts +2 -0
- package/data/Cli/starters/skeleton/src/vite-env.d.ts +2 -6
- package/data/Generator/libs/auth/wasp.sh-lib-auth-0.21.0.tgz +0 -0
- package/data/Generator/templates/Dockerfile +13 -12
- package/data/Generator/templates/sdk/wasp/auth/forms/Auth.tsx +2 -11
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx +10 -4
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ForgotPasswordForm.tsx +4 -3
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/ResetPasswordForm.tsx +4 -4
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/email/VerifyEmailForm.tsx +3 -4
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/social/SocialIcons.tsx +11 -0
- package/data/Generator/templates/sdk/wasp/auth/forms/types.ts +0 -6
- package/data/Generator/templates/sdk/wasp/auth/jwt.ts +9 -16
- package/data/Generator/templates/sdk/wasp/auth/password.ts +1 -36
- package/data/Generator/templates/sdk/wasp/auth/utils.ts +2 -0
- package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/DefaultRootErrorBoundary.tsx +1 -1
- package/data/Generator/templates/sdk/wasp/client/app/components/WaspApp.tsx +45 -0
- package/data/Generator/templates/sdk/wasp/client/app/index.tsx +26 -0
- package/data/Generator/templates/{react-app/src/auth → sdk/wasp/client/app}/pages/OAuthCallback.tsx +9 -8
- package/data/Generator/templates/{react-app/src/auth → sdk/wasp/client/app}/pages/createAuthRequiredPage.jsx +7 -9
- package/data/Generator/templates/sdk/wasp/client/app/router/router.tsx +47 -0
- package/data/Generator/templates/sdk/wasp/client/auth/index.ts +3 -0
- package/data/Generator/templates/sdk/wasp/client/auth/microsoft.ts +2 -0
- package/data/Generator/templates/sdk/wasp/client/auth/ui.ts +3 -0
- package/data/Generator/templates/sdk/wasp/client/router/Link.tsx +2 -2
- package/data/Generator/templates/sdk/wasp/client/test/vitest/helpers.tsx +10 -12
- package/data/Generator/templates/sdk/wasp/client/vite/index.ts +1 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/detectServerImports.ts +50 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/envFile.ts +112 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/html/build.ts +38 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/html/dev.ts +35 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/typescriptCheck.ts +32 -0
- package/data/Generator/templates/{react-app/vite → sdk/wasp/client/vite/plugins}/validateEnv.ts +17 -7
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/virtualModules.ts +29 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/wasp.ts +36 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/waspConfig.ts +56 -0
- package/data/Generator/templates/{react-app → sdk/wasp/client/vite/virtual-files/files}/index.html +1 -2
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/index.tsx +34 -0
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/routes.tsx +17 -0
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/index.ts +20 -0
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/resolver.ts +28 -0
- package/data/Generator/templates/sdk/wasp/package.json +6 -4
- package/data/Generator/templates/sdk/wasp/scripts/copy-assets.js +67 -7
- package/data/Generator/templates/sdk/wasp/server/auth/hooks.ts +3 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/index.ts +4 -0
- package/data/Generator/templates/sdk/wasp/server/auth/oauth/providers/microsoft.ts +23 -0
- package/data/Generator/templates/sdk/wasp/server/auth/user.ts +6 -0
- package/data/Generator/templates/sdk/wasp/server/env.ts +11 -0
- package/data/Generator/templates/sdk/wasp/tsconfig.json +5 -1
- package/data/Generator/templates/server/src/auth/providers/config/microsoft.ts +65 -0
- package/data/Generator/templates/server/src/auth/providers/oauth/cookies.ts +1 -1
- package/data/packages/deploy/dist/common/clientApp.js +4 -11
- package/data/packages/deploy/dist/common/terminal.js +7 -0
- package/data/packages/deploy/dist/common/waspProject.js +11 -7
- package/data/packages/deploy/dist/providers/fly/CommonOps.js +3 -3
- package/data/packages/deploy/dist/providers/fly/commands/cmd/cmd.js +1 -1
- package/data/packages/deploy/dist/providers/fly/commands/deploy/deploy.js +6 -5
- package/data/packages/deploy/dist/providers/fly/commands/setup/setup.js +3 -3
- package/data/packages/deploy/dist/providers/fly/index.js +5 -0
- package/data/packages/deploy/dist/providers/railway/commands/deploy/client.js +2 -1
- package/data/packages/deploy/dist/providers/railway/commands/setup/setup.js +21 -10
- package/data/packages/deploy/dist/providers/railway/index.js +5 -0
- package/data/packages/deploy/dist/providers/railway/jsonOutputSchemas.js +9 -3
- package/data/packages/deploy/dist/providers/railway/railwayService/url.js +8 -1
- package/data/packages/studio/dist/public/assets/Flow-_d98T2dd.js +26 -0
- package/data/packages/studio/dist/public/assets/index-B6X8EdJH.js +21 -0
- package/data/packages/studio/dist/public/assets/index-CXlD_bzV.js +1 -0
- package/data/packages/studio/dist/public/assets/index-IWX3d-Jz.css +1 -0
- package/data/packages/studio/dist/public/index.html +2 -3
- package/package.json +1 -1
- package/wasp-bin +0 -0
- package/data/Cli/starters/basic/postcss.config.js +0 -6
- package/data/Cli/starters/basic/src/shared/components/Portal.tsx +0 -26
- package/data/Cli/starters/basic/tailwind.config.js +0 -30
- package/data/Generator/templates/react-app/README.md +0 -21
- package/data/Generator/templates/react-app/gitignore +0 -23
- package/data/Generator/templates/react-app/netlify.toml +0 -8
- package/data/Generator/templates/react-app/npmrc +0 -1
- package/data/Generator/templates/react-app/package.json +0 -31
- package/data/Generator/templates/react-app/public/manifest.json +0 -15
- package/data/Generator/templates/react-app/src/index.tsx +0 -47
- package/data/Generator/templates/react-app/src/logo.png +0 -0
- package/data/Generator/templates/react-app/src/router.tsx +0 -59
- package/data/Generator/templates/react-app/src/utils.js +0 -3
- package/data/Generator/templates/react-app/src/vite-env.d.ts +0 -1
- package/data/Generator/templates/react-app/tsconfig.app.json +0 -28
- package/data/Generator/templates/react-app/tsconfig.json +0 -11
- package/data/Generator/templates/react-app/tsconfig.vite.json +0 -16
- package/data/Generator/templates/react-app/vite/detectServerImports.ts +0 -53
- package/data/Generator/templates/react-app/vite.config.ts +0 -74
- package/data/Generator/templates/sdk/wasp/dev/index.ts +0 -19
- package/data/packages/studio/dist/public/assets/Flow-b5112d3d.js +0 -26
- package/data/packages/studio/dist/public/assets/index-17ce6ed4.css +0 -1
- package/data/packages/studio/dist/public/assets/index-62a9d21a.js +0 -120
- /package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/FullPageWrapper.tsx +0 -0
- /package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/Loader.module.css +0 -0
- /package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/Loader.tsx +0 -0
- /package/data/Generator/templates/{react-app/src → sdk/wasp/client/app}/components/Message.tsx +0 -0
- /package/data/Generator/templates/{react-app/src/test/vitest → sdk/wasp/client/test}/setup.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as K,m as ae,f as mt,h as bn,i as gt,k as Ee,l as P,n as H,o as pe,p as X,q as yt,t as vt,v as Tt,w as Vn,x as An,y as wn,z as Sn,A as xn,B as Mn,C as Cn,D as Pn,E as k,F as Fn,G as Dn,I as oe,J as $e,K as bt,L as In,N as En,O as On,Q as Vt,S as Rn,T as Kn,U as kn,V as Nn,r as Bn,W as Ln,X as At,Y as wt,Z as St,_ as xt}from"./index-B6X8EdJH.js";function Gn(t,e){t.indexOf(e)===-1&&t.push(e)}function Un(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let Oe=()=>{};const Mt=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ct=t=>/^0[^.\s]+$/u.test(t);function Re(t){let e;return()=>(e===void 0&&(e=t()),e)}const $=t=>t,_n=(t,e)=>n=>e(t(n)),ue=(...t)=>t.reduce(_n),Pt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Ft{constructor(){this.subscriptions=[]}add(e){return Gn(this.subscriptions,e),()=>Un(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const a=this.subscriptions[r];a&&a(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const R=t=>t*1e3,E=t=>t/1e3;function Dt(t,e){return e?t*(1e3/e):0}const It=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,jn=1e-7,Wn=12;function Hn(t,e,n,s,i){let r,a,o=0;do a=e+(n-e)/2,r=It(a,s,i)-t,r>0?n=a:e=a;while(Math.abs(r)>jn&&++o<Wn);return a}function Z(t,e,n,s){if(t===e&&n===s)return $;const i=r=>Hn(r,0,1,t,n);return r=>r===0||r===1?r:It(i(r),e,s)}const Et=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ot=t=>e=>1-t(1-e),Rt=Z(.33,1.53,.69,.99),Ke=Ot(Rt),Kt=Et(Ke),kt=t=>(t*=2)<1?.5*Ke(t):.5*(2-Math.pow(2,-10*(t-1))),ke=t=>1-Math.sin(Math.acos(t)),$n=Ot(ke),Nt=Et(ke),qn=Z(.42,0,1,1),zn=Z(0,0,.58,1),Bt=Z(.42,0,.58,1),Yn=t=>Array.isArray(t)&&typeof t[0]!="number",Lt=t=>Array.isArray(t)&&typeof t[0]=="number",Xn={linear:$,easeIn:qn,easeInOut:Bt,easeOut:zn,circIn:ke,circInOut:Nt,circOut:$n,backIn:Ke,backInOut:Kt,backOut:Rt,anticipate:kt},Zn=t=>typeof t=="string",qe=t=>{if(Lt(t)){Oe(t.length===4);const[e,n,s,i]=t;return Z(e,n,s,i)}else if(Zn(t))return Xn[t];return t},J=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Jn(t,e){let n=new Set,s=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(u){a.has(u)&&(c.schedule(u),t()),u(o)}const c={schedule:(u,h=!1,f=!1)=>{const T=f&&i?n:s;return h&&a.add(u),T.has(u)||T.add(u),u},cancel:u=>{s.delete(u),a.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const Qn=40;function Gt(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=J.reduce((g,w)=>(g[w]=Jn(r),g),{}),{setup:o,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:f,render:d,postRender:T}=a,b=()=>{const g=K.useManualTiming?i.timestamp:performance.now();n=!1,K.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,Qn),1)),i.timestamp=g,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),u.process(i),h.process(i),f.process(i),d.process(i),T.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(b))},v=()=>{n=!0,s=!0,i.isProcessing||t(b)};return{schedule:J.reduce((g,w)=>{const m=a[w];return g[w]=(A,x=!1,y=!1)=>(n||v(),m.schedule(A,x,y)),g},{}),cancel:g=>{for(let w=0;w<J.length;w++)a[J[w]].cancel(g)},state:i,steps:a}}const{schedule:O,cancel:me,state:te}=Gt(typeof requestAnimationFrame<"u"?requestAnimationFrame:$,!0);let Q;function es(){Q=void 0}const I={now:()=>(Q===void 0&&I.set(te.isProcessing||K.useManualTiming?te.timestamp:performance.now()),Q),set:t=>{Q=t,queueMicrotask(es)}};function le(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ts({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,a=0;if(!e)i=r=a=n;else{const o=n<.5?n*(1+e):n+e-n*e,l=2*n-o;i=le(l,o,t+1/3),r=le(l,o,t),a=le(l,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(a*255),alpha:s}}function ne(t,e){return n=>n>0?e:t}const ce=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ns=[bn,mt,gt],ss=t=>ns.find(e=>e.test(t));function ze(t){const e=ss(t);if(!e)return!1;let n=e.parse(t);return e===gt&&(n=ts(n)),n}const Ye=(t,e)=>{const n=ze(t),s=ze(e);if(!n||!s)return ne(t,e);const i={...n};return r=>(i.red=ce(n.red,s.red,r),i.green=ce(n.green,s.green,r),i.blue=ce(n.blue,s.blue,r),i.alpha=ae(n.alpha,s.alpha,r),mt.transform(i))},ge=new Set(["none","hidden"]);function is(t,e){return ge.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function rs(t,e){return n=>ae(t,e,n)}function Ne(t){return typeof t=="number"?rs:typeof t=="string"?Ee(t)?ne:P.test(t)?Ye:us:Array.isArray(t)?Ut:typeof t=="object"?P.test(t)?Ye:as:ne}function Ut(t,e){const n=[...t],s=n.length,i=t.map((r,a)=>Ne(r)(r,e[a]));return r=>{for(let a=0;a<s;a++)n[a]=i[a](r);return n}}function as(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Ne(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function os(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],a=t.indexes[r][s[r]],o=t.values[a]??0;n[i]=o,s[r]++}return n}const us=(t,e)=>{const n=H.createTransformer(e),s=pe(t),i=pe(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ge.has(t)&&!i.values.length||ge.has(e)&&!s.values.length?is(t,e):ue(Ut(os(s,i),i.values),n):ne(t,e)};function _t(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ae(t,e,n):Ne(t)(t,e)}const ls=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>O.update(e,n),stop:()=>me(e),now:()=>te.isProcessing?te.timestamp:I.now()}},jt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},se=2e4;function Be(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<se;)e+=n,s=t.next(e);return e>=se?1/0:e}function cs(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Be(s),se);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:E(i)}}const hs=5;function Wt(t,e,n){const s=Math.max(e-hs,0);return Dt(n-t(s),e-s)}const S={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},he=.001;function fs({duration:t=S.duration,bounce:e=S.bounce,velocity:n=S.velocity,mass:s=S.mass}){let i,r,a=1-e;a=X(S.minDamping,S.maxDamping,a),t=X(S.minDuration,S.maxDuration,E(t)),a<1?(i=c=>{const u=c*a,h=u*t,f=u-n,d=ye(c,a),T=Math.exp(-h);return he-f/d*T},r=c=>{const h=c*a*t,f=h*n+n,d=Math.pow(a,2)*Math.pow(c,2)*t,T=Math.exp(-h),b=ye(Math.pow(c,2),a);return(-i(c)+he>0?-1:1)*((f-d)*T)/b}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-he+u*h},r=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const o=5/t,l=ps(i,r,o);if(t=R(t),isNaN(l))return{stiffness:S.stiffness,damping:S.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:a*2*Math.sqrt(s*c),duration:t}}}const ds=12;function ps(t,e,n){let s=n;for(let i=1;i<ds;i++)s=s-t(s)/e(s);return s}function ye(t,e){return t*Math.sqrt(1-e*e)}const ms=["duration","bounce"],gs=["stiffness","damping","mass"];function Xe(t,e){return e.some(n=>t[n]!==void 0)}function ys(t){let e={velocity:S.velocity,stiffness:S.stiffness,damping:S.damping,mass:S.mass,isResolvedFromDuration:!1,...t};if(!Xe(t,gs)&&Xe(t,ms))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*X(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:S.mass,stiffness:i,damping:r}}else{const n=fs(t);e={...e,...n,mass:S.mass},e.isResolvedFromDuration=!0}return e}function ie(t=S.visualDuration,e=S.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=ys({...n,velocity:-E(n.velocity||0)}),T=f||0,b=c/(2*Math.sqrt(l*u)),v=a-r,p=E(Math.sqrt(l/u)),V=Math.abs(v)<5;s||(s=V?S.restSpeed.granular:S.restSpeed.default),i||(i=V?S.restDelta.granular:S.restDelta.default);let g;if(b<1){const m=ye(p,b);g=A=>{const x=Math.exp(-b*p*A);return a-x*((T+b*p*v)/m*Math.sin(m*A)+v*Math.cos(m*A))}}else if(b===1)g=m=>a-Math.exp(-p*m)*(v+(T+p*v)*m);else{const m=p*Math.sqrt(b*b-1);g=A=>{const x=Math.exp(-b*p*A),y=Math.min(m*A,300);return a-x*((T+b*p*v)*Math.sinh(y)+m*v*Math.cosh(y))/m}}const w={calculatedDuration:d&&h||null,next:m=>{const A=g(m);if(d)o.done=m>=h;else{let x=m===0?T:0;b<1&&(x=m===0?R(T):Wt(g,m,A));const y=Math.abs(x)<=s,C=Math.abs(a-A)<=i;o.done=y&&C}return o.value=o.done?a:A,o},toString:()=>{const m=Math.min(Be(w),se),A=jt(x=>w.next(m*x).value,m,30);return m+"ms "+A},toTransition:()=>{}};return w}ie.applyToOptions=t=>{const e=cs(t,100,ie);return t.ease=e.ease,t.duration=R(e.duration),t.type="keyframes",t};function ve({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=y=>o!==void 0&&y<o||l!==void 0&&y>l,T=y=>o===void 0?l:l===void 0||Math.abs(o-y)<Math.abs(l-y)?o:l;let b=n*e;const v=h+b,p=a===void 0?v:a(v);p!==v&&(b=p-h);const V=y=>-b*Math.exp(-y/s),g=y=>p+V(y),w=y=>{const C=V(y),F=g(y);f.done=Math.abs(C)<=c,f.value=f.done?p:F};let m,A;const x=y=>{d(f.value)&&(m=y,A=ie({keyframes:[f.value,T(f.value)],velocity:Wt(g,y,f.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return x(0),{calculatedDuration:null,next:y=>{let C=!1;return!A&&m===void 0&&(C=!0,w(y),x(y)),m!==void 0&&y>=m?A.next(y-m):(!C&&w(y),f)}}}function vs(t,e,n){const s=[],i=n||K.mix||_t,r=t.length-1;for(let a=0;a<r;a++){let o=i(t[a],t[a+1]);if(e){const l=Array.isArray(e)?e[a]||$:e;o=ue(l,o)}s.push(o)}return s}function Ts(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Oe(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=vs(e,s,i),l=o.length,c=u=>{if(a&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Pt(t[h],t[h+1],u);return o[h](f)};return n?u=>c(X(t[0],t[r-1],u)):c}function bs(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Pt(0,e,s);t.push(ae(n,1,i))}}function Vs(t){const e=[0];return bs(e,t.length-1),e}function As(t,e){return t.map(n=>n*e)}function ws(t,e){return t.map(()=>e||Bt).splice(0,t.length-1)}function Y({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Yn(s)?s.map(qe):qe(s),r={done:!1,value:e[0]},a=As(n&&n.length===e.length?n:Vs(e),t),o=Ts(a,e,{ease:Array.isArray(i)?i:ws(e,i)});return{calculatedDuration:t,next:l=>(r.value=o(l),r.done=l>=t,r)}}const Ss=t=>t!==null;function Le(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ss),o=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!o||s===void 0?r[o]:s}const xs={decay:ve,inertia:ve,tween:Y,keyframes:Y,spring:ie};function Ht(t){typeof t.type=="string"&&(t.type=xs[t.type])}class Ge{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Ms=t=>t/100;class Ue extends Ge{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==I.now()&&this.tick(I.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Ht(e);const{type:n=Y,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:a=0}=e;let{keyframes:o}=e;const l=n||Y;l!==Y&&typeof o[0]!="number"&&(this.mixKeyframes=ue(Ms,_t(o[0],o[1])),o=[0,100]);const c=l({...e,keyframes:o});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Be(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:T,onUpdate:b,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const p=this.currentTime-c*(this.playbackSpeed>=0?1:-1),V=this.playbackSpeed>=0?p<0:p>i;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,w=s;if(h){const y=Math.min(this.currentTime,i)/o;let C=Math.floor(y),F=y%1;!F&&y>=1&&(F=1),F===1&&C--,C=Math.min(C,h+1),C%2&&(f==="reverse"?(F=1-F,d&&(F-=d/o)):f==="mirror"&&(w=a)),g=X(0,1,F)*o}const m=V?{done:!1,value:u[0]}:w.next(g);r&&(m.value=r(m.value));let{done:A}=m;!V&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const x=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return x&&T!==ve&&(m.value=Le(u,this.options,v,this.speed)),b&&b(m.value),x&&this.finish(),m}then(e,n){return this.finished.then(e,n)}get duration(){return E(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+E(e)}get time(){return E(this.currentTime)}set time(e){e=R(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(I.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=E(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=ls,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(I.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Cs(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const L=t=>t*180/Math.PI,Te=t=>{const e=L(Math.atan2(t[1],t[0]));return be(e)},Ps={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Te,rotateZ:Te,skewX:t=>L(Math.atan(t[1])),skewY:t=>L(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},be=t=>(t=t%360,t<0&&(t+=360),t),Ze=Te,Je=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Qe=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Fs={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Je,scaleY:Qe,scale:t=>(Je(t)+Qe(t))/2,rotateX:t=>be(L(Math.atan2(t[6],t[5]))),rotateY:t=>be(L(Math.atan2(-t[2],t[0]))),rotateZ:Ze,rotate:Ze,skewX:t=>L(Math.atan(t[4])),skewY:t=>L(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ve(t){return t.includes("scale")?1:0}function Ae(t,e){if(!t||t==="none")return Ve(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Fs,i=n;else{const o=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ps,i=o}if(!i)return Ve(e);const r=s[e],a=i[1].split(",").map(Is);return typeof r=="function"?r(a):a[r]}const Ds=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ae(n,e)};function Is(t){return parseFloat(t.trim())}const et=t=>t===yt||t===vt,Es=new Set(["x","y","z"]),Os=Tt.filter(t=>!Es.has(t));function Rs(t){const e=[];return Os.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const G={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ae(e,"x"),y:(t,{transform:e})=>Ae(e,"y")};G.translateX=G.x;G.translateY=G.y;const U=new Set;let we=!1,Se=!1,xe=!1;function $t(){if(Se){const t=Array.from(U).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Rs(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,a])=>{s.getValue(r)?.set(a)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Se=!1,we=!1,U.forEach(t=>t.complete(xe)),U.clear()}function qt(){U.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Se=!0)})}function Ks(){xe=!0,qt(),$t(),xe=!1}class _e{constructor(e,n,s,i,r,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(U.add(this),we||(we=!0,O.read(qt),O.resolveKeyframes($t))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const o=s.readValue(n,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}Cs(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),U.delete(this)}cancel(){this.state==="scheduled"&&(U.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const ks=t=>t.startsWith("--");function Ns(t,e,n){ks(e)?t.style.setProperty(e,n):t.style[e]=n}const Bs=Re(()=>window.ScrollTimeline!==void 0),Ls={};function Gs(t,e){const n=Re(t);return()=>Ls[e]??n()}const zt=Gs(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),z=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,tt={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:z([0,.65,.55,1]),circOut:z([.55,0,1,.45]),backIn:z([.31,.01,.66,-.59]),backOut:z([.33,1.53,.69,.99])};function Yt(t,e){if(t)return typeof t=="function"?zt()?jt(t,e):"ease-out":Lt(t)?z(t):Array.isArray(t)?t.map(n=>Yt(n,e)||tt.easeOut):tt[t]}function Us(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Yt(o,i);Array.isArray(h)&&(u.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:a==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function Xt(t){return typeof t=="function"&&"applyToOptions"in t}function _s({type:t,...e}){return Xt(t)&&zt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class js extends Ge{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=a,this.options=e,Oe(typeof e.type!="string");const c=_s(e);this.animation=Us(n,s,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=Le(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(u):Ns(n,s,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return E(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+E(e)}get time(){return E(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=R(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Bs()?(this.animation.timeline=e,$):n(this)}}const Zt={anticipate:kt,backInOut:Kt,circInOut:Nt};function Ws(t){return t in Zt}function Hs(t){typeof t.ease=="string"&&Ws(t.ease)&&(t.ease=Zt[t.ease])}const nt=10;class $s extends js{constructor(e){Hs(e),Ht(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const o=new Ue({...a,autoplay:!1}),l=R(this.finishedTime??this.time);n.setWithVelocity(o.sample(l-nt).value,o.sample(l).value,nt),o.stop()}}const st=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(H.test(t)||t==="0")&&!t.startsWith("url("));function qs(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function zs(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],a=st(i,e),o=st(r,e);return!a||!o?!1:qs(t)||(n==="spring"||Xt(n))&&s}function Me(t){t.duration=0,t.type="keyframes"}const Ys=new Set(["opacity","clipPath","filter","transform"]),Xs=Re(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Zs(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Xs()&&n&&Ys.has(n)&&(n!=="transform"||!c)&&!l&&!s&&i!=="mirror"&&r!==0&&a!=="inertia"}const Js=40;class Qs extends Ge{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:a="loop",keyframes:o,name:l,motionValue:c,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=I.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:a,name:l,motionValue:c,element:u,...h},d=u?.KeyframeResolver||_e;this.keyframeResolver=new d(o,(T,b,v)=>this.onKeyframesResolved(T,b,f,!v),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:a,velocity:o,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=I.now(),zs(e,r,a,o)||((K.instantAnimations||!l)&&u?.(Le(e,s,n)),e[0]=e[e.length-1],Me(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Js?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!c&&Zs(f)?new $s({...f,element:f.motionValue.owner.current}):new Ue(f);d.finished.then(()=>this.notifyFinished()).catch($),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Ks()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const ei=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ti(t){const e=ei.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Jt(t,e,n=1){const[s,i]=ti(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const a=r.trim();return Mt(a)?parseFloat(a):a}return Ee(i)?Jt(i,e,n+1):i}function Qt(t,e){return t?.[e]??t?.default??t}const en=new Set(["width","height","top","left","right","bottom",...Tt]),ni={test:t=>t==="auto",parse:t=>t},tn=t=>e=>e.test(t),nn=[yt,vt,Vn,An,wn,Sn,ni],it=t=>nn.find(tn(t));function si(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ct(t):!0}const ii=new Set(["brightness","contrast","saturate","opacity"]);function ri(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(xn)||[];if(!s)return t;const i=n.replace(s,"");let r=ii.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const ai=/\b([a-z-]*)\(.*?\)/gu,Ce={...H,getAnimatableNone:t=>{const e=t.match(ai);return e?e.map(ri).join(" "):t}},oi={...Mn,color:P,backgroundColor:P,outlineColor:P,fill:P,stroke:P,borderColor:P,borderTopColor:P,borderRightColor:P,borderBottomColor:P,borderLeftColor:P,filter:Ce,WebkitFilter:Ce},sn=t=>oi[t];function rn(t,e){let n=sn(t);return n!==Ce&&(n=H),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ui=new Set(["auto","none","0"]);function li(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!ui.has(r)&&pe(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=rn(n,i)}class ci extends _e{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let c=e[l];if(typeof c=="string"&&(c=c.trim(),Ee(c))){const u=Jt(c,n.current);u!==void 0&&(e[l]=u),l===e.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!en.has(s)||e.length!==2)return;const[i,r]=e,a=it(i),o=it(r);if(a!==o)if(et(a)&&et(o))for(let l=0;l<e.length;l++){const c=e[l];typeof c=="string"&&(e[l]=parseFloat(c))}else G[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||si(e[i]))&&s.push(i);s.length&&li(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=G[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,a=s[r];s[r]=G[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([o,l])=>{e.getValue(o).set(l)}),this.resolveNoneKeyframes()}}function hi(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const rt=30,fi=t=>!isNaN(parseFloat(t));class di{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=I.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=I.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=fi(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Ft);const s=this.events[e].add(n);return e==="change"?()=>{s(),O.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=I.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>rt)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,rt);return Dt(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function re(t,e){return new di(t,e)}const{schedule:pi}=Gt(queueMicrotask,!1),mi={y:!1};function gi(){return mi.y}function an(t,e){const n=hi(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function at(t){return!(t.pointerType==="touch"||gi())}function yi(t,e,n={}){const[s,i,r]=an(t,n),a=o=>{if(!at(o))return;const{target:l}=o,c=e(l,o);if(typeof c!="function"||!l)return;const u=h=>{at(h)&&(c(h),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,i)};return s.forEach(o=>{o.addEventListener("pointerenter",a,i)}),r}const on=(t,e)=>e?t===e?!0:on(t,e.parentElement):!1,vi=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ti=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bi(t){return Ti.has(t.tagName)||t.tabIndex!==-1}const ee=new WeakSet;function ot(t){return e=>{e.key==="Enter"&&t(e)}}function fe(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Vi=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=ot(()=>{if(ee.has(n))return;fe(n,"down");const i=ot(()=>{fe(n,"up")}),r=()=>fe(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function ut(t){return vi(t)&&!0}function Ai(t,e,n={}){const[s,i,r]=an(t,n),a=o=>{const l=o.currentTarget;if(!ut(o))return;ee.add(l);const c=e(l,o),u=(d,T)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),ee.has(l)&&ee.delete(l),ut(d)&&typeof c=="function"&&c(d,{success:T})},h=d=>{u(d,l===window||l===document||n.useGlobalTarget||on(l,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),Cn(o)&&(o.addEventListener("focus",c=>Vi(c,i)),!bi(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),r}const wi=[...nn,P,H],Si=t=>wi.find(tn(t));function xi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Mi(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Ci(t,e){return xi(Mi(t.getBoundingClientRect(),e))}const lt=()=>({min:0,max:0}),un=()=>({x:lt(),y:lt()}),Pe={current:null},ln={current:!1};function Pi(){if(ln.current=!0,!!Pn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Pe.current=t.matches;t.addEventListener("change",e),e()}else Pe.current=!1}const Fi=new WeakMap;function Di(t,e,n){for(const s in e){const i=e[s],r=n[s];if(k(i))t.addValue(s,i);else if(k(r))t.addValue(s,re(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const a=t.getValue(s);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(s);t.addValue(s,re(a!==void 0?a:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ct=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ii{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=_e,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=I.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,O.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=!!r,this.isControllingVariants=Fn(n),this.isVariantNode=Dn(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&k(d)&&d.set(l[f])}}mount(e){this.current=e,Fi.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),ln.current||Pi(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Pe.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),me(this.notifyUpdate),me(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=oe.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&O.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in $e){const n=$e[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):un()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ct.length;s++){const i=ct[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,a=e[r];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=Di(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=re(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Mt(s)||Ct(s))?s=parseFloat(s):!Si(s)&&H.test(n)&&(s=rn(e,n)),this.setBaseTarget(e,k(s)?s.get():s)),k(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=bt(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!k(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Ft),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){pi.render(this.render)}}class cn extends Ii{constructor(){super(...arguments),this.KeyframeResolver=ci}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;k(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function hn(t,{style:e,vars:n},s,i){const r=t.style;let a;for(a in e)r[a]=e[a];i?.applyProjectionStyles(r,s);for(a in n)r.setProperty(a,n[a])}function Ei(t){return window.getComputedStyle(t)}class Oi extends cn{constructor(){super(...arguments),this.type="html",this.renderInstance=hn}readValueFromInstance(e,n){if(oe.has(n))return this.projection?.isProjecting?Ve(n):Ds(e,n);{const s=Ei(e),i=(In(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Ci(e,n)}build(e,n,s){En(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return On(e,n,s)}}const fn=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 Ri(t,e,n,s){hn(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(fn.has(i)?i:Vt(i),e.attrs[i])}class Ki extends cn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=un}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(oe.has(n)){const s=sn(n);return s&&s.default||0}return n=fn.has(n)?n:Vt(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Rn(e,n,s)}build(e,n,s){Kn(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Ri(e,n,s,i)}mount(e){this.isSVGTag=kn(e.tagName),super.mount(e)}}const ki=(t,e)=>Nn(t)?new Ki(e):new Oi(e,{allowProjection:t!==Bn.Fragment});function W(t,e,n){const s=t.getProps();return bt(s,e,n!==void 0?n:s.custom,t)}const Fe=t=>Array.isArray(t);function Ni(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,re(n))}function Bi(t){return Fe(t)?t[t.length-1]||0:t}function Li(t,e){const n=W(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const a in r){const o=Bi(r[a]);Ni(t,a,o)}}function Gi(t){return!!(k(t)&&t.add)}function Ui(t,e){const n=t.getValue("willChange");if(Gi(n))return n.add(e);if(!n&&K.WillChange){const s=new K.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function _i(t){return t.props[Ln]}const ji=t=>t!==null;function Wi(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ji),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}const Hi={type:"spring",stiffness:500,damping:25,restSpeed:10},$i=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),qi={type:"keyframes",duration:.8},zi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yi=(t,{keyframes:e})=>e.length>2?qi:oe.has(t)?t.startsWith("scale")?$i(e[1]):Hi:zi;function Xi({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:o,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const Zi=(t,e,n,s={},i,r)=>a=>{const o=Qt(s,t)||{},l=o.delay||s.delay||0;let{elapsed:c=0}=s;c=c-R(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-c,onUpdate:f=>{e.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:r?void 0:i};Xi(o)||Object.assign(u,Yi(t,u)),u.duration&&(u.duration=R(u.duration)),u.repeatDelay&&(u.repeatDelay=R(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Me(u),u.delay===0&&(h=!0)),(K.instantAnimations||K.skipAnimations)&&(h=!0,Me(u),u.delay=0),u.allowFlatten=!o.type&&!o.ease,h&&!r&&e.get()!==void 0){const f=Wi(u.keyframes,o);if(f!==void 0){O.update(()=>{u.onUpdate(f),u.onComplete()});return}}return o.isSync?new Ue(u):new Qs(u)};function Ji({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function dn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:a,...o}=e;s&&(r=s);const l=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const u in o){const h=t.getValue(u,t.latestValues[u]??null),f=o[u];if(f===void 0||c&&Ji(c,u))continue;const d={delay:n,...Qt(r||{},u)},T=h.get();if(T!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===T&&!d.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const p=_i(t);if(p){const V=window.MotionHandoffAnimation(p,u,O);V!==null&&(d.startTime=V,b=!0)}}Ui(t,u),h.start(Zi(u,h,f,t.shouldReduceMotion&&en.has(u)?{type:!1}:d,t,b));const v=h.animation;v&&l.push(v)}return a&&Promise.all(l).then(()=>{O.update(()=>{a&&Li(t,a)})}),l}function pn(t,e,n,s=0,i=1){const r=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),a=t.size,o=(a-1)*s;return typeof n=="function"?n(r,a):i===1?r*s:o-r*s}function De(t,e,n={}){const s=W(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(dn(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:h}=i;return Qi(t,e,l,c,u,h,n)}:()=>Promise.resolve(),{when:o}=i;if(o){const[l,c]=o==="beforeChildren"?[r,a]:[a,r];return l().then(()=>c())}else return Promise.all([r(),a(n.delay)])}function Qi(t,e,n=0,s=0,i=0,r=1,a){const o=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),o.push(De(l,e,{...a,delay:n+(typeof s=="function"?0:s)+pn(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(o)}function er(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>De(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=De(t,e,n);else{const i=typeof e=="function"?W(t,e,n.custom):e;s=Promise.all(dn(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function mn(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const tr=wt.length;function gn(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?gn(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<tr;n++){const s=wt[n],i=t.props[s];(At(i)||i===!1)&&(e[s]=i)}return e}const nr=[...xt].reverse(),sr=xt.length;function ir(t){return e=>Promise.all(e.map(({animation:n,options:s})=>er(t,n,s)))}function rr(t){let e=ir(t),n=ht(),s=!0;const i=l=>(c,u)=>{const h=W(t,u,l==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...T}=h;c={...c,...T,...d}}return c};function r(l){e=l(t)}function a(l){const{props:c}=t,u=gn(t.parent)||{},h=[],f=new Set;let d={},T=1/0;for(let v=0;v<sr;v++){const p=nr[v],V=n[p],g=c[p]!==void 0?c[p]:u[p],w=At(g),m=p===l?V.isActive:null;m===!1&&(T=v);let A=g===u[p]&&g!==c[p]&&w;if(A&&s&&t.manuallyAnimateOnMount&&(A=!1),V.protectedKeys={...d},!V.isActive&&m===null||!g&&!V.prevProp||St(g)||typeof g=="boolean")continue;const x=ar(V.prevProp,g);let y=x||p===l&&V.isActive&&!A&&w||v>T&&w,C=!1;const F=Array.isArray(g)?g:[g];let _=F.reduce(i(p),{});m===!1&&(_={});const{prevResolvedValues:je={}}=V,vn={...je,..._},We=M=>{y=!0,f.has(M)&&(C=!0,f.delete(M)),V.needsAnimating[M]=!0;const D=t.getValue(M);D&&(D.liveStyle=!1)};for(const M in vn){const D=_[M],N=je[M];if(d.hasOwnProperty(M))continue;let j=!1;Fe(D)&&Fe(N)?j=!mn(D,N):j=D!==N,j?D!=null?We(M):f.add(M):D!==void 0&&f.has(M)?We(M):V.protectedKeys[M]=!0}V.prevProp=g,V.prevResolvedValues=_,V.isActive&&(d={...d,..._}),s&&t.blockInitialAnimation&&(y=!1);const He=A&&x;y&&(!He||C)&&h.push(...F.map(M=>{const D={type:p};if(typeof M=="string"&&s&&!He&&t.manuallyAnimateOnMount&&t.parent){const{parent:N}=t,j=W(N,M);if(N.enteringChildren&&j){const{delayChildren:Tn}=j.transition||{};D.delay=pn(N.enteringChildren,t,Tn)}}return{animation:M,options:D}}))}if(f.size){const v={};if(typeof c.initial!="boolean"){const p=W(t,Array.isArray(c.initial)?c.initial[0]:c.initial);p&&p.transition&&(v.transition=p.transition)}f.forEach(p=>{const V=t.getBaseTarget(p),g=t.getValue(p);g&&(g.liveStyle=!0),v[p]=V??null}),h.push({animation:v})}let b=!!h.length;return s&&(c.initial===!1||c.initial===c.animate)&&!t.manuallyAnimateOnMount&&(b=!1),s=!1,b?e(h):Promise.resolve()}function o(l,c){if(n[l].isActive===c)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(l,c)),n[l].isActive=c;const u=a(l);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:a,setActive:o,setAnimateFunction:r,getState:()=>n,reset:()=>{n=ht()}}}function ar(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!mn(e,t):!1}function B(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ht(){return{animate:B(!0),whileInView:B(),whileHover:B(),whileTap:B(),whileDrag:B(),whileFocus:B(),exit:B()}}class q{constructor(e){this.isMounted=!1,this.node=e}update(){}}class or extends q{constructor(e){super(e),e.animationState||(e.animationState=rr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();St(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let ur=0;class lr extends q{constructor(){super(...arguments),this.id=ur++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const cr={animation:{Feature:or},exit:{Feature:lr}};function ft(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function yn(t){return{point:{x:t.pageX,y:t.pageY}}}function dt(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&O.postRender(()=>r(e,yn(e)))}class hr extends q{mount(){const{current:e}=this.node;e&&(this.unmount=yi(e,(n,s)=>(dt(this.node,s,"Start"),i=>dt(this.node,i,"End"))))}unmount(){}}class fr extends q{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=ue(ft(this.node.current,"focus",()=>this.onFocus()),ft(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function pt(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&O.postRender(()=>r(e,yn(e)))}class dr extends q{mount(){const{current:e}=this.node;e&&(this.unmount=Ai(e,(n,s)=>(pt(this.node,s,"Start"),(i,{success:r})=>pt(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ie=new WeakMap,de=new WeakMap,pr=t=>{const e=Ie.get(t.target);e&&e(t)},mr=t=>{t.forEach(pr)};function gr({root:t,...e}){const n=t||document;de.has(n)||de.set(n,{});const s=de.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(mr,{root:t,...e})),s[i]}function yr(t,e,n){const s=gr(e);return Ie.set(t,n),s.observe(t),()=>{Ie.delete(t),s.unobserve(t)}}const vr={some:0,all:1};class Tr extends q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,a={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:vr[i]},o=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,r&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),f=c?u:h;f&&f(l)};return yr(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(br(e,n))&&this.startObserver()}unmount(){}}function br({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Vr={inView:{Feature:Tr},tap:{Feature:dr},focus:{Feature:fr},hover:{Feature:hr}},Ar={renderer:ki,...cr,...Vr};var xr=Ar;export{xr as default};
|