forge-openclaw-plugin 0.2.4 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +113 -5
  2. package/dist/assets/board-CzgvdLO8.js +6 -0
  3. package/dist/assets/board-CzgvdLO8.js.map +1 -0
  4. package/dist/assets/favicon-BCHm9dUV.ico +0 -0
  5. package/dist/assets/index-8d_oM8fL.js +27 -0
  6. package/dist/assets/index-8d_oM8fL.js.map +1 -0
  7. package/dist/assets/index-D4A_bq8m.css +1 -0
  8. package/dist/assets/motion-STUd1O46.js +10 -0
  9. package/dist/assets/motion-STUd1O46.js.map +1 -0
  10. package/dist/assets/plus-jakarta-sans-latin-ext-wght-normal-DmpS2jIq.woff2 +0 -0
  11. package/dist/assets/plus-jakarta-sans-latin-wght-normal-eXO_dkmS.woff2 +0 -0
  12. package/dist/assets/plus-jakarta-sans-vietnamese-wght-normal-qRpaaN48.woff2 +0 -0
  13. package/dist/assets/sora-latin-ext-wght-normal-CawQDOvP.woff2 +0 -0
  14. package/dist/assets/sora-latin-wght-normal-DdqRvwsR.woff2 +0 -0
  15. package/dist/assets/space-grotesk-latin-500-normal-CNSSEhBt.woff +0 -0
  16. package/dist/assets/space-grotesk-latin-500-normal-lFbtlQH6.woff2 +0 -0
  17. package/dist/assets/space-grotesk-latin-700-normal-CwsQ-cCU.woff +0 -0
  18. package/dist/assets/space-grotesk-latin-700-normal-RjhwGPKo.woff2 +0 -0
  19. package/dist/assets/space-grotesk-latin-ext-500-normal-3dgZTiw9.woff +0 -0
  20. package/dist/assets/space-grotesk-latin-ext-500-normal-DUe3BAxM.woff2 +0 -0
  21. package/dist/assets/space-grotesk-latin-ext-700-normal-BQnZhY3m.woff2 +0 -0
  22. package/dist/assets/space-grotesk-latin-ext-700-normal-HVCqSBdx.woff +0 -0
  23. package/dist/assets/space-grotesk-vietnamese-500-normal-BTqKIpxg.woff +0 -0
  24. package/dist/assets/space-grotesk-vietnamese-500-normal-BmEvtly_.woff2 +0 -0
  25. package/dist/assets/space-grotesk-vietnamese-700-normal-DMty7AZE.woff2 +0 -0
  26. package/dist/assets/space-grotesk-vietnamese-700-normal-Duxec5Rn.woff +0 -0
  27. package/dist/assets/table-CtNlETLc.js +23 -0
  28. package/dist/assets/table-CtNlETLc.js.map +1 -0
  29. package/dist/assets/ui-ThzkR_oW.js +46 -0
  30. package/dist/assets/ui-ThzkR_oW.js.map +1 -0
  31. package/dist/assets/vendor-CRS-psbw.css +1 -0
  32. package/dist/assets/vendor-DyHAI6nk.js +423 -0
  33. package/dist/assets/vendor-DyHAI6nk.js.map +1 -0
  34. package/dist/assets/viz-BJuBCz_G.js +34 -0
  35. package/dist/assets/viz-BJuBCz_G.js.map +1 -0
  36. package/dist/favicon.ico +0 -0
  37. package/dist/favicon.png +0 -0
  38. package/dist/index.html +29 -0
  39. package/dist/openclaw/api-client.d.ts +8 -0
  40. package/dist/openclaw/api-client.js +31 -4
  41. package/dist/openclaw/local-runtime.d.ts +3 -0
  42. package/dist/openclaw/local-runtime.js +135 -0
  43. package/dist/openclaw/parity.d.ts +4 -4
  44. package/dist/openclaw/parity.js +23 -33
  45. package/dist/openclaw/plugin-entry-shared.d.ts +4 -2
  46. package/dist/openclaw/plugin-entry-shared.js +51 -9
  47. package/dist/openclaw/routes.d.ts +12 -3
  48. package/dist/openclaw/routes.js +156 -924
  49. package/dist/openclaw/tools.js +242 -1100
  50. package/dist/server/app.js +2450 -0
  51. package/dist/server/db.js +313 -0
  52. package/dist/server/e2e-server.js +20 -0
  53. package/dist/server/errors.js +15 -0
  54. package/dist/server/index.js +16 -0
  55. package/dist/server/managers/base.js +17 -0
  56. package/dist/server/managers/contracts.js +47 -0
  57. package/dist/server/managers/platform/api-gateway-manager.js +11 -0
  58. package/dist/server/managers/platform/audit-manager.js +15 -0
  59. package/dist/server/managers/platform/authentication-manager.js +56 -0
  60. package/dist/server/managers/platform/authorization-manager.js +56 -0
  61. package/dist/server/managers/platform/background-job-manager.js +10 -0
  62. package/dist/server/managers/platform/configuration-manager.js +33 -0
  63. package/dist/server/managers/platform/database-manager.js +14 -0
  64. package/dist/server/managers/platform/event-bus-manager.js +7 -0
  65. package/dist/server/managers/platform/external-service-manager.js +11 -0
  66. package/dist/server/managers/platform/health-manager.js +7 -0
  67. package/dist/server/managers/platform/migration-manager.js +8 -0
  68. package/dist/server/managers/platform/search-index-manager.js +4 -0
  69. package/dist/server/managers/platform/secrets-manager.js +19 -0
  70. package/dist/server/managers/platform/session-manager.js +121 -0
  71. package/dist/server/managers/platform/storage-manager.js +16 -0
  72. package/dist/server/managers/platform/token-manager.js +37 -0
  73. package/dist/server/managers/platform/transaction-manager.js +8 -0
  74. package/dist/server/managers/platform/trusted-network.js +39 -0
  75. package/dist/server/managers/runtime.js +56 -0
  76. package/dist/server/managers/type-guards.js +4 -0
  77. package/dist/server/openapi.js +3512 -0
  78. package/dist/server/psyche-types.js +395 -0
  79. package/dist/server/repositories/activity-events.js +157 -0
  80. package/dist/server/repositories/collaboration.js +497 -0
  81. package/dist/server/repositories/comments.js +176 -0
  82. package/dist/server/repositories/deleted-entities.js +192 -0
  83. package/dist/server/repositories/domains.js +30 -0
  84. package/dist/server/repositories/event-log.js +64 -0
  85. package/dist/server/repositories/goals.js +159 -0
  86. package/dist/server/repositories/projects.js +214 -0
  87. package/dist/server/repositories/psyche.js +1356 -0
  88. package/dist/server/repositories/rewards.js +675 -0
  89. package/dist/server/repositories/settings.js +399 -0
  90. package/dist/server/repositories/tags.js +160 -0
  91. package/dist/server/repositories/task-runs.js +488 -0
  92. package/dist/server/repositories/tasks.js +413 -0
  93. package/dist/server/services/context.js +214 -0
  94. package/dist/server/services/dashboard.js +170 -0
  95. package/dist/server/services/entity-crud.js +576 -0
  96. package/dist/server/services/gamification.js +215 -0
  97. package/dist/server/services/insights.js +91 -0
  98. package/dist/server/services/projects.js +75 -0
  99. package/dist/server/services/psyche.js +63 -0
  100. package/dist/server/services/relations.js +28 -0
  101. package/dist/server/services/reviews.js +88 -0
  102. package/dist/server/services/run-recovery.js +13 -0
  103. package/dist/server/services/tagging.js +49 -0
  104. package/dist/server/services/task-run-watchdog.js +92 -0
  105. package/dist/server/services/work-time.js +176 -0
  106. package/dist/server/types.js +999 -0
  107. package/dist/server/web.js +91 -0
  108. package/openclaw.plugin.json +21 -9
  109. package/package.json +17 -4
  110. package/server/migrations/001_core.sql +333 -0
  111. package/server/migrations/002_psyche.sql +241 -0
  112. package/server/migrations/003_timer_execution.sql +18 -0
  113. package/server/migrations/004_psyche_linked_entities.sql +5 -0
  114. package/server/migrations/005_adaptive_schemas.sql +157 -0
  115. package/server/migrations/006_psyche_auth_setting.sql +4 -0
  116. package/server/migrations/007_deleted_entities.sql +16 -0
  117. package/skills/forge-openclaw/SKILL.md +189 -275
@@ -0,0 +1,10 @@
1
+ import{r as T,j as nt}from"./vendor-DyHAI6nk.js";const Qe=T.createContext({});function tn(t){const e=T.useRef(null);return e.current===null&&(e.current=t()),e.current}const Bo=typeof window<"u",Hs=Bo?T.useLayoutEffect:T.useEffect,ue=T.createContext(null);function en(t,e){t.indexOf(e)===-1&&t.push(e)}function Qt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Q=(t,e,n)=>n>e?e:n<t?t:n;let nn=()=>{};const rt={},_s=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Xs(t){return typeof t=="object"&&t!==null}const Ys=t=>/^0[^.\s]+$/u.test(t);function qs(t){let e;return()=>(e===void 0&&(e=t()),e)}const z=t=>t,Fo=(t,e)=>n=>e(t(n)),It=(...t)=>t.reduce(Fo),Lt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class sn{constructor(){this.subscriptions=[]}add(e){return en(this.subscriptions,e),()=>Qt(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 o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const W=t=>t*1e3,$=t=>t/1e3;function Zs(t,e){return e?t*(1e3/e):0}const Js=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Io=1e-7,Oo=12;function jo(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Js(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Io&&++a<Oo);return o}function Ot(t,e,n,s){if(t===e&&n===s)return z;const i=r=>jo(r,0,1,t,n);return r=>r===0||r===1?r:Js(i(r),e,s)}const Qs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ti=t=>e=>1-t(1-e),ei=Ot(.33,1.53,.69,.99),on=ti(ei),ni=Qs(on),si=t=>t>=1?1:(t*=2)<1?.5*on(t):.5*(2-Math.pow(2,-10*(t-1))),rn=t=>1-Math.sin(Math.acos(t)),ii=ti(rn),oi=Qs(rn),No=Ot(.42,0,1,1),Uo=Ot(0,0,.58,1),ri=Ot(.42,0,.58,1),Wo=t=>Array.isArray(t)&&typeof t[0]!="number",ai=t=>Array.isArray(t)&&typeof t[0]=="number",Ko={linear:z,easeIn:No,easeInOut:ri,easeOut:Uo,circIn:rn,circInOut:oi,circOut:ii,backIn:on,backInOut:ni,backOut:ei,anticipate:si},$o=t=>typeof t=="string",En=t=>{if(ai(t)){nn(t.length===4);const[e,n,s,i]=t;return Ot(e,n,s,i)}else if($o(t))return Ko[t];return t},Ut=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function zo(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),t()),u(a)}const c={schedule:(u,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&o.add(u),p.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0;const h=n;n=s,s=h,n.forEach(l),n.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const Go=40;function li(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Ut.reduce((v,w)=>(v[w]=zo(r),v),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:f,render:d,postRender:p}=o,g=()=>{const v=rt.useManualTiming,w=v?i.timestamp:performance.now();n=!1,v||(i.delta=s?1e3/60:Math.max(Math.min(w-i.timestamp,Go),1)),i.timestamp=w,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},m=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:Ut.reduce((v,w)=>{const P=o[w];return v[w]=(C,R=!1,A=!1)=>(n||m(),P.schedule(C,R,A)),v},{}),cancel:v=>{for(let w=0;w<Ut.length;w++)o[Ut[w]].cancel(v)},state:i,steps:o}}const{schedule:M,cancel:at,state:O,steps:pe}=li(typeof requestAnimationFrame<"u"?requestAnimationFrame:z,!0);let Gt;function Ho(){Gt=void 0}const N={now:()=>(Gt===void 0&&N.set(O.isProcessing||rt.useManualTiming?O.timestamp:performance.now()),Gt),set:t=>{Gt=t,queueMicrotask(Ho)}},ui=t=>e=>typeof e=="string"&&e.startsWith(t),ci=ui("--"),_o=ui("var(--"),an=t=>_o(t)?Xo.test(t.split("/*")[0].trim()):!1,Xo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Rn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Pt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},kt={...Pt,transform:t=>Q(0,1,t)},Wt={...Pt,default:1},Mt=t=>Math.round(t*1e5)/1e5,ln=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Yo(t){return t==null}const qo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,un=(t,e)=>n=>!!(typeof n=="string"&&qo.test(n)&&n.startsWith(t)||e&&!Yo(n)&&Object.prototype.hasOwnProperty.call(n,e)),hi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(ln);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Zo=t=>Q(0,255,t),me={...Pt,transform:t=>Math.round(Zo(t))},ft={test:un("rgb","red"),parse:hi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+me.transform(t)+", "+me.transform(e)+", "+me.transform(n)+", "+Mt(kt.transform(s))+")"};function Jo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Ee={test:un("#"),parse:Jo,transform:ft.transform},jt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),st=jt("deg"),J=jt("%"),S=jt("px"),Qo=jt("vh"),tr=jt("vw"),Ln={...J,parse:t=>J.parse(t)/100,transform:t=>J.transform(t*100)},vt={test:un("hsl","hue"),parse:hi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+J.transform(Mt(e))+", "+J.transform(Mt(n))+", "+Mt(kt.transform(s))+")"},k={test:t=>ft.test(t)||Ee.test(t)||vt.test(t),parse:t=>ft.test(t)?ft.parse(t):vt.test(t)?vt.parse(t):Ee.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ft.transform(t):vt.transform(t),getAnimatableNone:t=>{const e=k.parse(t);return e.alpha=0,k.transform(e)}},er=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function nr(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ln))==null?void 0:e.length)||0)+(((n=t.match(er))==null?void 0:n.length)||0)>0}const fi="number",di="color",sr="var",ir="var(",kn="${}",or=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(or,l=>(k.test(l)?(s.color.push(r),i.push(di),n.push(k.parse(l))):l.startsWith(ir)?(s.var.push(r),i.push(sr),n.push(l)):(s.number.push(r),i.push(fi),n.push(parseFloat(l))),++r,kn)).split(kn);return{values:n,split:a,indexes:s,types:i}}function rr(t){return wt(t).values}function pi({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===fi?i+=Mt(s[r]):o===di?i+=k.transform(s[r]):i+=s[r]}return i}}function ar(t){return pi(wt(t))}const lr=t=>typeof t=="number"?0:k.test(t)?k.getAnimatableNone(t):t,ur=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:lr(t);function cr(t){const e=wt(t);return pi(e)(e.values.map((s,i)=>ur(s,e.split[i])))}const _={test:nr,parse:rr,createTransformer:ar,getAnimatableNone:cr};function ge(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 hr({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=ge(l,a,t+1/3),r=ge(l,a,t),o=ge(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function te(t,e){return n=>n>0?e:t}const D=(t,e,n)=>t+(e-t)*n,ye=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},fr=[Ee,ft,vt],dr=t=>fr.find(e=>e.test(t));function Bn(t){const e=dr(t);if(!e)return!1;let n=e.parse(t);return e===vt&&(n=hr(n)),n}const Fn=(t,e)=>{const n=Bn(t),s=Bn(e);if(!n||!s)return te(t,e);const i={...n};return r=>(i.red=ye(n.red,s.red,r),i.green=ye(n.green,s.green,r),i.blue=ye(n.blue,s.blue,r),i.alpha=D(n.alpha,s.alpha,r),ft.transform(i))},Re=new Set(["none","hidden"]);function pr(t,e){return Re.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function mr(t,e){return n=>D(t,e,n)}function cn(t){return typeof t=="number"?mr:typeof t=="string"?an(t)?te:k.test(t)?Fn:vr:Array.isArray(t)?mi:typeof t=="object"?k.test(t)?Fn:gr:te}function mi(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>cn(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function gr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=cn(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function yr(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],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const vr=(t,e)=>{const n=_.createTransformer(e),s=wt(t),i=wt(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?Re.has(t)&&!i.values.length||Re.has(e)&&!s.values.length?pr(t,e):It(mi(yr(s,i),i.values),n):te(t,e)};function gi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?D(t,e,n):cn(t)(t,e)}const xr=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>M.update(e,n),stop:()=>at(e),now:()=>O.isProcessing?O.timestamp:N.now()}},yi=(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)})`},ee=2e4;function hn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<ee;)e+=n,s=t.next(e);return e>=ee?1/0:e}function Tr(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(hn(s),ee);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:$(i)}}const L={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};function Le(t,e){return t*Math.sqrt(1-e*e)}const wr=12;function Sr(t,e,n){let s=n;for(let i=1;i<wr;i++)s=s-t(s)/e(s);return s}const ve=.001;function Pr({duration:t=L.duration,bounce:e=L.bounce,velocity:n=L.velocity,mass:s=L.mass}){let i,r,o=1-e;o=Q(L.minDamping,L.maxDamping,o),t=Q(L.minDuration,L.maxDuration,$(t)),o<1?(i=c=>{const u=c*o,h=u*t,f=u-n,d=Le(c,o),p=Math.exp(-h);return ve-f/d*p},r=c=>{const h=c*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(c,2)*t,p=Math.exp(-h),g=Le(Math.pow(c,2),o);return(-i(c)+ve>0?-1:1)*((f-d)*p)/g}):(i=c=>{const u=Math.exp(-c*t),h=(c-n)*t+1;return-ve+u*h},r=c=>{const u=Math.exp(-c*t),h=(n-c)*(t*t);return u*h});const a=5/t,l=Sr(i,r,a);if(t=W(t),isNaN(l))return{stiffness:L.stiffness,damping:L.damping,duration:t};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:t}}}const br=["duration","bounce"],Ar=["stiffness","damping","mass"];function In(t,e){return e.some(n=>t[n]!==void 0)}function Vr(t){let e={velocity:L.velocity,stiffness:L.stiffness,damping:L.damping,mass:L.mass,isResolvedFromDuration:!1,...t};if(!In(t,Ar)&&In(t,br))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*Q(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:L.mass,stiffness:i,damping:r}}else{const n=Pr({...t,velocity:0});e={...e,...n,mass:L.mass},e.isResolvedFromDuration=!0}return e}function ne(t=L.visualDuration,e=L.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],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=Vr({...n,velocity:-$(n.velocity||0)}),p=f||0,g=c/(2*Math.sqrt(l*u)),m=o-r,y=$(Math.sqrt(l/u)),x=Math.abs(m)<5;s||(s=x?L.restSpeed.granular:L.restSpeed.default),i||(i=x?L.restDelta.granular:L.restDelta.default);let v,w,P,C,R,A;if(g<1)P=Le(y,g),C=(p+g*y*m)/P,v=b=>{const E=Math.exp(-g*y*b);return o-E*(C*Math.sin(P*b)+m*Math.cos(P*b))},R=g*y*C+m*P,A=g*y*m-C*P,w=b=>Math.exp(-g*y*b)*(R*Math.sin(P*b)+A*Math.cos(P*b));else if(g===1){v=E=>o-Math.exp(-y*E)*(m+(p+y*m)*E);const b=p+y*m;w=E=>Math.exp(-y*E)*(y*b*E-p)}else{const b=y*Math.sqrt(g*g-1);v=X=>{const et=Math.exp(-g*y*X),Y=Math.min(b*X,300);return o-et*((p+g*y*m)*Math.sinh(Y)+b*m*Math.cosh(Y))/b};const E=(p+g*y*m)/b,F=g*y*E-m*b,tt=g*y*m-E*b;w=X=>{const et=Math.exp(-g*y*X),Y=Math.min(b*X,300);return et*(F*Math.sinh(Y)+tt*Math.cosh(Y))}}const V={calculatedDuration:d&&h||null,velocity:b=>W(w(b)),next:b=>{if(!d&&g<1){const F=Math.exp(-g*y*b),tt=Math.sin(P*b),X=Math.cos(P*b),et=o-F*(C*tt+m*X),Y=W(F*(R*tt+A*X));return a.done=Math.abs(Y)<=s&&Math.abs(o-et)<=i,a.value=a.done?o:et,a}const E=v(b);if(d)a.done=b>=h;else{const F=W(w(b));a.done=Math.abs(F)<=s&&Math.abs(o-E)<=i}return a.value=a.done?o:E,a},toString:()=>{const b=Math.min(hn(V),ee),E=yi(F=>V.next(b*F).value,b,30);return b+"ms "+E},toTransition:()=>{}};return V}ne.applyToOptions=t=>{const e=Tr(t,100,ne);return t.ease=e.ease,t.duration=W(e.duration),t.type="keyframes",t};const Cr=5;function vi(t,e,n){const s=Math.max(e-Cr,0);return Zs(n-t(s),e-s)}function ke({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=A=>a!==void 0&&A<a||l!==void 0&&A>l,p=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let g=n*e;const m=h+g,y=o===void 0?m:o(m);y!==m&&(g=y-h);const x=A=>-g*Math.exp(-A/s),v=A=>y+x(A),w=A=>{const V=x(A),b=v(A);f.done=Math.abs(V)<=c,f.value=f.done?y:b};let P,C;const R=A=>{d(f.value)&&(P=A,C=ne({keyframes:[f.value,p(f.value)],velocity:vi(v,A,f.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return R(0),{calculatedDuration:null,next:A=>{let V=!1;return!C&&P===void 0&&(V=!0,w(A),R(A)),P!==void 0&&A>=P?C.next(A-P):(!V&&w(A),f)}}}function Mr(t,e,n){const s=[],i=n||rt.mix||gi,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||z:e;a=It(l,a)}s.push(a)}return s}function Dr(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(nn(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Mr(e,s,i),l=a.length,c=u=>{if(o&&u<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Lt(t[h],t[h+1],u);return a[h](f)};return n?u=>c(Q(t[0],t[r-1],u)):c}function Er(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Lt(0,e,s);t.push(D(n,1,i))}}function Rr(t){const e=[0];return Er(e,t.length-1),e}function Lr(t,e){return t.map(n=>n*e)}function kr(t,e){return t.map(()=>e||ri).splice(0,t.length-1)}function Dt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Wo(s)?s.map(En):En(s),r={done:!1,value:e[0]},o=Lr(n&&n.length===e.length?n:Rr(e),t),a=Dr(o,e,{ease:Array.isArray(i)?i:kr(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Br=t=>t!==null;function ce(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Br),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Fr={decay:ke,inertia:ke,tween:Dt,keyframes:Dt,spring:ne};function xi(t){typeof t.type=="string"&&(t.type=Fr[t.type])}class fn{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 Ir=t=>t/100;class se extends fn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==N.now()&&this.tick(N.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;xi(e);const{type:n=Dt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const l=n||Dt;l!==Dt&&typeof a[0]!="number"&&(this.mixKeyframes=It(Ir,gi(a[0],a[1])),a=[0,100]);const c=l({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=hn(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:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:g,finalKeyframe:m}=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 y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,w=s;if(h){const A=Math.min(this.currentTime,i)/a;let V=Math.floor(A),b=A%1;!b&&A>=1&&(b=1),b===1&&V--,V=Math.min(V,h+1),!!(V%2)&&(f==="reverse"?(b=1-b,d&&(b-=d/a)):f==="mirror"&&(w=o)),v=Q(0,1,b)*a}let P;x?(this.delayState.value=u[0],P=this.delayState):P=w.next(v),r&&!x&&(P.value=r(P.value));let{done:C}=P;!x&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return R&&p!==ke&&(P.value=ce(u,this.options,m,this.speed)),g&&g(P.value),R&&this.finish(),P}then(e,n){return this.finished.then(e,n)}get duration(){return $(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(this.currentTime)}set time(e){e=W(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return vi(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=$(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:e=xr,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(r=(i=this.options).onPlay)==null||r.call(i);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(N.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}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){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Or(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const dt=t=>t*180/Math.PI,Be=t=>{const e=dt(Math.atan2(t[1],t[0]));return Fe(e)},jr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Be,rotateZ:Be,skewX:t=>dt(Math.atan(t[1])),skewY:t=>dt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Fe=t=>(t=t%360,t<0&&(t+=360),t),On=Be,jn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Nn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Nr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:jn,scaleY:Nn,scale:t=>(jn(t)+Nn(t))/2,rotateX:t=>Fe(dt(Math.atan2(t[6],t[5]))),rotateY:t=>Fe(dt(Math.atan2(-t[2],t[0]))),rotateZ:On,rotate:On,skewX:t=>dt(Math.atan(t[4])),skewY:t=>dt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ie(t){return t.includes("scale")?1:0}function Oe(t,e){if(!t||t==="none")return Ie(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Nr,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=jr,i=a}if(!i)return Ie(e);const r=s[e],o=i[1].split(",").map(Wr);return typeof r=="function"?r(o):o[r]}const Ur=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Oe(n,e)};function Wr(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],At=new Set(bt),Un=t=>t===Pt||t===S,Kr=new Set(["x","y","z"]),$r=bt.filter(t=>!Kr.has(t));function zr(t){const e=[];return $r.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ot={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-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})=>Oe(e,"x"),y:(t,{transform:e})=>Oe(e,"y")};ot.translateX=ot.x;ot.translateY=ot.y;const pt=new Set;let je=!1,Ne=!1,Ue=!1;function Ti(){if(Ne){const t=Array.from(pt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=zr(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,o])=>{var a;(a=s.getValue(r))==null||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Ne=!1,je=!1,pt.forEach(t=>t.complete(Ue)),pt.clear()}function wi(){pt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ne=!0)})}function Gr(){Ue=!0,wi(),Ti(),Ue=!1}class dn{constructor(e,n,s,i,r,o=!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=o}scheduleResolve(){this.state="scheduled",this.isAsync?(pt.add(this),je||(je=!0,M.read(wi),M.resolveKeyframes(Ti))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i==null?void 0:i.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Or(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),pt.delete(this)}cancel(){this.state==="scheduled"&&(pt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Hr=t=>t.startsWith("--");function Si(t,e,n){Hr(e)?t.style.setProperty(e,n):t.style[e]=n}const _r={};function Pi(t,e){const n=qs(t);return()=>_r[e]??n()}const Xr=Pi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),bi=Pi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ct=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Wn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ct([0,.65,.55,1]),circOut:Ct([.55,0,1,.45]),backIn:Ct([.31,.01,.66,-.59]),backOut:Ct([.33,1.53,.69,.99])};function Ai(t,e){if(t)return typeof t=="function"?bi()?yi(t,e):"ease-out":ai(t)?Ct(t):Array.isArray(t)?t.map(n=>Ai(n,e)||Wn.easeOut):Wn[t]}function Yr(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Ai(a,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:o==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(u,f)}function Vi(t){return typeof t=="function"&&"applyToOptions"in t}function qr({type:t,...e}){return Vi(t)&&bi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ci extends fn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,nn(typeof e.type!="string");const c=qr(e);this.animation=Yr(n,s,i,c,r),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=ce(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),Si(n,s,u),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}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(){var n,s,i;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return $(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=W(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Xr()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),z):i(this)}}const Mi={anticipate:si,backInOut:ni,circInOut:oi};function Zr(t){return t in Mi}function Jr(t){typeof t.ease=="string"&&Zr(t.ease)&&(t.ease=Mi[t.ease])}const xe=10;class Qr extends Ci{constructor(e){Jr(e),xi(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new se({...o,autoplay:!1}),l=Math.max(xe,N.now()-this.startTime),c=Q(0,xe,l-xe),u=a.sample(l).value,{name:h}=this.options;r&&h&&Si(r,h,u),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,u,c),a.stop()}}const Kn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_.test(t)||t==="0")&&!t.startsWith("url("));function ta(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 ea(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],o=Kn(i,e),a=Kn(r,e);return!o||!a?!1:ta(t)||(n==="spring"||Vi(n))&&s}function We(t){t.duration=0,t.type="keyframes"}const Di=new Set(["opacity","clipPath","filter","transform"]),na=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function sa(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&na.test(t[e]))return!0;return!1}const ia=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),oa=qs(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ra(t){var h;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!(((h=e==null?void 0:e.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return oa()&&n&&(Di.has(n)||ia.has(n)&&sa(a))&&(n!=="transform"||!u)&&!c&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const aa=40;class la extends fn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:u,...h}){var p;super(),this.stop=()=>{var g,m;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(m=this.keyframeResolver)==null||m.cancel()},this.createdAt=N.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:l,motionValue:c,element:u,...h},d=(u==null?void 0:u.KeyframeResolver)||dn;this.keyframeResolver=new d(a,(g,m,y)=>this.onKeyframesResolved(g,m,f,!y),l,c,u),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(e,n,s,i){var y,x;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:u}=s;this.resolvedAt=N.now();let h=!0;ea(e,r,o,a)||(h=!1,(rt.instantAnimations||!l)&&(u==null||u(ce(e,s,n))),e[0]=e[e.length-1],We(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>aa?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},p=h&&!c&&ra(d),g=(x=(y=d.motionValue)==null?void 0:y.owner)==null?void 0:x.current;let m;if(p)try{m=new Qr({...d,element:g})}catch{m=new se(d)}else m=new se(d);m.finished.then(()=>{this.notifyFinished()}).catch(z),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Gr()),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(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function Ei(t,e,n,s=0,i=1){const r=Array.from(t).sort((c,u)=>c.sortNodePosition(u)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const ua=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ca(t){const e=ua.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Ri(t,e,n=1){const[s,i]=ca(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return _s(o)?parseFloat(o):o}return an(i)?Ri(i,e,n+1):i}const ha={type:"spring",stiffness:500,damping:25,restSpeed:10},fa=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),da={type:"keyframes",duration:.8},pa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ma=(t,{keyframes:e})=>e.length>2?da:At.has(t)?t.startsWith("scale")?fa(e[1]):ha:pa;function Li(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function pn(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?Li(n,t):n}const ga=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function ya(t){for(const e in t)if(!ga.has(e))return!0;return!1}const mn=(t,e,n,s={},i,r)=>o=>{const a=pn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-W(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};ya(a)||Object.assign(u,ma(t,u)),u.duration&&(u.duration=W(u.duration)),u.repeatDelay&&(u.repeatDelay=W(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(We(u),u.delay===0&&(h=!0)),(rt.instantAnimations||rt.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(h=!0,We(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=ce(u.keyframes,a);if(f!==void 0){M.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new se(u):new la(u)};function $n(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function gn(t,e,n,s){if(typeof e=="function"){const[i,r]=$n(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=$n(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function mt(t,e,n){const s=t.getProps();return gn(s,e,n!==void 0?n:s.custom,t)}const ki=new Set(["width","height","top","left","right","bottom",...bt]),zn=30,va=t=>!isNaN(parseFloat(t));class xa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var r;const i=N.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=va(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 sn);const s=this.events[e].add(n);return e==="change"?()=>{s(),M.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(){var e;(e=this.events.change)==null||e.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=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>zn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,zn);return Zs(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(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function St(t,e){return new xa(t,e)}const Ke=t=>Array.isArray(t);function Ta(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,St(n))}function wa(t){return Ke(t)?t[t.length-1]||0:t}function Sa(t,e){const n=mt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=wa(r[o]);Ta(t,o,a)}}const j=t=>!!(t&&t.getVelocity);function Pa(t){return!!(j(t)&&t.add)}function $e(t,e){const n=t.getValue("willChange");if(Pa(n))return n.add(e);if(!n&&rt.WillChange){const s=new rt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function yn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ba="framerAppearId",Bi="data-"+yn(ba);function Fi(t){return t.props[Bi]}function Aa({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ii(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();r=r?Li(r,l):l;const c=r==null?void 0:r.reduceMotion;s&&(r=s);const u=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),p=a[f];if(p===void 0||h&&Aa(h,f))continue;const g={delay:n,...pn(r||{},f)},m=d.get();if(m!==void 0&&!d.isAnimating()&&!Array.isArray(p)&&p===m&&!g.velocity){M.update(()=>d.set(p));continue}let y=!1;if(window.MotionHandoffAnimation){const w=Fi(t);if(w){const P=window.MotionHandoffAnimation(w,f,M);P!==null&&(g.startTime=P,y=!0)}}$e(t,f);const x=c??t.shouldReduceMotion;d.start(mn(f,d,p,x&&ki.has(f)?{type:!1}:g,t,y));const v=d.animation;v&&u.push(v)}if(o){const f=()=>M.update(()=>{o&&Sa(t,o)});u.length?Promise.all(u).then(f):f()}return u}function ze(t,e,n={}){var l;const s=mt(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Ii(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:f}=i;return Va(t,e,c,u,h,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function Va(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ze(l,e,{...o,delay:n+(typeof s=="function"?0:s)+Ei(t.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Ca(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>ze(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=ze(t,e,n);else{const i=typeof e=="function"?mt(t,e,n.custom):e;s=Promise.all(Ii(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Ma={test:t=>t==="auto",parse:t=>t},Oi=t=>e=>e.test(t),ji=[Pt,S,J,st,tr,Qo,Ma],Gn=t=>ji.find(Oi(t));function Da(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ys(t):!0}const Ea=new Set(["brightness","contrast","saturate","opacity"]);function Ra(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(ln)||[];if(!s)return t;const i=n.replace(s,"");let r=Ea.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const La=/\b([a-z-]*)\(.*?\)/gu,Ge={..._,getAnimatableNone:t=>{const e=t.match(La);return e?e.map(Ra).join(" "):t}},He={..._,getAnimatableNone:t=>{const e=_.parse(t);return _.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Hn={...Pt,transform:Math.round},ka={rotate:st,rotateX:st,rotateY:st,rotateZ:st,scale:Wt,scaleX:Wt,scaleY:Wt,scaleZ:Wt,skew:st,skewX:st,skewY:st,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:kt,originX:Ln,originY:Ln,originZ:S},vn={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,inset:S,insetBlock:S,insetBlockStart:S,insetBlockEnd:S,insetInline:S,insetInlineStart:S,insetInlineEnd:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockStart:S,paddingBlockEnd:S,paddingInline:S,paddingInlineStart:S,paddingInlineEnd:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockStart:S,marginBlockEnd:S,marginInline:S,marginInlineStart:S,marginInlineEnd:S,fontSize:S,backgroundPositionX:S,backgroundPositionY:S,...ka,zIndex:Hn,fillOpacity:kt,strokeOpacity:kt,numOctaves:Hn},Ba={...vn,color:k,backgroundColor:k,outlineColor:k,fill:k,stroke:k,borderColor:k,borderTopColor:k,borderRightColor:k,borderBottomColor:k,borderLeftColor:k,filter:Ge,WebkitFilter:Ge,mask:He,WebkitMask:He},Ni=t=>Ba[t],Fa=new Set([Ge,He]);function Ui(t,e){let n=Ni(t);return Fa.has(n)||(n=_),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ia=new Set(["auto","none","0"]);function Oa(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Ia.has(r)&&wt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Ui(n,i)}class ja extends dn{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 u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),an(h))){const f=Ri(h,n.current);f!==void 0&&(e[u]=f),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!ki.has(s)||e.length!==2)return;const[i,r]=e,o=Gn(i),a=Gn(r),l=Rn(i),c=Rn(r);if(l!==c&&ot[s]){this.needsMeasurement=!0;return}if(o!==a)if(Un(o)&&Un(a))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else ot[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Da(e[i]))&&s.push(i);s.length&&Oa(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=ot[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(){var a;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,o=s[r];s[r]=ot[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Wi(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const Ki=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ht(t){return Xs(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:xn}=li(queueMicrotask,!1),H={x:!1,y:!1};function $i(){return H.x||H.y}function Na(t){return t==="x"||t==="y"?H[t]?null:(H[t]=!0,()=>{H[t]=!1}):H.x||H.y?null:(H.x=H.y=!0,()=>{H.x=H.y=!1})}function zi(t,e){const n=Wi(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Ua(t){return!(t.pointerType==="touch"||$i())}function Wa(t,e,n={}){const[s,i,r]=zi(t,n);return s.forEach(o=>{let a=!1,l=!1,c;const u=()=>{o.removeEventListener("pointerleave",p)},h=m=>{c&&(c(m),c=void 0),u()},f=m=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(m))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=m=>{if(m.pointerType!=="touch"){if(a){l=!0;return}h(m)}},g=m=>{if(!Ua(m))return;l=!1;const y=e(o,m);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",g,i),o.addEventListener("pointerdown",d,i)}),r}const Gi=(t,e)=>e?t===e?!0:Gi(t,e.parentElement):!1,Tn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ka=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $a(t){return Ka.has(t.tagName)||t.isContentEditable===!0}const za=new Set(["INPUT","SELECT","TEXTAREA"]);function Ga(t){return za.has(t.tagName)||t.isContentEditable===!0}const _t=new WeakSet;function _n(t){return e=>{e.key==="Enter"&&t(e)}}function Te(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ha=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=_n(()=>{if(_t.has(n))return;Te(n,"down");const i=_n(()=>{Te(n,"up")}),r=()=>Te(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 Xn(t){return Tn(t)&&!$i()}const Yn=new WeakSet;function _a(t,e,n={}){const[s,i,r]=zi(t,n),o=a=>{const l=a.currentTarget;if(!Xn(a)||Yn.has(a))return;_t.add(l),n.stopPropagation&&Yn.add(a);const c=e(l,a),u=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),_t.has(l)&&_t.delete(l),Xn(d)&&typeof c=="function"&&c(d,{success:p})},h=d=>{u(d,l===window||l===document||n.useGlobalTarget||Gi(l,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Ht(a)&&(a.addEventListener("focus",c=>Ha(c,i)),!$a(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function wn(t){return Xs(t)&&"ownerSVGElement"in t}const Xt=new WeakMap;let it;const Hi=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:wn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Xa=Hi("inline","width","offsetWidth"),Ya=Hi("block","height","offsetHeight");function qa({target:t,borderBoxSize:e}){var n;(n=Xt.get(t))==null||n.forEach(s=>{s(t,{get width(){return Xa(t,e)},get height(){return Ya(t,e)}})})}function Za(t){t.forEach(qa)}function Ja(){typeof ResizeObserver>"u"||(it=new ResizeObserver(Za))}function Qa(t,e){it||Ja();const n=Wi(t);return n.forEach(s=>{let i=Xt.get(s);i||(i=new Set,Xt.set(s,i)),i.add(e),it==null||it.observe(s)}),()=>{n.forEach(s=>{const i=Xt.get(s);i==null||i.delete(e),i!=null&&i.size||it==null||it.unobserve(s)})}}const Yt=new Set;let xt;function tl(){xt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yt.forEach(e=>e(t))},window.addEventListener("resize",xt)}function el(t){return Yt.add(t),xt||tl(),()=>{Yt.delete(t),!Yt.size&&typeof xt=="function"&&(window.removeEventListener("resize",xt),xt=void 0)}}function qn(t,e){return typeof t=="function"?el(t):Qa(t,e)}function nl(t){return wn(t)&&t.tagName==="svg"}const sl=[...ji,k,_],il=t=>sl.find(Oi(t)),Zn=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tt=()=>({x:Zn(),y:Zn()}),Jn=()=>({min:0,max:0}),B=()=>({x:Jn(),y:Jn()}),ol=new WeakMap;function he(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Bt(t){return typeof t=="string"||Array.isArray(t)}const Sn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Pn=["initial",...Sn];function fe(t){return he(t.animate)||Pn.some(e=>Bt(t[e]))}function _i(t){return!!(fe(t)||t.variants)}function rl(t,e,n){for(const s in e){const i=e[s],r=n[s];if(j(i))t.addValue(s,i);else if(j(r))t.addValue(s,St(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,St(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ie={current:null},bn={current:!1},al=typeof window<"u";function Xi(){if(bn.current=!0,!!al)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ie.current=t.matches;t.addEventListener("change",e),e()}else ie.current=!1}const Qn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let oe={};function Yi(t){oe=t}function ll(){return oe}class ul{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=dn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=N.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,M.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=fe(n),this.isVariantNode=_i(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];c[d]!==void 0&&j(p)&&p.set(c[d])}}mount(e){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=e,ol.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((i,r)=>this.bindToMotionValue(r,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(bn.current||Xi(),this.shouldReduceMotion=ie.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),at(this.notifyUpdate),at(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.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){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Di.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:u}=n.accelerate,h=new Ci({element:this.current,name:e,keyframes:a,times:l,ease:c,duration:W(u)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=At.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&M.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&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 oe){const n=oe[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):B()}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<Qn.length;s++){const i=Qn[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=rl(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=St(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"&&(_s(s)||Ys(s))?s=parseFloat(s):!il(s)&&_.test(n)&&(s=Ui(e,n)),this.setBaseTarget(e,j(s)?s.get():s)),j(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var r;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=gn(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!j(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 sn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){xn.render(this.render)}}class qi extends ul{constructor(){super(...arguments),this.KeyframeResolver=ja}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;j(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class lt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Zi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function cl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function hl(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 we(t){return t===void 0||t===1}function _e({scale:t,scaleX:e,scaleY:n}){return!we(t)||!we(e)||!we(n)}function ht(t){return _e(t)||Ji(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ji(t){return ts(t.x)||ts(t.y)}function ts(t){return t&&t!=="0%"}function re(t,e,n){const s=t-n,i=e*s;return n+i}function es(t,e,n,s,i){return i!==void 0&&(t=re(t,i,s)),re(t,n,s)+e}function Xe(t,e=0,n=1,s,i){t.min=es(t.min,e,n,s,i),t.max=es(t.max,e,n,s,i)}function Qi(t,{x:e,y:n}){Xe(t.x,e.translate,e.scale,e.originPoint),Xe(t.y,n.translate,n.scale,n.originPoint)}const ns=.999999999999,ss=1.0000000000001;function fl(t,e,n,s=!1){var a;const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let l=0;l<i;l++){r=n[l],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(Z(t.x,-r.scroll.offset.x),Z(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Qi(t,o)),s&&ht(r.latestValues)&&qt(t,r.latestValues,(a=r.layout)==null?void 0:a.layoutBox))}e.x<ss&&e.x>ns&&(e.x=1),e.y<ss&&e.y>ns&&(e.y=1)}function Z(t,e){t.min+=e,t.max+=e}function is(t,e,n,s,i=.5){const r=D(t.min,t.max,i);Xe(t,e,n,r,s)}function os(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function qt(t,e,n){const s=n??t;is(t.x,os(e.x,s.x),e.scaleX,e.scale,e.originX),is(t.y,os(e.y,s.y),e.scaleY,e.scale,e.originY)}function to(t,e){return Zi(hl(t.getBoundingClientRect(),e))}function dl(t,e,n){const s=to(t,n),{scroll:i}=e;return i&&(Z(s.x,i.offset.x),Z(s.y,i.offset.y)),s}const pl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ml=bt.length;function gl(t,e,n){let s="",i=!0;for(let r=0;r<ml;r++){const o=bt[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const c=parseFloat(a);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=Ki(a,vn[o]);if(!l){i=!1;const u=pl[o]||o;s+=`${u}(${c}) `}n&&(e[o]=c)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function An(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const c=e[l];if(At.has(l)){o=!0;continue}else if(ci(l)){i[l]=c;continue}else{const u=Ki(c,vn[l]);l.startsWith("origin")?(a=!0,r[l]=u):s[l]=u}}if(e.transform||(o||n?s.transform=gl(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;s.transformOrigin=`${l} ${c} ${u}`}}function eo(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i==null||i.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function rs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Vt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(S.test(t))t=parseFloat(t);else return t;const n=rs(t,e.target.x),s=rs(t,e.target.y);return`${n}% ${s}%`}},yl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=_.parse(t);if(i.length>5)return s;const r=_.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const c=D(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),r(i)}},Ye={borderRadius:{...Vt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vt,borderTopRightRadius:Vt,borderBottomLeftRadius:Vt,borderBottomRightRadius:Vt,boxShadow:yl};function no(t,{layout:e,layoutId:n}){return At.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ye[t]||t==="opacity")}function Vn(t,e,n){var o;const s=t.style,i=e==null?void 0:e.style,r={};if(!s)return r;for(const a in s)(j(s[a])||i&&j(i[a])||no(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=s[a]);return r}function vl(t){return window.getComputedStyle(t)}class xl extends qi{constructor(){super(...arguments),this.type="html",this.renderInstance=eo}readValueFromInstance(e,n){var s;if(At.has(n))return(s=this.projection)!=null&&s.isProjecting?Ie(n):Ur(e,n);{const i=vl(e),r=(ci(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return to(e,n)}build(e,n,s){An(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Vn(e,n,s)}}const Tl={offset:"stroke-dashoffset",array:"stroke-dasharray"},wl={offset:"strokeDashoffset",array:"strokeDasharray"};function Sl(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Tl:wl;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Pl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function so(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(An(t,a,c),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete h.transformBox);for(const d of Pl)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Sl(h,i,r,o,!1)}const io=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"]),oo=t=>typeof t=="string"&&t.toLowerCase()==="svg";function bl(t,e,n,s){eo(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(io.has(i)?i:yn(i),e.attrs[i])}function ro(t,e,n){const s=Vn(t,e,n);for(const i in t)if(j(t[i])||j(e[i])){const r=bt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Al extends qi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=B}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(At.has(n)){const s=Ni(n);return s&&s.default||0}return n=io.has(n)?n:yn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return ro(e,n,s)}build(e,n,s){so(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){bl(e,n,s,i)}mount(e){this.isSVGTag=oo(e.tagName),super.mount(e)}}const Vl=Pn.length;function ao(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?ao(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Vl;n++){const s=Pn[n],i=t.props[s];(Bt(i)||i===!1)&&(e[s]=i)}return e}function lo(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 Cl=[...Sn].reverse(),Ml=Sn.length;function Dl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Ca(t,n,s)))}function El(t){let e=Dl(t),n=as(),s=!0,i=!1;const r=c=>(u,h)=>{var d;const f=mt(t,h,c==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:g,...m}=f;u={...u,...m,...g}}return u};function o(c){e=c(t)}function a(c){const{props:u}=t,h=ao(t.parent)||{},f=[],d=new Set;let p={},g=1/0;for(let y=0;y<Ml;y++){const x=Cl[y],v=n[x],w=u[x]!==void 0?u[x]:h[x],P=Bt(w),C=x===c?v.isActive:null;C===!1&&(g=y);let R=w===h[x]&&w!==u[x]&&P;if(R&&(s||i)&&t.manuallyAnimateOnMount&&(R=!1),v.protectedKeys={...p},!v.isActive&&C===null||!w&&!v.prevProp||he(w)||typeof w=="boolean")continue;if(x==="exit"&&v.isActive&&C!==!0){v.prevResolvedValues&&(p={...p,...v.prevResolvedValues});continue}const A=Rl(v.prevProp,w);let V=A||x===c&&v.isActive&&!R&&P||y>g&&P,b=!1;const E=Array.isArray(w)?w:[w];let F=E.reduce(r(x),{});C===!1&&(F={});const{prevResolvedValues:tt={}}=v,X={...tt,...F},et=I=>{V=!0,d.has(I)&&(b=!0,d.delete(I)),v.needsAnimating[I]=!0;const K=t.getValue(I);K&&(K.liveStyle=!1)};for(const I in X){const K=F[I],ut=tt[I];if(p.hasOwnProperty(I))continue;let gt=!1;Ke(K)&&Ke(ut)?gt=!lo(K,ut):gt=K!==ut,gt?K!=null?et(I):d.add(I):K!==void 0&&d.has(I)?et(I):v.protectedKeys[I]=!0}v.prevProp=w,v.prevResolvedValues=F,v.isActive&&(p={...p,...F}),(s||i)&&t.blockInitialAnimation&&(V=!1);const Y=R&&A;V&&(!Y||b)&&f.push(...E.map(I=>{const K={type:x};if(typeof I=="string"&&(s||i)&&!Y&&t.manuallyAnimateOnMount&&t.parent){const{parent:ut}=t,gt=mt(ut,I);if(ut.enteringChildren&&gt){const{delayChildren:ko}=gt.transition||{};K.delay=Ei(ut.enteringChildren,t,ko)}}return{animation:I,options:K}}))}if(d.size){const y={};if(typeof u.initial!="boolean"){const x=mt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(y.transition=x.transition)}d.forEach(x=>{const v=t.getBaseTarget(x),w=t.getValue(x);w&&(w.liveStyle=!0),y[x]=v??null}),f.push({animation:y})}let m=!!f.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,i=!1,m?e(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(d=>{var p;return(p=d.animationState)==null?void 0:p.setActive(c,u)}),n[c].isActive=u;const h=a(c);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=as(),i=!0}}}function Rl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!lo(e,t):!1}function ct(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function as(){return{animate:ct(!0),whileInView:ct(),whileHover:ct(),whileTap:ct(),whileDrag:ct(),whileFocus:ct(),exit:ct()}}function qe(t,e){t.min=e.min,t.max=e.max}function G(t,e){qe(t.x,e.x),qe(t.y,e.y)}function ls(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const uo=1e-4,Ll=1-uo,kl=1+uo,co=.01,Bl=0-co,Fl=0+co;function U(t){return t.max-t.min}function Il(t,e,n){return Math.abs(t-e)<=n}function us(t,e,n,s=.5){t.origin=s,t.originPoint=D(e.min,e.max,t.origin),t.scale=U(n)/U(e),t.translate=D(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Ll&&t.scale<=kl||isNaN(t.scale))&&(t.scale=1),(t.translate>=Bl&&t.translate<=Fl||isNaN(t.translate))&&(t.translate=0)}function Et(t,e,n,s){us(t.x,e.x,n.x,s?s.originX:void 0),us(t.y,e.y,n.y,s?s.originY:void 0)}function cs(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+U(e)}function Ol(t,e,n,s){cs(t.x,e.x,n.x,s==null?void 0:s.x),cs(t.y,e.y,n.y,s==null?void 0:s.y)}function hs(t,e,n,s=0){const i=s?D(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+U(e)}function ae(t,e,n,s){hs(t.x,e.x,n.x,s==null?void 0:s.x),hs(t.y,e.y,n.y,s==null?void 0:s.y)}function fs(t,e,n,s,i){return t-=e,t=re(t,1/n,s),i!==void 0&&(t=re(t,1/i,s)),t}function jl(t,e=0,n=1,s=.5,i,r=t,o=t){if(J.test(e)&&(e=parseFloat(e),e=D(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=D(r.min,r.max,s);t===r&&(a-=e),t.min=fs(t.min,e,n,a,i),t.max=fs(t.max,e,n,a,i)}function ds(t,e,[n,s,i],r,o){jl(t,e[n],e[s],e[i],e.scale,r,o)}const Nl=["x","scaleX","originX"],Ul=["y","scaleY","originY"];function ps(t,e,n,s){ds(t.x,e,Nl,n?n.x:void 0,s?s.x:void 0),ds(t.y,e,Ul,n?n.y:void 0,s?s.y:void 0)}function ms(t){return t.translate===0&&t.scale===1}function ho(t){return ms(t.x)&&ms(t.y)}function gs(t,e){return t.min===e.min&&t.max===e.max}function Wl(t,e){return gs(t.x,e.x)&&gs(t.y,e.y)}function ys(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function fo(t,e){return ys(t.x,e.x)&&ys(t.y,e.y)}function vs(t){return U(t.x)/U(t.y)}function xs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function q(t){return[t("x"),t("y")]}function Kl(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;c&&(s=`perspective(${c}px) ${s}`),u&&(s+=`rotate(${u}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const po=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],$l=po.length,Ts=t=>typeof t=="string"?parseFloat(t):t,ws=t=>typeof t=="number"||S.test(t);function zl(t,e,n,s,i,r){i?(t.opacity=D(0,n.opacity??1,Gl(s)),t.opacityExit=D(e.opacity??1,0,Hl(s))):r&&(t.opacity=D(e.opacity??1,n.opacity??1,s));for(let o=0;o<$l;o++){const a=po[o];let l=Ss(e,a),c=Ss(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||ws(l)===ws(c)?(t[a]=Math.max(D(Ts(l),Ts(c),s),0),(J.test(c)||J.test(l))&&(t[a]+="%")):t[a]=c}(e.rotate||n.rotate)&&(t.rotate=D(e.rotate||0,n.rotate||0,s))}function Ss(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Gl=mo(0,.5,ii),Hl=mo(.5,.95,z);function mo(t,e,n){return s=>s<t?0:s>e?1:n(Lt(t,e,s))}function _l(t,e,n){const s=j(t)?t:St(t);return s.start(mn("",s,e,n)),s.animation}function Ft(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Xl=(t,e)=>t.depth-e.depth;class Yl{constructor(){this.children=[],this.isDirty=!1}add(e){en(this.children,e),this.isDirty=!0}remove(e){Qt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Xl),this.isDirty=!1,this.children.forEach(e)}}function ql(t,e){const n=N.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(at(s),t(r-e))};return M.setup(s,!0),()=>at(s)}function Zt(t){return j(t)?t.get():t}class Zl{constructor(){this.members=[]}add(e){en(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(Qt(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Qt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let s=this.members.indexOf(e)-1;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1&&((n=i.instance)==null?void 0:n.isConnected)!==!1)return this.promote(i),!0}return!1}promote(e,n){var i;const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:r}=s.options,{layoutDependency:o}=e.options;(r===void 0||r!==o)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),(i=e.root)!=null&&i.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,i,r,o;(s=(n=e.options).onExitComplete)==null||s.call(n),(o=(i=e.resumingFrom)==null?void 0:(r=i.options).onExitComplete)==null||o.call(r)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Se=["","X","Y","Z"],Jl=1e3;let Ql=0;function Pe(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function go(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Fi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",M,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&go(s)}function yo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Ql++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(nu),this.nodes.forEach(lu),this.nodes.forEach(uu),this.nodes.forEach(su)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Yl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new sn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=wn(o)&&!nl(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let u,h=0;const f=()=>this.root.updateBlockedByResize=!1;M.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,u&&u(),u=ql(f,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(As)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||pu,{onLayoutAnimationStart:g,onLayoutAnimationComplete:m}=c.getProps(),y=!this.targetLayout||!fo(this.targetLayout,d),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...pn(p,"layout"),onPlay:g,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(u,x)}else h||As(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),at(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(cu),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&go(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(ou),this.nodes.forEach(Ps);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(bs);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ru),this.nodes.forEach(au),this.nodes.forEach(tu),this.nodes.forEach(eu)):this.nodes.forEach(bs),this.clearAllSnapshots();const a=N.now();O.delta=Q(0,1e3/60,a-O.timestamp),O.timestamp=a,O.isProcessing=!0,pe.update.process(O),pe.preRender.process(O),pe.render.process(O),O.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,xn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(iu),this.sharedNodes.forEach(hu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,M.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){M.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!U(this.snapshot.measuredBox.x)&&!U(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=B()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!ho(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||ht(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),mu(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return B();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(gu))){const{scroll:u}=this.root;u&&(Z(a.x,u.offset.x),Z(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=B();if(G(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:f}=u;u!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&G(a,o),Z(a.x,h.offset.x),Z(a.y,h.offset.y))}return a}applyTransform(o,a=!1,l){var u,h;const c=l||B();G(c,o);for(let f=0;f<this.path.length;f++){const d=this.path[f];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(Z(c.x,-d.scroll.offset.x),Z(c.y,-d.scroll.offset.y)),ht(d.latestValues)&&qt(c,d.latestValues,(u=d.layout)==null?void 0:u.layoutBox)}return ht(this.latestValues)&&qt(c,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),c}removeTransform(o){var l;const a=B();G(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ht(u.latestValues))continue;let h;u.instance&&(_e(u.latestValues)&&u.updateSnapshot(),h=B(),G(h,u.measurePageBox())),ps(a,u.latestValues,(l=u.snapshot)==null?void 0:l.layoutBox,h)}return ht(this.latestValues)&&ps(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==O.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=O.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=B(),this.targetWithTransforms=B()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ol(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):G(this.target,this.layout.layoutBox),Qi(this.target,this.targetDelta)):G(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||_e(this.parent.latestValues)||Ji(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=B(),this.relativeTargetOrigin=B(),ae(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),G(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===O.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;G(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;fl(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=B());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ls(this.prevProjectionDelta.x,this.projectionDelta.x),ls(this.prevProjectionDelta.y,this.projectionDelta.y)),Et(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!xs(this.projectionDelta.x,this.prevProjectionDelta.x)||!xs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Tt(),this.projectionDelta=Tt(),this.projectionDeltaWithTransform=Tt()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},h=Tt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=B(),d=l?l.source:void 0,p=this.layout?this.layout.source:void 0,g=d!==p,m=this.getStack(),y=!m||m.members.length<=1,x=!!(g&&!y&&this.options.crossfade===!0&&!this.path.some(du));this.animationProgress=0;let v;this.mixTargetDelta=w=>{const P=w/1e3;Vs(h.x,o.x,P),Vs(h.y,o.y,P),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ae(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),fu(this.relativeTarget,this.relativeTargetOrigin,f,P),v&&Wl(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=B()),G(v,this.relativeTarget)),g&&(this.animationValues=u,zl(u,c,this.latestValues,P,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(at(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=M.update(()=>{Jt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=St(0)),this.motionValue.jump(0,!1),this.currentAnimation=_l(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),o.onUpdate&&o.onUpdate(u)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Jl),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&vo(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||B();const h=U(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=U(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}G(a,l),qt(a,u),Et(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Zl),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Pe("z",o,c,this.animationValues);for(let u=0;u<Se.length;u++)Pe(`rotate${Se[u]}`,o,c,this.animationValues),Pe(`skew${Se[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Zt(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Zt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ht(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let h=Kl(this.projectionDeltaWithTransform,this.treeScale,u);l&&(h=l(u,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,c.animationValues?o.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:o.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in Ye){if(u[p]===void 0)continue;const{correct:g,applyTo:m,isCSSVariable:y}=Ye[p],x=h==="none"?u[p]:g(u[p],c);if(m){const v=m.length;for(let w=0;w<v;w++)o[m[w]]=x}else y?this.options.visualElement.renderState.vars[p]=x:o[p]=x}this.options.layoutId&&(o.pointerEvents=c===this?Zt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Ps),this.root.sharedNodes.clear()}}}function tu(t){t.updateLayout()}function eu(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;if(r==="size")q(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=U(f);f.min=s[h].min,f.max=f.min+d});else if(r==="x"||r==="y"){const h=r==="x"?"y":"x";qe(o?e.measuredBox[h]:e.layoutBox[h],s[h])}else vo(r,e.layoutBox,s)&&q(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],d=U(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=Tt();Et(a,s,e.layoutBox);const l=Tt();o?Et(l,t.applyTransform(i,!0),e.measuredBox):Et(l,s,e.layoutBox);const c=!ho(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const p=t.options.layoutAnchor||void 0,g=B();ae(g,e.layoutBox,f.layoutBox,p);const m=B();ae(m,s,d.layoutBox,p),fo(g,m)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=g,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function nu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function su(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function iu(t){t.clearSnapshot()}function Ps(t){t.clearMeasurements()}function ou(t){t.isLayoutDirty=!0,t.updateLayout()}function bs(t){t.isLayoutDirty=!1}function ru(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function au(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function As(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function lu(t){t.resolveTargetDelta()}function uu(t){t.calcProjection()}function cu(t){t.resetSkewAndRotation()}function hu(t){t.removeLeadSnapshot()}function Vs(t,e,n){t.translate=D(e.translate,0,n),t.scale=D(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Cs(t,e,n,s){t.min=D(e.min,n.min,s),t.max=D(e.max,n.max,s)}function fu(t,e,n,s){Cs(t.x,e.x,n.x,s),Cs(t.y,e.y,n.y,s)}function du(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const pu={duration:.45,ease:[.4,0,.1,1]},Ms=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ds=Ms("applewebkit/")&&!Ms("chrome/")?Math.round:z;function Es(t){t.min=Ds(t.min),t.max=Ds(t.max)}function mu(t){Es(t.x),Es(t.y)}function vo(t,e,n){return t==="position"||t==="preserve-aspect"&&!Il(vs(e),vs(n),.2)}function gu(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const yu=yo({attachResizeListener:(t,e)=>Ft(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),be={current:void 0},xo=yo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!be.current){const t=new yu({});t.mount(window),t.setOptions({layoutScroll:!0}),be.current=t}return be.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Cn=T.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Rs(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function vu(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Rs(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Rs(t[i],null)}}}}function xu(...t){return T.useCallback(vu(...t),t)}class Tu extends T.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Ht(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=Ht(s)&&s.offsetWidth||0,r=Ht(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function wu({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){var f;const o=T.useId(),a=T.useRef(null),l=T.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=T.useContext(Cn),u=((f=t.props)==null?void 0:f.ref)??(t==null?void 0:t.ref),h=xu(a,u);return T.useInsertionEffect(()=>{const{width:d,height:p,top:g,left:m,right:y,bottom:x}=l.current;if(e||r===!1||!a.current||!d||!p)return;const v=n==="left"?`left: ${m}`:`right: ${y}`,w=s==="bottom"?`bottom: ${x}`:`top: ${g}`;a.current.dataset.motionPopId=o;const P=document.createElement("style");c&&(P.nonce=c);const C=i??document.head;return C.appendChild(P),P.sheet&&P.sheet.insertRule(`
2
+ [data-motion-pop-id="${o}"] {
3
+ position: absolute !important;
4
+ width: ${d}px !important;
5
+ height: ${p}px !important;
6
+ ${v}px !important;
7
+ ${w}px !important;
8
+ }
9
+ `),()=>{var R;(R=a.current)==null||R.removeAttribute("data-motion-pop-id"),C.contains(P)&&C.removeChild(P)}},[e]),nt.jsx(Tu,{isPresent:e,childRef:a,sizeRef:l,pop:r,children:r===!1?t:T.cloneElement(t,{ref:h})})}const Su=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:l,root:c})=>{const u=tn(Pu),h=T.useId();let f=!0,d=T.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{u.set(p,!0);for(const g of u.values())if(!g)return;s&&s()},register:p=>(u.set(p,!1),()=>u.delete(p))}),[n,u,s]);return r&&f&&(d={...d}),T.useMemo(()=>{u.forEach((p,g)=>u.set(g,!1))},[n]),T.useEffect(()=>{!n&&!u.size&&s&&s()},[n]),t=nt.jsx(wu,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:t}),nt.jsx(ue.Provider,{value:d,children:t})};function Pu(){return new Map}function To(t=!0){const e=T.useContext(ue);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=T.useId();T.useEffect(()=>{if(t)return i(r)},[t]);const o=T.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Kt=t=>t.key||"";function Ls(t){const e=[];return T.Children.forEach(t,n=>{T.isValidElement(n)&&e.push(n)}),e}const Bc=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[u,h]=To(o),f=T.useMemo(()=>Ls(t),[t]),d=o&&!u?[]:f.map(Kt),p=T.useRef(!0),g=T.useRef(f),m=tn(()=>new Map),y=T.useRef(new Set),[x,v]=T.useState(f),[w,P]=T.useState(f);Hs(()=>{p.current=!1,g.current=f;for(let A=0;A<w.length;A++){const V=Kt(w[A]);d.includes(V)?(m.delete(V),y.current.delete(V)):m.get(V)!==!0&&m.set(V,!1)}},[w,d.length,d.join("-")]);const C=[];if(f!==x){let A=[...f];for(let V=0;V<w.length;V++){const b=w[V],E=Kt(b);d.includes(E)||(A.splice(V,0,b),C.push(b))}return r==="wait"&&C.length&&(A=C),P(Ls(A)),v(f),null}const{forceRender:R}=T.useContext(Qe);return nt.jsx(nt.Fragment,{children:w.map(A=>{const V=Kt(A),b=o&&!u?!1:f===w||d.includes(V),E=()=>{if(y.current.has(V))return;if(m.has(V))y.current.add(V),m.set(V,!0);else return;let F=!0;m.forEach(tt=>{tt||(F=!1)}),F&&(R==null||R(),P(g.current),o&&(h==null||h()),s&&s())};return nt.jsx(Su,{isPresent:b,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:c,onExitComplete:b?void 0:E,anchorX:a,anchorY:l,children:A},V)})})},wo=T.createContext({strict:!1}),ks={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Bs=!1;function bu(){if(Bs)return;const t={};for(const e in ks)t[e]={isEnabled:n=>ks[e].some(s=>!!n[s])};Yi(t),Bs=!0}function So(){return bu(),ll()}function Au(t){const e=So();for(const n in t)e[n]={...e[n],...t[n]};Yi(e)}const Vu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function le(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Vu.has(t)}let Po=t=>!le(t);function Cu(t){typeof t=="function"&&(Po=e=>e.startsWith("on")?!le(e):t(e))}try{Cu(require("@emotion/is-prop-valid").default)}catch{}function Mu(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||j(t[i])||(Po(i)||n===!0&&le(i)||!e&&!le(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const de=T.createContext({});function Du(t,e){if(fe(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Bt(n)?n:void 0,animate:Bt(s)?s:void 0}}return t.inherit!==!1?e:{}}function Eu(t){const{initial:e,animate:n}=Du(t,T.useContext(de));return T.useMemo(()=>({initial:e,animate:n}),[Fs(e),Fs(n)])}function Fs(t){return Array.isArray(t)?t.join(" "):t}const Mn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function bo(t,e,n){for(const s in e)!j(e[s])&&!no(s,n)&&(t[s]=e[s])}function Ru({transformTemplate:t},e){return T.useMemo(()=>{const n=Mn();return An(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Lu(t,e){const n=t.style||{},s={};return bo(s,n,t),Object.assign(s,Ru(t,e)),s}function ku(t,e){const n={},s=Lu(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Ao=()=>({...Mn(),attrs:{}});function Bu(t,e,n,s){const i=T.useMemo(()=>{const r=Ao();return so(r,e,oo(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};bo(r,t.style,t),i.style={...r,...i.style}}return i}const Fu=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Dn(t){return typeof t!="string"||t.includes("-")?!1:!!(Fu.indexOf(t)>-1||/[A-Z]/u.test(t))}function Iu(t,e,n,{latestValues:s},i,r=!1,o){const l=(o??Dn(t)?Bu:ku)(e,s,i,t),c=Mu(e,typeof t=="string",r),u=t!==T.Fragment?{...c,...l,ref:n}:{},{children:h}=e,f=T.useMemo(()=>j(h)?h.get():h,[h]);return T.createElement(t,{...u,children:f})}function Ou({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:ju(n,s,i,t),renderState:e()}}function ju(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=Zt(r[f]);let{initial:o,animate:a}=t;const l=fe(t),c=_i(t);e&&c&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const h=u?a:o;if(h&&typeof h!="boolean"&&!he(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=gn(t,f[d]);if(p){const{transitionEnd:g,transition:m,...y}=p;for(const x in y){let v=y[x];if(Array.isArray(v)){const w=u?v.length-1:0;v=v[w]}v!==null&&(i[x]=v)}for(const x in g)i[x]=g[x]}}}return i}const Vo=t=>(e,n)=>{const s=T.useContext(de),i=T.useContext(ue),r=()=>Ou(t,e,s,i);return n?r():tn(r)},Nu=Vo({scrapeMotionValuesFromProps:Vn,createRenderState:Mn}),Uu=Vo({scrapeMotionValuesFromProps:ro,createRenderState:Ao}),Wu=Symbol.for("motionComponentSymbol");function Ku(t,e,n){const s=T.useRef(n);T.useInsertionEffect(()=>{s.current=n});const i=T.useRef(null);return T.useCallback(r=>{var a;r&&((a=t.onMount)==null||a.call(t,r));const o=s.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const Co=T.createContext({});function yt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function $u(t,e,n,s,i,r){var v,w;const{visualElement:o}=T.useContext(de),a=T.useContext(wo),l=T.useContext(ue),c=T.useContext(Cn),u=c.reducedMotion,h=c.skipAnimations,f=T.useRef(null),d=T.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,g=T.useContext(Co);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&zu(f.current,n,i,g);const m=T.useRef(!1);T.useInsertionEffect(()=>{p&&m.current&&p.update(n,l)});const y=n[Bi],x=T.useRef(!!y&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,y))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,y)));return Hs(()=>{d.current=!0,p&&(m.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),x.current&&p.animationState&&p.animationState.animateChanges())}),T.useEffect(()=>{p&&(!x.current&&p.animationState&&p.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,y)}),x.current=!1),p.enteringChildren=void 0)}),p}function zu(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Mo(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&yt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}function Mo(t){if(t)return t.options.allowProjection!==!1?t.projection:Mo(t.parent)}function Ae(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Au(s);const r=n?n==="svg":Dn(t),o=r?Uu:Nu;function a(c,u){let h;const f={...T.useContext(Cn),...c,layoutId:Gu(c)},{isStatic:d}=f,p=Eu(c),g=o(c,d);if(!d&&typeof window<"u"){Hu();const m=_u(f);h=m.MeasureLayout,p.visualElement=$u(t,g,f,i,m.ProjectionNode,r)}return nt.jsxs(de.Provider,{value:p,children:[h&&p.visualElement?nt.jsx(h,{visualElement:p.visualElement,...f}):null,Iu(t,c,Ku(g,p.visualElement,u),g,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=T.forwardRef(a);return l[Wu]=t,l}function Gu({layoutId:t}){const e=T.useContext(Qe).id;return e&&t!==void 0?e+"-"+t:t}function Hu(t,e){T.useContext(wo).strict}function _u(t){const e=So(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(t)||s!=null&&s.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Xu(t,e){if(typeof Proxy>"u")return Ae;const n=new Map,s=(r,o)=>Ae(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,Ae(o,void 0,t,e)),n.get(o))})}const Yu=(t,e)=>e.isSVG??Dn(t)?new Al(e):new xl(e,{allowProjection:t!==T.Fragment});class qu extends lt{constructor(e){super(e),e.animationState||(e.animationState=El(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();he(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(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let Zu=0;class Ju extends lt{constructor(){super(...arguments),this.id=Zu++,this.isExitComplete=!1}update(){var r;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;if(e&&s===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"){const l=mt(this.node,o,a);if(l){const{transition:c,transitionEnd:u,...h}=l;for(const f in h)(r=this.node.getValue(f))==null||r.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const Qu={animation:{Feature:qu},exit:{Feature:Ju}};function Nt(t){return{point:{x:t.pageX,y:t.pageY}}}const tc=t=>e=>Tn(e)&&t(e,Nt(e));function Rt(t,e,n,s){return Ft(t,e,tc(n),s)}const Do=({current:t})=>t?t.ownerDocument.defaultView:null,Is=(t,e)=>Math.abs(t-e);function ec(t,e){const n=Is(t.x,e.x),s=Is(t.y,e.y);return Math.sqrt(n**2+s**2)}const Os=new Set(["auto","scroll"]);class Eo{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=$t(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Ve(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=ec(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:m}=d,{timestamp:y}=O;this.history.push({...m,timestamp:y});const{onStart:x,onMove:v}=this.handlers;p||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=$t(p,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:g,onSessionEnd:m,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ve(d.type==="pointercancel"?this.lastMoveEventInfo:$t(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,x),m&&m(d,x)},!Tn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const l=Nt(e),c=$t(l,this.transformPagePoint),{point:u}=c,{timestamp:h}=O;this.history=[{...u,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Ve(c,this.history)),this.removeListeners=It(Rt(this.contextWindow,"pointermove",this.handlePointerMove),Rt(this.contextWindow,"pointerup",this.handlePointerUp),Rt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Os.has(s.overflowX)||Os.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),M.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),at(this.updatePoint)}}function $t(t,e){return e?{point:e(t.point)}:t}function js(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ve({point:t},e){return{point:t,delta:js(t,Ro(e)),offset:js(t,nc(e)),velocity:sc(e,.1)}}function nc(t){return t[0]}function Ro(t){return t[t.length-1]}function sc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Ro(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>W(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>W(e)*2&&(s=t[1]);const r=$(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ic(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?D(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?D(n,t,s.max):Math.min(t,n)),t}function Ns(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function oc(t,{top:e,left:n,bottom:s,right:i}){return{x:Ns(t.x,n,i),y:Ns(t.y,e,s)}}function Us(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function rc(t,e){return{x:Us(t.x,e.x),y:Us(t.y,e.y)}}function ac(t,e){let n=.5;const s=U(t),i=U(e);return i>s?n=Lt(e.min,e.max-s,t.min):s>i&&(n=Lt(t.min,t.max-i,e.min)),Q(0,1,n)}function lc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Ze=.35;function uc(t=Ze){return t===!1?t=0:t===!0&&(t=Ze),{x:Ws(t,"left","right"),y:Ws(t,"top","bottom")}}function Ws(t,e,n){return{min:Ks(t,e),max:Ks(t,n)}}function Ks(t,e){return typeof t=="number"?t:t[e]||0}const cc=new WeakMap;class hc{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=B(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(Nt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:g}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Na(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),q(y=>{let x=this.getAxisMotionValue(y).get()||0;if(J.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[y];w&&(x=U(w)*(parseFloat(x)/100))}}this.originPoint[y]=x}),g&&M.update(()=>g(h,f),!1,!0),$e(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:g,onDrag:m}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=dc(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),m&&M.update(()=>m(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new Eo(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:s,contextWindow:Do(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&M.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!zt(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=ic(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,i=this.constraints;e&&yt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=oc(s.layoutBox,e):this.constraints=!1,this.elastic=uc(n),i!==this.constraints&&!yt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&q(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=lc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!yt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=dl(s,i.root,this.visualElement.getTransformPagePoint());let o=rc(i.layout.layoutBox,r);if(n){const a=n(cl(o));this.hasMutatedConstraints=!!a,a&&(o=Zi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=q(u=>{if(!zt(u,n,this.currentDirection))return;let h=l&&l[u]||{};(o===!0||o===u)&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return $e(this.visualElement,e),s.start(mn(e,s,0,n,this.visualElement,!1))}stopAnimation(){q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){q(n=>{const{drag:s}=this.getProps();if(!zt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],l=r.get()||0;r.set(e[n]-D(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!yt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};q(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=ac({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),q(o=>{if(!zt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(D(l,c,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;cc.set(this.visualElement,this);const e=this.visualElement.current,n=Rt(e,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps(),f=c.target,d=f!==e&&Ga(f);u&&h&&!d&&this.start(c)});let s;const i=()=>{const{dragConstraints:c}=this.getProps();yt(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),s||(s=fc(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),M.read(i);const a=Ft(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(q(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),l&&l(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Ze,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function $s(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function fc(t,e,n){const s=qn(t,$s(n)),i=qn(e,$s(n));return()=>{s(),i()}}function zt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function dc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class pc extends lt{constructor(e){super(e),this.removeGroupControls=z,this.removeListeners=z,this.controls=new hc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||z}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ce=t=>(e,n)=>{t&&M.update(()=>t(e,n),!1,!0)};class mc extends lt{constructor(){super(...arguments),this.removePointerDownListener=z}onPointerDown(e){this.session=new Eo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Do(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ce(e),onStart:Ce(n),onMove:Ce(s),onEnd:(r,o)=>{delete this.session,i&&M.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Rt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Me=!1;class gc extends T.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),Me&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Me=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||M.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),xn.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Me=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Lo(t){const[e,n]=To(),s=T.useContext(Qe);return nt.jsx(gc,{...t,layoutGroup:s,switchLayoutGroup:T.useContext(Co),isPresent:e,safeToRemove:n})}const yc={pan:{Feature:mc},drag:{Feature:pc,ProjectionNode:xo,MeasureLayout:Lo}};function zs(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&&M.postRender(()=>r(e,Nt(e)))}class vc extends lt{mount(){const{current:e}=this.node;e&&(this.unmount=Wa(e,(n,s)=>(zs(this.node,s,"Start"),i=>zs(this.node,i,"End"))))}unmount(){}}class xc extends lt{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=It(Ft(this.node.current,"focus",()=>this.onFocus()),Ft(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Gs(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&&M.postRender(()=>r(e,Nt(e)))}class Tc extends lt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=_a(e,(i,r)=>(Gs(this.node,r,"Start"),(o,{success:a})=>Gs(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const Je=new WeakMap,De=new WeakMap,wc=t=>{const e=Je.get(t.target);e&&e(t)},Sc=t=>{t.forEach(wc)};function Pc({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(Sc,{root:t,...e})),s[i]}function bc(t,e,n){const s=Pc(e);return Je.set(t,n),s.observe(t),()=>{Je.delete(t),s.unobserve(t)}}const Ac={some:0,all:1};class Vc extends lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Ac[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),d=u?h:f;d&&d(c)};this.stopObserver=bc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Cc(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Cc({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Mc={inView:{Feature:Vc},tap:{Feature:Tc},focus:{Feature:xc},hover:{Feature:vc}},Dc={layout:{ProjectionNode:xo,MeasureLayout:Lo}},Ec={...Qu,...Mc,...yc,...Dc},Fc=Xu(Ec,Yu);function Ic(){!bn.current&&Xi();const[t]=T.useState(ie.current);return t}export{Bc as A,Fc as m,Ic as u};
10
+ //# sourceMappingURL=motion-STUd1O46.js.map