1import{c as he,r as v,j as h,R as Bn,U as On,V as Un,m as Zr,w as Qr,s as Cs,C as Kt,L as $n,aa as Jr,a as Hi,o as At,S as ta,q as Gi,X as qi,p as Xi}from"./index-B9-pVUL3.js";import{l as ea,s as na,e as sa}from"./teams.functions-05iKAVN_.js";import{T as Wn,B as Yi}from"./trophy-sacr6eAt.js";import{V as ia}from"./volume-2-f2QznSEQ.js";import{G as Zi}from"./graduation-cap-CK-bex0n.js";import{U as ee}from"./users-DbS8noDu.js";import{B as oa}from"./brain-By3Jq4Jr.js";import{U as ra}from"./user-CPUH86Fe.js";import{R as zn}from"./refresh-cw-DVb9PFRm.js";const aa=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],la=he("bot",aa);const ca=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],ua=he("flame",ca);const ha=[["polyline",{points:"14.5 17.5 3 6 3 3 6 3 17.5 14.5",key:"1hfsw2"}],["line",{x1:"13",x2:"19",y1:"19",y2:"13",key:"1vrmhu"}],["line",{x1:"16",x2:"20",y1:"16",y2:"20",key:"1bron3"}],["line",{x1:"19",x2:"21",y1:"21",y2:"19",key:"13pww6"}],["polyline",{points:"14.5 6.5 18 3 21 3 21 6 17.5 9.5",key:"hbey2j"}],["line",{x1:"5",x2:"9",y1:"14",y2:"18",key:"1hf58s"}],["line",{x1:"7",x2:"4",y1:"17",y2:"20",key:"pidxm4"}],["line",{x1:"3",x2:"5",y1:"19",y2:"21",key:"1pehsh"}]],Qi=he("swords",ha);const da=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],fa=he("volume-x",da);const ma=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Kn=he("zap",ma),Hn=v.createContext({});function Gn(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const pa=typeof window<"u",Ji=pa?v.useLayoutEffect:v.useEffect,$e=v.createContext(null);function qn(t,e){t.indexOf(e)===-1&&t.push(e)}function Ee(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Mt=(t,e,n)=>n>e?e:n<t?t:n;let Xn=()=>{};const Vt={},to=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),eo=t=>typeof t=="object"&&t!==null,no=t=>/^0[^.\s]+$/u.test(t);function so(t){let e;return()=>(e===void 0&&(e=t()),e)}const mt=t=>t,de=(...t)=>t.reduce((e,n)=>s=>n(e(s))),ae=(t,e,n)=>{const s=e-t;return s?(n-t)/s:1};class Yn{constructor(){this.subscriptions=[]}add(e){return qn(this.subscriptions,e),()=>Ee(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 ct=t=>t*1e3,dt=t=>t/1e3,io=(t,e)=>e?t*(1e3/e):0,oo=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,ga=1e-7,ya=12;function xa(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=oo(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>ga&&++a<ya);return o}function fe(t,e,n,s){if(t===e&&n===s)return mt;const i=r=>xa(r,0,1,t,n);return r=>r===0||r===1?r:oo(i(r),e,s)}const ro=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ao=t=>e=>1-t(1-e),lo=fe(.33,1.53,.69,.99),Zn=ao(lo),co=ro(Zn),uo=t=>t>=1?1:(t*=2)<1?.5*Zn(t):.5*(2-Math.pow(2,-10*(t-1))),Qn=t=>1-Math.sin(Math.acos(t)),ho=ao(Qn),fo=ro(Qn),va=fe(.42,0,1,1),ba=fe(0,0,.58,1),mo=fe(.42,0,.58,1),wa=t=>Array.isArray(t)&&typeof t[0]!="number",po=t=>Array.isArray(t)&&typeof t[0]=="number",Ta={linear:mt,easeIn:va,easeInOut:mo,easeOut:ba,circIn:Qn,circInOut:fo,circOut:ho,backIn:Zn,backInOut:co,backOut:lo,anticipate:uo},Sa=t=>typeof t=="string",As=t=>{if(po(t)){Xn(t.length===4);const[e,n,s,i]=t;return fe(e,n,s,i)}else if(Sa(t))return Ta[t];return t},ge=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ma(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 c(l){o.has(l)&&(u.schedule(l),t()),l(a)}const u={schedule:(l,d=!1,f=!1)=>{const y=f&&i?n:s;return d&&o.add(l),y.add(l),l},cancel:l=>{s.delete(l),o.delete(l)},process:l=>{if(a=l,i){r=!0;return}i=!0;const d=n;
vendor: 32,403 bytes, line 1
1n=s,s=d,n.forEach(c),n.clear(),i=!1,r&&(r=!1,u.process(l))}};return u}const Pa=40;function go(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=ge.reduce((T,P)=>(T[P]=Ma(r),T),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:d,preRender:f,render:g,postRender:y}=o,b=()=>{const T=Vt.useManualTiming,P=T?i.timestamp:performance.now();n=!1,T||(i.delta=s?1e3/60:Math.max(Math.min(P-i.timestamp,Pa),1)),i.timestamp=P,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),d.process(i),f.process(i),g.process(i),y.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(b))},x=()=>{n=!0,s=!0,i.isProcessing||t(b)};return{schedule:ge.reduce((T,P)=>{const V=o[P];return T[P]=(N,R=!1,C=!1)=>(n||x(),V.schedule(N,R,C)),T},{}),cancel:T=>{for(let P=0;P<ge.length;P++)o[ge[P]].cancel(T)},state:i,steps:o}}const{schedule:K,cancel:Et,state:it,steps:Xe}=go(typeof requestAnimationFrame<"u"?requestAnimationFrame:mt,!0);let Te;function ka(){Te=void 0}const rt={now:()=>(Te===void 0&&rt.set(it.isProcessing||Vt.useManualTiming?it.timestamp:performance.now()),Te),set:t=>{Te=t,queueMicrotask(ka)}},yo=t=>e=>typeof e=="string"&&e.startsWith(t),xo=yo("--"),Ca=yo("var(--"),Jn=t=>Ca(t)?Aa.test(t.split("/*")[0].trim()):!1,Aa=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function js(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Zt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},le={...Zt,transform:t=>Mt(0,1,t)},ye={...Zt,default:1},se=t=>Math.round(t*1e5)/1e5,ts=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ja(t){return t==null}const Va=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,es=(t,e)=>n=>!!(typeof n=="string"&&Va.test(n)&&n.startsWith(t)||e&&!ja(n)&&Object.prototype.hasOwnProperty.call(n,e)),vo=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(ts);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ea=t=>Mt(0,255,t),Ye={...Zt,transform:t=>Math.round(Ea(t))},Lt={test:es("rgb","red"),parse:vo("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ye.transform(t)+", "+Ye.transform(e)+", "+Ye.transform(n)+", "+se(le.transform(s))+")"};function Ra(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 mn={test:es("#"),parse:Ra,transform:Lt.transform},me=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ct=me("deg"),St=me("%"),A=me("px"),Da=me("vh"),_a=me("vw"),Vs={...St,parse:t=>St.parse(t)/100,transform:t=>St.transform(t*100)},$t={test:es("hsl","hue"),parse:vo("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+St.transform(se(e))+", "+St.transform(se(n))+", "+se(le.transform(s))+")"},J={test:t=>Lt.test(t)||mn.test(t)||$t.test(t),parse:t=>Lt.test(t)?Lt.parse(t):$t.test(t)?$t.parse(t):mn.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Lt.transform(t):$t.transform(t),getAnimatableNone:t=>{const e=J.parse(t);return e.alpha=0,J.transform(e)}},Na=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function La(t){return isNaN(t)&&typeof t=="string"&&(t.match(ts)?.length||0)+(t.match(Na)?.length||0)>0}const bo="number",wo="color",Ia="var",Fa="var(",Es="${}",Ba=/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 Ht(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Ba,c=>(J.test(c)?(s.color.push(r),i.push(wo),n.push(J.parse(c))):c.startsWith(Fa)?(s.var.push(r),i.push(Ia),n.push(c)):(s.number.push(r),i.push(bo),n.push(parseFloat(c))),++r,Es)).split(Es);return{values:n,split:a,indexes:s,types:i}}function Oa(t){return Ht(t).values}function To({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===bo?i+=se(s[r]):o===wo?i+=J.transform(s[r]):i+=s[r]}return i}}function Ua(t){return To(Ht(t))}const $a=t=>typeof t=="number"?0:J.test(t)?J.getAnimatableNone(t):t,Wa=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:$a(t);function za(t){const e=Ht(t);return To(e)(e.values.map((s,i)=>Wa(s,e.split[i])))}const vt={test:La,parse:Oa,createTransformer:Ua,getAnimatableNone:za};function Ze(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 Ka({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,c=2*n-a;i=Ze(c,a,t+1/3),r=Ze(c,a,t),o=Ze(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Re(t,e){return n=>n>0?e:t}const z=(t,e,n)=>t+(e-t)*n,Qe=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ha=[mn,Lt,$t],Ga=t=>Ha.find(e=>e.test(t));function Rs(t){const e=Ga(t);if(!e)return!1;let n=e.parse(t);return e===$t&&(n=Ka(n)),n}const Ds=(t,e)=>{const n=Rs(t),s=Rs(e);if(!n||!s)return Re(t,e);const i={...n};return r=>(i.red=Qe(n.red,s.red,r),i.green=Qe(n.green,s.green,r),i.blue=Qe(n.blue,s.blue,r),i.alpha=z(n.alpha,s.alpha,r),Lt.transform(i))},pn=new Set(["none","hidden"]);function qa(t,e){return pn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Xa(t,e){return n=>z(t,e,n)}function ns(t){return typeof t=="number"?Xa:typeof t=="string"?Jn(t)?Re:J.test(t)?Ds:Qa:Array.isArray(t)?So:typeof t=="object"?J.test(t)?Ds:Ya:Re}function So(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>ns(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Ya(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=ns(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Za(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 Qa=(t,e)=>{const n=vt.createTransformer(e),s=Ht(t),i=Ht(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?pn.has(t)&&!i.values.length||pn.has(e)&&!s.values.length?qa(t,e):de(So(Za(s,i),i.values),n):Re(t,e)};function Mo(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?z(t,e,n):ns(t)(t,e)}const Ja=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>K.update(e,n),stop:()=>Et(e),now:()=>it.isProcessing?it.timestamp:rt.now()}},Po=(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)})`},De=2e4;function ss(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<De;)e+=n,s=t.next(e);return e>=De?1/0:e}function tl(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ss(s),De);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:dt(i)}}const Y={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 gn(t,e){return t*Math.sqrt(1-e*e)}const el=12;function nl(t,e,n){let s=n;for(let i=1;i<el;i++)s=s-t(s)/e(s);return s}const Je=.001;function sl({duration:t=Y.duration,bounce:e=Y.bounce,velocity:n=Y.velocity,mass:s=Y.mass}){let i,r,o=1-e;o=Mt(Y.minDamping,Y.maxDamping,o),t=Mt(Y.minDuration,Y.maxDuration,dt(t)),o<1?(i=u=>{const l=u*o,d=l*t,f=l-n,g=gn(u,o),y=Math.exp(-d);return Je-f/g*y},r=u=>{const d=u*o*t,f=d*n+n,g=Math.pow(o,2)*Math.pow(u,2)*t,y=Math.exp(-d),b=gn(Math.pow(u,2),o);return(-i(u)+Je>0?-1:1)*((f-g)*y)/b}):(i=u=>{const l=Math.exp(-u*t),d=(u-n)*t+1;return-Je+l*d},r=u=>{const l=Math.exp(-u*t),d=(n-u)*(t*t);return l*d});const a=5/t,c=nl(i,r,a);if(t=ct(t),isNaN(c))return{stiffness:Y.stiffness,damping:Y.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const il=["duration","bounce"],ol=["stiffness","damping","mass"];function _s(t,e){return e.some(n=>t[n]!==void 0)}function rl(t){let e={velocity:Y.velocity,stiffness:Y.stiffness,damping:Y.damping,mass:Y.mass,isResolvedFromDuration:!1,...t};if(!_s(t,ol)&&_s(t,il))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*Mt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:Y.mass,stiffness:i,damping:r}}else{const n=sl({...t,velocity:0});e={...e,...n,mass:Y.mass},e.isResolvedFromDuration=!0}return e}function _e(t=Y.visualDuration,e=Y.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:c,damping:u,mass:l,duration:d,velocity:f,isResolvedFromDuration:g}=rl({...n,velocity:-dt(n.velocity||0)}),y=f||0,b=u/(2*Math.sqrt(c*l)),x=o-r,w=dt(Math.sqrt(c/l)),S=Math.abs(x)<5;s||(s=S?Y.restSpeed.granular:Y.restSpeed.default),i||(i=S?Y.restDelta.granular:Y.restDelta.default);let T,P,V,N,R,C;if(b<1)V=gn(w,b),N=(y+b*w*x)/V,T=j=>{const B=Math.exp(-b*w*j);return o-B*(N*Math.sin(V*j)+x*Math.cos(V*j))},R=b*w*N+x*V,C=b*w*x-N*V,P=j=>Math.exp(-b*w*j)*(R*Math.sin(V*j)+C*Math.cos(V*j));else if(b===1){T=B=>o-Math.exp(-w*B)*(x+(y+w*x)*B);const j=y+w*x;P=B=>Math.exp(-w*B)*(w*j*B-y)}else{const j=w*Math.sqrt(b*b-1);T=X=>{const Z=Math.exp(-b*w*X),nt=Math.min(j*X,300);return o-Z*((y+b*w*x)*Math.sinh(nt)+j*x*Math.cosh(nt))/j};const B=(y+b*w*x)/j,W=b*w*B-x*j,et=b*w*x-B*j;P=X=>{const Z=Math.exp(-b*w*X),nt=Math.min(j*X,300);return Z*(W*Math.sinh(nt)+et*Math.cosh(nt))}}const _={calculatedDuration:g&&d||null,velocity:j=>ct(P(j)),next:j=>{if(!g&&b<1){const W=Math.exp(-b*w*j),et=Math.sin(V*j),X=Math.cos(V*j),Z=o-W*(N*et+x*X),nt=ct(W*(R*et+C*X));return a.done=Math.abs(nt)<=s&&Math.abs(o-Z)<=i,a.value=a.done?o:Z,a}const B=T(j);if(g)a.done=j>=d;else{const W=ct(P(j));a.done=Math.abs(W)<=s&&Math.abs(o-B)<=i}return a.value=a.done?o:B,a},toString:()=>{const j=Math.min(ss(_),De),B=Po(W=>_.next(j*W).value,j,30);return j+"ms "+B},toTransition:()=>{}};return _}_e.applyToOptions=t=>{const e=tl(t,100,_e);return t.ease=e.ease,t.duration=ct(e.duration),t.type="keyframes",t};const al=5;function ko(t,e,n){const s=Math.max(e-al,0);return io(n-t(s),e-s)}function yn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:l}){const d=t[0],f={done:!1,value:d},g=C=>a!==void 0&&C<a||c!==void 0&&C>c,y=C=>a===void 0?c:c===void 0||Math.abs(a-C)<Math.abs(c-C)?a:c;let b=n*e;const x=d+b,w=o===void 0?x:o(x);w!==x&&(b=w-d);const S=C=>-b*Math.exp(-C/s),T=C=>w+S(C),P=C=>{const _=S(C),j=T(C);f.done=Math.abs(_)<=u,f.value=f.done?w:j};let V,N;const R=C=>{g(f.value)&&(V=C,N=_e({keyframes:[f.value,y(f.value)],velocity:ko(T,C,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:l}))};return R(0),{calculatedDuration:null,next:C=>{let _=!1;return!N&&V===void 0&&(_=!0,P(C),R(C)),V!==void 0&&C>=V?N.next(C-V):(!_&&P(C),f)}}}function ll(t,e,n){const s=[],i=n||Vt.mix||Mo,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||mt:e;a=de(c,a)}s.push(a)}return s}function cl(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Xn(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=ll(e,s,i),c=a.length,u=l=>{if(o&&l<t[0])return e[0];let d=0;if(c>1)for(;d<t.length-2&&!(l<t[d+1]);d++);const f=ae(t[d],t[d+1],l);return a[d](f)};return n?l=>u(Mt(t[0],t[r-1],l)):u}function ul(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=ae(0,e,s);t.push(z(n,1,i))}}function hl(t){const e=[0];return ul(e,t.length-1),e}function dl(t,e){return t.map(n=>n*e)}function fl(t,e){return t.map(()=>e||mo).splice(0,t.length-1)}function ie({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=wa(s)?s.map(As):As(s),r={done:!1,value:e[0]},o=dl(n&&n.length===e.length?n:hl(e),t),a=cl(o,e,{ease:Array.isArray(i)?i:fl(e,i)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}const ml=t=>t!==null;function We(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(ml),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const pl={decay:yn,inertia:yn,tween:ie,keyframes:ie,spring:_e};function Co(t){typeof t.type=="string"&&(t.type=pl[t.type])}class is{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 gl=t=>t/100;class Ne extends is{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=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==rt.now()&&this.tick(rt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Co(e);const{type:n=ie,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const c=n||ie;c!==ie&&typeof a[0]!="number"&&(this.mixKeyframes=de(gl,Mo(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ss(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:l,repeat:d,repeatType:f,repeatDelay:g,type:y,onUpdate:b,finalKeyframe:x}=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 w=this.currentTime-u*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?w<0:w>i;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let T=this.currentTime,P=s;if(d){const C=Math.min(this.currentTime,i)/a;let _=Math.floor(C),j=C%1;!j&&C>=1&&(j=1),j===1&&_--,_=Math.min(_,d+1),_%2&&(f==="reverse"?(j=1-j,g&&(j-=g/a)):f==="mirror"&&(P=o)),T=Mt(0,1,j)*a}let V;S?(this.delayState.value=l[0],V=this.delayState):V=P.next(T),r&&!S&&(V.value=r(V.value));let{done:N}=V;!S&&c!==null&&(N=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return R&&y!==yn&&(V.value=We(l,this.options,x,this.speed)),b&&b(V.value),R&&this.finish(),V}then(e,n){return this.finished.then(e,n)}get duration(){return dt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+dt(e)}get time(){return dt(this.currentTime)}set time(e){e=ct(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 ko(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(rt.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=dt(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Ja,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(rt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function yl(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const It=t=>t*180/Math.PI,xn=t=>{const e=It(Math.atan2(t[1],t[0]));return vn(e)},xl={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:xn,rotateZ:xn,skewX:t=>It(Math.atan(t[1])),skewY:t=>It(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},vn=t=>(t=t%360,t<0&&(t+=360),t),Ns=xn,Ls=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Is=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),vl={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ls,scaleY:Is,scale:t=>(Ls(t)+Is(t))/2,rotateX:t=>vn(It(Math.atan2(t[6],t[5]))),rotateY:t=>vn(It(Math.atan2(-t[2],t[0]))),rotateZ:Ns,rotate:Ns,skewX:t=>It(Math.atan(t[4])),skewY:t=>It(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function bn(t){return t.includes("scale")?1:0}function wn(t,e){if(!t||t==="none")return bn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=vl,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=xl,i=a}if(!i)return bn(e);const r=s[e],o=i[1].split(",").map(wl);return typeof r=="function"?r(o):o[r]}const bl=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return wn(n,e)};function wl(t){return parseFloat(t.trim())}const Qt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jt=new Set([...Qt,"pathRotation"]),Fs=t=>t===Zt||t===A,Tl=new Set(["x","y","z"]),Sl=Qt.filter(t=>!Tl.has(t));function Ml(t){const e=[];return Sl.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const jt={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})=>wn(e,"x"),y:(t,{transform:e})=>wn(e,"y")};jt.translateX=jt.x;jt.translateY=jt.y;const Ft=new Set;let Tn=!1,Sn=!1,Mn=!1;function Ao(){if(Sn){const t=Array.from(Ft).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Ml(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])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Sn=!1,Tn=!1,Ft.forEach(t=>t.complete(Mn)),Ft.clear()}function jo(){Ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Sn=!0)})}function Pl(){Mn=!0,jo(),Ao(),Mn=!1}class os{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?(Ft.add(this),Tn||(Tn=!0,K.read(jo),K.resolveKeyframes(Ao))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=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])}yl(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Ft.delete(this)}cancel(){this.state==="scheduled"&&(Ft.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const kl=t=>t.startsWith("--");function Vo(t,e,n){kl(e)?t.style.setProperty(e,n):t.style[e]=n}const Cl={};function Eo(t,e){const n=so(t);return()=>Cl[e]??n()}const Al=Eo(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ro=Eo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ne=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Bs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ne([0,.65,.55,1]),circOut:ne([.55,0,1,.45]),backIn:ne([.31,.01,.66,-.59]),backOut:ne([.33,1.53,.69,.99])};function Do(t,e){if(t)return typeof t=="function"?Ro()?Po(t,e):"ease-out":po(t)?ne(t):Array.isArray(t)?t.map(n=>Do(n,e)||Bs.easeOut):Bs[t]}function jl(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[e]:n};c&&(l.offset=c);const d=Do(a,i);Array.isArray(d)&&(l.easing=d);const f={delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(l,f)}function _o(t){return typeof t=="function"&&"applyToOptions"in t}function Vl({type:t,...e}){return _o(t)&&Ro()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class No extends is{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:c}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Xn(typeof e.type!="string");const u=Vl(e);this.animation=jl(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const l=We(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),Vo(n,s,l),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return dt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+dt(e)}get time(){return dt(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ct(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}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Al()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),mt):i(this)}}const Lo={anticipate:uo,backInOut:co,circInOut:fo};function El(t){return t in Lo}function Rl(t){typeof t.ease=="string"&&El(t.ease)&&(t.ease=Lo[t.ease])}const tn=10;class Dl extends No{constructor(e){Rl(e),Co(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 Ne({...o,autoplay:!1}),c=Math.max(tn,rt.now()-this.startTime),u=Mt(0,tn,c-tn),l=a.sample(c).value,{name:d}=this.options;r&&d&&Vo(r,d,l),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}}const Os=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(vt.test(t)||t==="0")&&!t.startsWith("url("));function _l(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 Nl(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=Os(i,e),a=Os(r,e);return!o||!a?!1:_l(t)||(n==="spring"||_o(n))&&s}function Pn(t){t.duration=0,t.type="keyframes"}const Io=new Set(["opacity","clipPath","filter","transform"]),Ll=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Il(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Ll.test(t[e]))return!0;return!1}const Fl=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Bl=so(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ol(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return Bl()&&n&&(Io.has(n)||Fl.has(n)&&Il(a))&&(n!=="transform"||!l)&&!u&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const Ul=40;class $l extends is{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:l,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=rt.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:u,element:l,...d},g=l?.KeyframeResolver||os;this.keyframeResolver=new g(a,(y,b,x)=>this.onKeyframesResolved(y,b,f,!x),c,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:l}=s;this.resolvedAt=rt.now();let d=!0;Nl(e,r,o,a)||(d=!1,(Vt.instantAnimations||!c)&&l?.(We(e,s,n)),e[0]=e[e.length-1],Pn(s),s.repeat=0);const g={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Ul?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},y=d&&!u&&Ol(g),b=g.motionValue?.owner?.current;let x;if(y)try{x=new Dl({...g,element:b})}catch{x=new Ne(g)}else x=new Ne(g);x.finished.then(()=>{this.notifyFinished()}).catch(mt),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Pl()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Fo(t,e,n,s=0,i=1){const r=Array.from(t).sort((u,l)=>u.sortNodePosition(l)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const Us=30,Wl=t=>!isNaN(parseFloat(t));class zl{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=rt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=rt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Wl(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 Yn);const s=this.events[e].add(n);return e==="change"?()=>{s(),K.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=rt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Us)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Us);return io(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Gt(t,e){return new zl(t,e)}function Bo(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function rs(t,e){const n=t?.[e]??t?.default??t;return n!==t?Bo(n,t):n}const Kl={type:"spring",stiffness:500,damping:25,restSpeed:10},Hl=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Gl={type:"keyframes",duration:.8},ql={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Xl=(t,{keyframes:e})=>e.length>2?Gl:Jt.has(t)?t.startsWith("scale")?Hl(e[1]):Kl:ql,Yl=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Zl(t){for(const e in t)if(!Yl.has(e))return!0;return!1}const as=(t,e,n,s={},i,r)=>
1o=>{const a=rs(s,t)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-ct(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,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};Zl(a)||Object.assign(l,Xl(t,l)),l.duration&&(l.duration=ct(l.duration)),l.repeatDelay&&(l.repeatDelay=ct(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let d=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(Pn(l),l.delay===0&&(d=!0)),(Vt.instantAnimations||Vt.skipAnimations||i?.shouldSkipAnimations||a.skipAnimations)&&(d=!0,Pn(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,d&&!r&&e.get()!==void 0){const f=We(l.keyframes,a);if(f!==void 0){K.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new Ne(l):new $l(l)},Ql=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jl(t){const e=Ql.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Oo(t,e,n=1){const[s,i]=Jl(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return to(o)?parseFloat(o):o}return Jn(i)?Oo(i,e,n+1):i}function $s(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function ls(t,e,n,s){if(typeof e=="function"){const[i,r]=$s(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]=$s(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function Bt(t,e,n){const s=t.getProps();return ls(s,e,n!==void 0?n:s.custom,t)}const Uo=new Set(["width","height","top","left","right","bottom",...Qt]),kn=t=>Array.isArray(t);function tc(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Gt(n))}function ec(t){return kn(t)?t[t.length-1]||0:t}
vendor: 4,886 bytes, line 1
1function nc(t,e){const n=Bt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=ec(r[o]);tc(t,o,a)}}const ot=t=>!!(t&&t.getVelocity);function sc(t){return!!(ot(t)&&t.add)}function Cn(t,e){const n=t.getValue("willChange");if(sc(n))return n.add(e);if(!n&&Vt.WillChange){const s=new Vt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function cs(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const ic="framerAppearId",$o="data-"+cs(ic);function Wo(t){return t.props[$o]}function oc({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function zo(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const c=t.getDefaultTransition();r=r?Bo(r,c):c;const u=r?.reduceMotion,l=r?.skipAnimations;s&&(r=s);const d=[],f=i&&t.animationState&&t.animationState.getState()[i],g=r?.path;g&&g.animateVisualElement(t,a,r,n,d);for(const y in a){const b=t.getValue(y,t.latestValues[y]??null),x=a[y];if(x===void 0||f&&oc(f,y))continue;const w={delay:n,...rs(r||{},y)};l&&(w.skipAnimations=!0);const S=b.get();if(S!==void 0&&!b.isAnimating()&&!Array.isArray(x)&&x===S&&!w.velocity){K.update(()=>b.set(x));continue}let T=!1;if(window.MotionHandoffAnimation){const N=Wo(t);if(N){const R=window.MotionHandoffAnimation(N,y,K);R!==null&&(w.startTime=R,T=!0)}}Cn(t,y);const P=u??t.shouldReduceMotion;b.start(as(y,b,x,P&&Uo.has(y)?{type:!1}:w,t,T));const V=b.animation;V&&d.push(V)}if(o){const y=()=>K.update(()=>{o&&nc(t,o)});d.length?Promise.all(d).then(y):y()}return d}function An(t,e,n={}){const s=Bt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(zo(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:l,staggerDirection:d}=i;return rc(t,e,c,u,l,d,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 rc(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(An(c,e,{...o,delay:n+(typeof s=="function"?0:s)+Fo(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function ac(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>An(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=An(t,e,n);else{const i=typeof e=="function"?Bt(t,e,n.custom):e;s=Promise.all(zo(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const lc={test:t=>t==="auto",parse:t=>t},Ko=t=>e=>e.test(t),Ho=[Zt,A,St,Ct,_a,Da,lc],Ws=t=>Ho.find(Ko(t));function cc(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||no(t):!0}const uc=new Set(["brightness","contrast","saturate","opacity"]);function hc(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(ts)||[];if(!s)return t;const i=n.replace(s,"");let r=uc.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const dc=/\b([a-z-]*)\(.*?\)/gu,jn={...vt,getAnimatableNone:t=>{const e=t.match(dc);return e?e.map(hc).join(" "):t}},Vn={...vt,getAnimatableNone:t=>{const e=vt.parse(t);return vt.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},zs={...Zt,transform:Math.round},fc={rotate:Ct,pathRotation:Ct,rotateX:Ct,rotateY:Ct,rotateZ:Ct,scale:ye,scaleX:ye,scaleY:ye,scaleZ:ye,skew:Ct,skewX:Ct,skewY:Ct,distance:A,translateX:A,translateY:A,translateZ:A,x:A,y:A,z:A,perspective:A,transformPerspective:A,opacity:le,originX:Vs,originY:Vs,originZ:A},Le={borderWidth:A,borderTopWidth:A,borderRightWidth:A,borderBottomWidth:A,borderLeftWidth:A,borderRadius:A,borderTopLeftRadius:A,borderTopRightRadius:A,borderBottomRightRadius:A,borderBottomLeftRadius:A,width:A,maxWidth:A,height:A,maxHeight:A,top:A,right:A,bottom:A,left:A,inset:A,insetBlock:A,insetBlockStart:A,insetBlockEnd:A,insetInline:A,insetInlineStart:A,insetInlineEnd:A,padding:A,paddingTop:A,paddingRight:A,paddingBottom:A,paddingLeft:A,paddingBlock:A,paddingBlockStart:A,paddingBlockEnd:A,paddingInline:A,paddingInlineStart:A,paddingInlineEnd:A,margin:A,marginTop:A,marginRight:A,marginBottom:A,marginLeft:A,marginBlock:A,marginBlockStart:A,marginBlockEnd:A,marginInline:A,marginInlineStart:A,marginInlineEnd:A,fontSize:A,backgroundPositionX:A,backgroundPositionY:A,...fc,zIndex:zs,fillOpacity:le,strokeOpacity:le,numOctaves:zs},mc={...Le,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:jn,WebkitFilter:jn,mask:Vn,WebkitMask:Vn},Go=t=>mc[t],pc=new Set([jn,Vn]);function qo(t,e){let n=Go(t);return pc.has(n)||(n=vt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}
vendor: 1,699 bytes, line 1
1const gc=new Set(["auto","none","0"]);function yc(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!gc.has(r)&&Ht(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=qo(n,i)}class xc extends os{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let d=e[l];if(typeof d=="string"&&(d=d.trim(),Jn(d))){const f=Oo(d,n.current);f!==void 0&&(e[l]=f),l===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!Uo.has(s)||e.length!==2)return;const[i,r]=e,o=Ws(i),a=Ws(r),c=js(i),u=js(r);if(c!==u&&jt[s]){this.needsMeasurement=!0;return}if(o!==a)if(Fs(o)&&Fs(a))for(let l=0;l<e.length;l++){const d=e[l];typeof d=="string"&&(e[l]=parseFloat(d))}else jt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||cc(e[i]))&&s.push(i);s.length&&yc(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=jt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=jt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEac
vendor: 49,432 bytes, line 1
1h(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function Xo(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const En=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Se(t){return eo(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:us}=go(queueMicrotask,!1),xt={x:!1,y:!1};function Yo(){return xt.x||xt.y}function vc(t){return t==="x"||t==="y"?xt[t]?null:(xt[t]=!0,()=>{xt[t]=!1}):xt.x||xt.y?null:(xt.x=xt.y=!0,()=>{xt.x=xt.y=!1})}function Zo(t,e){const n=Xo(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function bc(t){return!(t.pointerType==="touch"||Yo())}function wc(t,e,n={}){const[s,i,r]=Zo(t,n);return s.forEach(o=>{let a=!1,c=!1,u;const l=()=>{o.removeEventListener("pointerleave",y)},d=x=>{u&&(u(x),u=void 0),l()},f=x=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,d(x))},g=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},y=x=>{if(x.pointerType!=="touch"){if(a){c=!0;return}d(x)}},b=x=>{if(!bc(x))return;c=!1;const w=e(o,x);typeof w=="function"&&(u=w,o.addEventListener("pointerleave",y,i))};o.addEventListener("pointerenter",b,i),o.addEventListener("pointerdown",g,i)}),r}const Qo=(t,e)=>e?t===e?!0:Qo(t,e.parentElement):!1,hs=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Tc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Sc(t){return Tc.has(t.tagName)||t.isContentEditable===!0}const Mc=new Set(["INPUT","SELECT","TEXTAREA"]);function Pc(t){return Mc.has(t.tagName)||t.isContentEditable===!0}const Me=new WeakSet;function Ks(t){return e=>{e.key==="Enter"&&t(e)}}function en(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const kc=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Ks(()=>{if(Me.has(n))return;en(n,"down");const i=Ks(()=>{en(n,"up")}),r=()=>en(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 Hs(t){return hs(t)&&!Yo()}const Gs=new WeakSet;function Cc(t,e,n={}){const[s,i,r]=Zo(t,n),o=a=>{const c=a.currentTarget;if(!Hs(a)||Gs.has(a))return;Me.add(c),n.stopPropagation&&Gs.add(a);const u=e(c,a),l=(g,y)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Me.has(c)&&Me.delete(c),Hs(g)&&typeof u=="function"&&u(g,{success:y})},d=g=>{l(g,c===window||c===document||n.useGlobalTarget||Qo(c,g.target))},f=g=>{l(g,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Se(a)&&(a.addEventListener("focus",u=>kc(u,i)),!Sc(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function ds(t){return eo(t)&&"ownerSVGElement"in t}const Pe=new WeakMap;let ke;const Jo=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:ds(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Ac=Jo("inline","width","offsetWidth"),jc=Jo("block","height","offsetHeight");function Vc({target:t,borderBoxSize:e}){Pe.get(t)?.forEach(n=>{n(t,{get width(){return Ac(t,e)},get height(){return jc(t,e)}})})}function Ec(t){t.forEach(Vc)}function Rc(){typeof ResizeObserver>"u"||(ke=new ResizeObserver(Ec))}function Dc(t,e){ke||Rc();const n=Xo(t);return n.forEach(s=>{let i=Pe.get(s);i||(i=new Set,Pe.set(s,i)),i.add(e),ke?.observe(s)}),()=>{n.forEach(s=>{const i=Pe.get(s);i?.delete(e),i?.size||ke?.unobserve(s)})}}const Ce=new Set;let Wt;function _c(){Wt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ce.forEach(e=>e(t))},window.addEventListener("resize",Wt)}function Nc(t){return Ce.add(t),Wt||_c(),()=>{Ce.delete(t),!Ce.size&&typeof Wt=="function"&&(window.removeEventListener("resize",Wt),Wt=void 0)}}function qs(t,e){return typeof t=="function"?Nc(t):Dc(t,e)}function Lc(t){return ds(t)&&t.tagName==="svg"}const Ic=[...Ho,J,vt],Fc=t=>Ic.find(Ko(t)),Xs=()=>({translate:0,scale:1,origin:0,originPoint:0}),zt=()=>({x:Xs(),y:Xs()}),Ys=()=>({min:0,max:0}),tt=()=>({x:Ys(),y:Ys()}),Bc=new WeakMap;function ze(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function ce(t){return typeof t=="string"||Array.isArray(t)}const fs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ms=["initial",...fs];function Ke(t){return ze(t.animate)||ms.some(e=>ce(t[e]))}function tr(t){return!!(Ke(t)||t.variants)}function Oc(t,e,n){for(const s in e){const i=e[s],r=n[s];if(ot(i))t.addValue(s,i);else if(ot(r))t.addValue(s,Gt(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,Gt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Rn={current:null},er={current:!1},Uc=typeof window<"u";function $c(){if(er.current=!0,!!Uc)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Rn.current=t.matches;t.addEventListener("change",e),e()}else Rn.current=!1}const Zs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ie={};function nr(t){Ie=t}function Wc(){return Ie}class zc{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},c={}){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=os,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 g=rt.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,K.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=Ke(n),this.isVariantNode=tr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in f){const y=f[g];u[g]!==void 0&&ot(y)&&y.set(u[g])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,Bc.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(er.current||$c(),this.shouldReduceMotion=Rn.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Et(this.notifyUpdate),Et(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Io.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,d=new No({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:ct(l)}),f=o(d);this.valueSubscriptions.set(e,()=>{f(),d.cancel()});return}const s=Jt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&K.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()})}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 Ie){const n=Ie[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):tt()}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<Zs.length;s++){const i=Zs[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=Oc(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=Gt(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"&&(to(s)||no(s))?s=parseFloat(s):!Fc(s)&&vt.test(n)&&(s=qo(e,n)),this.setBaseTarget(e,ot(s)?s.get():s)),ot(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=ls(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!ot(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 Yn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){us.render(this.render)}}class sr extends zc{constructor(){super(...arguments),this.KeyframeResolver=xc}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;ot(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Rt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ir({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Kc({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Hc(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 nn(t){return t===void 0||t===1}function Dn({scale:t,scaleX:e,scaleY:n}){return!nn(t)||!nn(e)||!nn(n)}function Nt(t){return Dn(t)||or(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function or(t){return Qs(t.x)||Qs(t.y)}function Qs(t){return t&&t!=="0%"}function Fe(t,e,n){const s=t-n,i=e*s;return n+i}function Js(t,e,n,s,i){return i!==void 0&&(t=Fe(t,i,s)),Fe(t,n,s)+e}function _n(t,e=0,n=1,s,i){t.min=Js(t.min,e,n,s,i),t.max=Js(t.max,e,n,s,i)}function rr(t,{x:e,y:n}){_n(t.x,e.translate,e.scale,e.originPoint),_n(t.y,n.translate,n.scale,n.originPoint)}const ti=.999999999999,ei=1.0000000000001;function Gc(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],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&&(Tt(t.x,-r.scroll.offset.x),Tt(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,rr(t,o)),s&&Nt(r.latestValues)&&Ae(t,r.latestValues,r.layout?.layoutBox))}e.x<ei&&e.x>ti&&(e.x=1),e.y<ei&&e.y>ti&&(e.y=1)}function Tt(t,e){t.min+=e,t.max+=e}function ni(t,e,n,s,i=.5){const r=z(t.min,t.max,i);_n(t,e,n,r,s)}function si(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Ae(t,e,n){const s=n??t;ni(t.x,si(e.x,s.x),e.scaleX,e.scale,e.originX),ni(t.y,si(e.y,s.y),e.scaleY,e.scale,e.originY)}function ar(t,e){return ir(Hc(t.getBoundingClientRect(),e))}function qc(t,e,n){const s=ar(t,n),{scroll:i}=e;return i&&(Tt(s.x,i.offset.x),Tt(s.y,i.offset.y)),s}const Xc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Yc=Qt.length;function Zc(t,e,n){let s="",i=!0;for(let o=0;o<Yc;o++){const a=Qt[o],c=t[a];if(c===void 0)continue;let u=!0;if(typeof c=="number")u=c===(a.startsWith("scale")?1:0);else{const l=parseFloat(c);u=a.startsWith("scale")?l===1:l===0}if(!u||n){const l=En(c,Le[a]);if(!u){i=!1;const d=Xc[a]||a;s+=`${d}(${l}) `}n&&(e[a]=l)}}const r=t.pathRotation;return r&&(i=!1,s+=`rotate(${En(r,Le.pathRotation)}) `),s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function ps(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const c in e){const u=e[c];if(Jt.has(c)){o=!0;continue}else if(xo(c)){i[c]=u;continue}else{const l=En(u,Le[c]);c.startsWith("origin")?(a=!0,r[c]=l):s[c]=l}}if(e.transform||(o||n?s.transform=Zc(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=r;s.transformOrigin=`${c} ${u} ${l}`}}function lr(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function ii(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const te={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(A.test(t))t=parseFloat(t);else return t;const n=ii(t,e.target.x),s=ii(t,e.target.y);return`${n}% ${s}%`}},Qc={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=vt.parse(t);if(i.length>5)return s;const r=vt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const u=z(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},Nn={borderRadius:{...te,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomLeftRadius:te,borderBottomRightRadius:te,boxShadow:Qc};function cr(t,{layout:e,layoutId:n}){return Jt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Nn[t]||t==="opacity")}function gs(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(ot(s[o])||i&&ot(i[o])||cr(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function Jc(t){return window.getComputedStyle(t)}class tu extends sr{constructor(){super(...arguments),this.type="html",this.renderInstance=lr}readValueFromInstance(e,n){if(Jt.has(n))return this.projection?.isProjecting?bn(n):bl(e,n);{const s=Jc(e),i=(xo(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return ar(e,n)}build(e,n,s){ps(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return gs(e,n,s)}}const eu={offset:"stroke-dashoffset",array:"stroke-dasharray"},nu={offset:"strokeDashoffset",array:"strokeDasharray"};function su(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?eu:nu;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const iu=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ur(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,u,l){if(ps(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:f}=t;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=l?.transformBox??"fill-box",delete d.transformBox);for(const g of iu)d[g]!==void 0&&(f[g]=d[g],delete d[g]);e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),i!==void 0&&su(d,i,r,o,!1)}const hr=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"]),dr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ou(t,e,n,s){lr(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(hr.has(i)?i:cs(i),e.attrs[i])}function fr(t,e,n){const s=gs(t,e,n);for(const i in t)if(ot(t[i])||ot(e[i])){const r=Qt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class ru extends sr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=tt}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Jt.has(n)){const s=Go(n);return s&&s.default||0}return n=hr.has(n)?n:cs(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return fr(e,n,s)}build(e,n,s){ur(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){ou(e,n,s,i)}mount(e){this.isSVGTag=dr(e.tagName),super.mount(e)}}const au=ms.length;function mr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?mr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<au;n++){const s=ms[n],i=t.props[s];(ce(i)||i===!1)&&(e[s]=i)}return e}function pr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const lu=[...fs].reverse(),cu=fs.length;function uu(t){return e=>Promise.all(e.map(({animation:n,options:s})=>ac(t,n,s)))}function hu(t){let e=uu(t),n=oi(),s=!0,i=!1;const r=u=>(l,d)=>{const f=Bt(t,d,u==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:g,transitionEnd:y,...b}=f;l={...l,...b,...y}}return l};function o(u){e=u(t)}function a(u){const{props:l}=t,d=mr(t.parent)||{},f=[],g=new Set;let y={},b=1/0;for(let w=0;w<cu;w++){const S=lu[w],T=n[S],P=l[S]!==void 0?l[S]:d[S],V=ce(P),N=S===u?T.isActive:null;N===!1&&(b=w);let R=P===d[S]&&P!==l[S]&&V;if(R&&(s||i)&&t.manuallyAnimateOnMount&&(R=!1),T.protectedKeys={...y},!T.isActive&&N===null||!P&&!T.prevProp||ze(P)||typeof P=="boolean")continue;if(S==="exit"&&T.isActive&&N!==!0){T.prevResolvedValues&&(y={...y,...T.prevResolvedValues});continue}const C=du(T.prevProp,P);let _=C||S===u&&T.isActive&&!R&&V||w>b&&V,j=!1;const B=Array.isArray(P)?P:[P];let W=B.reduce(r(S),{});N===!1&&(W={});const{prevResolvedValues:et={}}=T,X={...et,...W},Z=H=>{_=!0,g.has(H)&&(j=!0,g.delete(H)),T.needsAnimating[H]=!0;const Q=t.getValue(H);Q&&(Q.liveStyle=!1)};for(const H in X){const Q=W[H],p=et[H];if(y.hasOwnProperty(H))continue;let m=!1;kn(Q)&&kn(p)?m=!pr(Q,p)||C:m=Q!==p,m?Q!=null?Z(H):g.add(H):Q!==void 0&&g.has(H)?Z(H):T.protectedKeys[H]=!0}T.prevProp=P,T.prevResolvedValues=W,T.isActive&&(y={...y,...W}),(s||i)&&t.blockInitialAnimation&&(_=!1);const nt=R&&C;_&&(!nt||j)&&f.push(...B.map(H=>{const Q={type:S};if(typeof H=="string"&&(s||i)&&!nt&&t.manuallyAnimateOnMount&&t.parent){const{parent:p}=t,m=Bt(p,H);if(p.enteringChildren&&m){const{delayChildren:M}=m.transition||{};Q.delay=Fo(p.enteringChildren,t,M)}}return{animation:H,options:Q}}))}if(g.size){const w={};if(typeof l.initial!="boolean"){const S=Bt(t,Array.isArray(l.initial)?l.initial[0]:l.initial);S&&S.transition&&(w.transition=S.transition)}g.forEach(S=>{const T=t.getBaseTarget(S),P=t.getValue(S);P&&(P.liveStyle=!0),w[S]=T??null}),f.push({animation:w})}let x=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(x=!1),s=!1,i=!1,x?e(f):Promise.resolve()}function c(u,l){if(n[u].isActive===l)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(u,l)),n[u].isActive=l;const d=a(u);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=oi(),i=!0}}}function du(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!pr(e,t):!1}function _t(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function oi(){return{animate:_t(!0),whileInView:_t(),whileHover:_t(),whileTap:_t(),whileDrag:_t(),whileFocus:_t(),exit:_t()}}function Ln(t,e){t.min=e.min,t.max=e.max}function yt(t,e){Ln(t.x,e.x),Ln(t.y,e.y)}function ri(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const gr=1e-4,fu=1-gr,mu=1+gr,yr=.01,pu=0-yr,gu=0+yr;function at(t){return t.max-t.min}function yu(t,e,n){return Math.abs(t-e)<=n}function ai(t,e,n,s=.5){t.origin=s,t.originPoint=z(e.min,e.max,t.origin),t.scale=at(n)/at(e),t.translate=z(n.min,n.max,t.origin)-t.originPoint,(t.scale>=fu&&t.scale<=mu||isNaN(t.scale))&&(t.scale=1),(t.translate>=pu&&t.translate<=gu||isNaN(t.translate))&&(t.translate=0)}function oe(t,e,n,s){ai(t.x,e.x,n.x,s?s.originX:void 0),ai(t.y,e.y,n.y,s?s.originY:void 0)}function li(t,e,n,s=0){const i=s?z(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+at(e)}function xu(t,e,n,s){li(t.x,e.x,n.x,s?.x),li(t.y,e.y,n.y,s?.y)}function ci(t,e,n,s=0){const i=s?z(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+at(e)}function Be(t,e,n,s){ci(t.x,e.x,n.x,s?.x),ci(t.y,e.y,n.y,s?.y)}function ui(t,e,n,s,i){return t-=e,t=Fe(t,1/n,s),i!==void 0&&(t=Fe(t,1/i,s)),t}function vu(t,e=0,n=1,s=.5,i,r=t,o=t){if(St.test(e)&&(e=parseFloat(e),e=z(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=z(r.min,r.max,s);t===r&&(a-=e),t.min=ui(t.min,e,n,a,i),t.max=ui(t.max,e,n,a,i)}function hi(t,e,[n,s,i],r,o){vu(t,e[n],e[s],e[i],e.scale,r,o)}const bu=["x","scaleX","originX"],wu=["y","scaleY","originY"];function di(t,e,n,s){hi(t.x,e,bu,n?n.x:void 0,s?s.x:void 0),hi(t.y,e,wu,n?n.y:void 0,s?s.y:void 0)}function fi(t){return t.translate===0&&t.scale===1}function xr(t){return fi(t.x)&&fi(t.y)}function mi(t,e){return t.min===e.min&&t.max===e.max}function Tu(t,e){return mi(t.x,e.x)&&mi(t.y,e.y)}function pi(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function vr(t,e){return pi(t.x,e.x)&&pi(t.y,e.y)}function gi(t){return at(t.x)/at(t.y)}function yi(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function wt(t){return[t("x"),t("y")]}function Su(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=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:u,rotate:l,pathRotation:d,rotateX:f,rotateY:g,skewX:y,skewY:b}=n;u&&(s=`perspective(${u}px) ${s}`),l&&(s+=`rotate(${l}deg) `),d&&(s+=`rotate(${d}deg) `),f&&(s+=`rotateX(${f}deg) `),g&&(s+=`rotateY(${g}deg) `),y&&(s+=`skewX(${y}deg) `),b&&(s+=`skewY(${b}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const br=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],Mu=br.length,xi=t=>typeof t=="string"?parseFloat(t):t,vi=t=>typeof t=="number"||A.test(t);function Pu(t,e,n,s,i,r){i?(t.opacity=z(0,n.opacity??1,ku(s)),t.opacityExit=z(e.opacity??1,0,Cu(s))):r&&(t.opacity=z(e.opacity??1,n.opacity??1,s));for(let o=0;o<Mu;o++){const a=br[o];let c=bi(e,a),u=bi(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||vi(c)===vi(u)?(t[a]=Math.max(z(xi(c),xi(u),s),0),(St.test(u)||St.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=z(e.rotate||0,n.rotate||0,s))}function bi(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const ku=wr(0,.5,ho),Cu=wr(.5,.95,mt);function wr(t,e,n){return s=>s<t?0:s>e?1:n(ae(t,e,s))}function Au(t,e,n){const s=ot(t)?t:Gt(t);return s.start(as("",s,e,n)),s.animation}function ue(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const ju=(t,e)=>t.depth-e.depth;class Vu{constructor(){this.children=[],this.isDirty=!1}add(e){qn(this.children,e),this.isDirty=!0}remove(e){Ee(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ju),this.isDirty=!1,this.children.forEach(e)}}function Eu(t,e){const n=rt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Et(s),t(r-e))};return K.setup(s,!0),()=>Et(s)}function je(t){return ot(t)?t.get():t}class Ru{constructor(){this.members=[]}add(e){qn(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&&(Ee(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Ee(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){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Ve={hasAnimatedSinceResize:!0,hasEverUpdated:!1},sn=["","X","Y","Z"],Du=1e3;let _u=0;function on(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Tr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Wo(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",K,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Tr(s)}function Sr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=_u++,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(Iu),this.nodes.forEach(Wu),this.nodes.forEach(zu),this.nodes.forEach(Fu)},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 c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Vu)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Yn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=ds(o)&&!Lc(o),this.instance=o;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let l,d=0;const f=()=>this.root.updateBlockedByResize=!1;K.read(()=>{d=window.innerWidth}),t(o,()=>{const g=window.innerWidth;g!==d&&(d=g,this.root.updateBlockedByResize=!0,l&&l(),l=Eu(f,250),Ve.hasAnimatedSinceResize&&(Ve.hasAnimatedSinceResize=!1,this.nodes.forEach(Si)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||Xu,{onLayoutAnimationStart:b,onLayoutAnimationComplete:x}=u.getProps(),w=!this.targetLayout||!vr(this.targetLayout,g),S=!d&&f;if(this.options.layoutRoot||this.resumeFrom||S||d&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...rs(y,"layout"),onPlay:b,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(l,S,T.path)}else d||Si(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}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(),Et(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(Ku),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&&Tr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const d=this.path[l];d.shouldResetTransform=!0,(typeof d.latestValues.x=="string"||typeof d.latestValues.y=="string")&&(d.isLayoutDirty=!0),d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Ou),this.nodes.forEach(wi);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ti);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Uu),this.nodes.forEach($u),this.nodes.forEach(Nu),this.nodes.forEach(Lu)):this.nodes.forEach(Ti),this.clearAllSnapshots();const a=rt.now();it.delta=Mt(0,1e3/60,a-it.timestamp),it.timestamp=a,it.isProcessing=!0,Xe.update.process(it),Xe.preRender.process(it),Xe.render.process(it),it.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,us.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Bu),this.sharedNodes.forEach(Hu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,K.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){K.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!at(this.snapshot.measuredBox.x)&&!at(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=tt()),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 c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!xr(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Nt(this.latestValues)||l)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),Yu(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return tt();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Zu))){const{scroll:u}=this.root;u&&(Tt(a.x,u.offset.x),Tt(a.y,u.offset.y))}return a}removeElementScroll(o){const a=tt();if(yt(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:d}=u;u!==this.root&&l&&d.layoutScroll&&(l.wasRoot&&yt(a,o),Tt(a.x,l.offset.x),Tt(a.y,l.offset.y))}return a}applyTransform(o,a=!1,c){const u=c||tt();yt(u,o);for(let l=0;l<this.path.length;l++){const d=this.path[l];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(Tt(u.x,-d.scroll.offset.x),Tt(u.y,-d.scroll.offset.y)),Nt(d.latestValues)&&Ae(u,d.latestValues,d.layout?.layoutBox)}return Nt(this.latestValues)&&Ae(u,this.latestValues,this.layout?.layoutBox),u}removeTransform(o){const a=tt();yt(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!Nt(u.latestValues))continue;let l;u.instance&&(Dn(u.latestValues)&&u.updateSnapshot(),l=tt(),yt(l,u.measurePageBox())),di(a,u.latestValues,u.snapshot?.layoutBox,l)}return Nt(this.latestValues)&&di(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!==it.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:d}=this.options;if(!this.layout||!(l||d))return;this.resolvedRelativeTargetAt=it.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=tt(),this.targetWithTransforms=tt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),xu(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):yt(this.target,this.layout.layoutBox),rr(this.target,this.targetDelta)):yt(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||Dn(this.parent.latestValues)||or(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,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=tt(),this.relativeTargetOrigin=tt(),Be(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),yt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===it.timestamp&&(c=!1),c)return;const{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;yt(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,f=this.treeScale.y;Gc(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=tt());const{target:g}=o;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ri(this.prevProjectionDelta.x,this.projectionDelta.x),ri(this.prevProjectionDelta.y,this.projectionDelta.y)),oe(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==f||!yi(this.projectionDelta.x,this.prevProjectionDelta.x)||!yi(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=zt(),this.projectionDelta=zt(),this.projectionDeltaWithTransform=zt()}setAnimationOrigin(o,a=!1,c){const u=this.snapshot,l=u?u.latestValues:{},d={...this.latestValues},f=zt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const g=tt(),y=u?u.source:void 0,b=this.layout?this.layout.source:void 0,x=y!==b,w=this.getStack(),S=!w||w.members.length<=1,T=!!(x&&!S&&this.options.crossfade===!0&&!this.path.some(qu));this.animationProgress=0;let P;const V=c?.interpolateProjection(o);this.mixTargetDelta=N=>{const R=N/1e3,C=V?.(R);C?(f.x.translate=C.x,f.x.scale=z(o.x.scale,1,R),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=C.y,f.y.scale=z(o.y.scale,1,R),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(Mi(f.x,o.x,R),Mi(f.y,o.y,R)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Be(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Gu(this.relativeTarget,this.relativeTargetOrigin,g,R),P&&Tu(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=tt()),yt(P,this.relativeTarget)),x&&(this.animationValues=d,Pu(d,l,this.latestValues,R,T,S)),C&&C.rotate!==void 0&&(this.animationValues||(this.animationValues=d),this.animationValues.pathRotation=C.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=R},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Et(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=K.update(()=>{Ve.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Gt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Au(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},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(Du),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:l}=o;if(!(!a||!c||!u)){if(this!==o&&this.layout&&u&&Mr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||tt();const d=at(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+d;const f=at(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}yt(a,c),Ae(a,l),oe(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Ru),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),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:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&on("z",o,u,this.animationValues);for(let l=0;l<sn.length;l++)on(`rotate${sn[l]}`,o,u,this.animationValues),on(`skew${sn[l]}`,o,u,this.animationValues);o.render();for(const l in u)o.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=je(a?.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=je(a?.pointerEvents)||""),this.hasProjected&&!Nt(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let d=Su(this.projectionDeltaWithTransform,this.treeScale,l);c&&(d=c(l,d)),o.transform=d;const{x:f,y:g}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${g.origin*100}% 0`,u.animationValues?o.opacity=u===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const y in Nn){if(l[y]===void 0)continue;const{correct:b,applyTo:x,isCSSVariable:w}=Nn[y],S=d==="none"?l[y]:b(l[y],u);if(x){const T=x.length;for(let P=0;P<T;P++)o[x[P]]=S}else w?this.options.visualElement.renderState.vars[y]=S:o[y]=S}this.options.layoutId&&(o.pointerEvents=u===this?je(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(wi),this.root.sharedNodes.clear()}}}function Nu(t){t.updateLayout()}function Lu(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;if(i==="size")wt(l=>{const d=r?e.measuredBox[l]:e.layoutBox[l],f=at(d);d.min=n[l].min,d.max=d.min+f});else if(i==="x"||i==="y"){const l=i==="x"?"y":"x";Ln(r?e.measuredBox[l]:e.layoutBox[l],n[l])}else Mr(i,e.layoutBox,n)&&wt(l=>{const d=r?e.measuredBox[l]:e.layoutBox[l],f=at(n[l]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+f)});const o=zt();oe(o,n,e.layoutBox);const a=zt();r?oe(a,t.applyTransform(s,!0),e.measuredBox):oe(a,n,e.layoutBox);const c=!xr(o);let u=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:d,layout:f}=l;if(d&&f){const g=t.options.layoutAnchor||void 0,y=tt();Be(y,e.layoutBox,d.layoutBox,g);const b=tt();Be(b,n,f.layoutBox,g),vr(y,b)||(u=!0),l.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=y,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Iu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.
1isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Fu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Bu(t){t.clearSnapshot()}function wi(t){t.clearMeasurements()}function Ou(t){t.isLayoutDirty=!0,t.updateLayout()}function Ti(t){t.isLayoutDirty=!1}function Uu(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function $u(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Si(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Wu(t){t.resolveTargetDelta()}function zu(t){t.calcProjection()}function Ku(t){t.resetSkewAndRotation()}function Hu(t){t.removeLeadSnapshot()}function Mi(t,e,n){t.translate=z(e.translate,0,n),t.scale=z(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Pi(t,e,n,s){t.min=z(e.min,n.min,s),t.max=z(e.max,n.max,s)}function Gu(t,e,n,s){Pi(t.x,e.x,n.x,s),Pi(t.y,e.y,n.y,s)}function qu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Xu={duration:.45,ease:[.4,0,.1,1]},ki=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ci=ki("applewebkit/")&&!ki("chrome/")?Math.round:mt;function Ai(t){t.min=Ci(t.min),t.max=Ci(t.max)}function Yu(t){Ai(t.x),Ai(t.y)}function Mr(t,e,n){return t==="position"||t==="preserve-aspect"&&!yu(gi(e),gi(n),.2)}function Zu(t){return t!==t.root&&t.scroll?.wasRoot}const Qu=Sr({attachResizeListener:(t,e)=>ue(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),rn={current:void 0},Pr=Sr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!rn.current){const t=new Qu({});t.mount(window),t.setOptions({layoutScroll:!0}),rn.current=t}return rn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ys=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function ji(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Ju(...t){return e=>{let n=!1;const s=t.map(i=>{const r=ji(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():ji(t[i],null)}}}}function th(...t){return v.useCallback(Ju(...t),t)}class eh extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Se(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=Se(s)&&s.offsetWidth||0,r=Se(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,a.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function nh({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=v.useId(),a=v.useRef(null),c=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:u}=v.useContext(ys),l=t.props?.ref??t?.ref,d=th(a,l);return v.useInsertionEffect(()=>{const{width:f,height:g,top:y,left:b,right:x,bottom:w,direction:S}=c.current;if(e||r===!1||!a.current||!f||!g)return;const T=S==="rtl",P=n==="left"?T?`right: ${x}`:`left: ${b}`:T?`left: ${b}`:`right: ${x}`,V=s==="bottom"?`bottom: ${w}`:`top: ${y}`;a.current.dataset.motionPopId=o;const N=document.createElement("style");u&&(N.nonce=u);const R=i??document.head;return R.appendChild(N),N.sheet&&N.sheet.insertRule(` 2 [data-motion-pop-id="${o}"] { 3 position: absolute !important; 4 width: ${f}px !important; 5 height: ${g}px !important; 6 ${P}px !important; 7 ${V}px !important; 8 } 9 `),()=>{a.current?.removeAttribute("data-motion-pop-id"),R.contains(N)&&R.removeChild(N)}},[e]),h.jsx(eh,{isPresent:e,childRef:a,sizeRef:c,pop:r,children:r===!1?t:v.cloneElement(t,{ref:d})})}const sh=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:c,root:u})=>{const l=Gn(ih),d=v.useId();let f=!0,g=v.useMemo(()=>(f=!1,{id:d,initial:e,isPresent:n,custom:i,onExitComplete:y=>{l.set(y,!0);for(const b of l.values())if(!b)return;s&&s()},register:y=>(l.set(y,!1),()=>l.delete(y))}),[n,l,s]);return r&&f&&(g={...g}),v.useMemo(()=>{l.forEach((y,b)=>l.set(b,!1))},[n]),v.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),t=h.jsx(nh,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),h.jsx($e.Provider,{value:g,children:t})};function ih(){return new Map}function kr(t=!0){const e=v.useContext($e);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=v.useId();v.useEffect(()=>{if(t)return i(r)},[t]);const o=v.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const xe=t=>t.key||"";function Vi(t){const e=[];
vendor: 5,382 bytes, line 9
9return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const xs=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[l,d]=kr(o),f=v.useMemo(()=>Vi(t),[t]),g=o&&!l?[]:f.map(xe),y=v.useRef(!0),b=v.useRef(f),x=Gn(()=>new Map),w=v.useRef(new Set),[S,T]=v.useState(f),[P,V]=v.useState(f);Ji(()=>{y.current=!1,b.current=f;for(let C=0;C<P.length;C++){const _=xe(P[C]);g.includes(_)?(x.delete(_),w.current.delete(_)):x.get(_)!==!0&&x.set(_,!1)}},[P,g.length,g.join("-")]);const N=[];if(f!==S){let C=[...f];for(let _=0;_<P.length;_++){const j=P[_],B=xe(j);g.includes(B)||(C.splice(_,0,j),N.push(j))}return r==="wait"&&N.length&&(C=N),V(Vi(C)),T(f),null}const{forceRender:R}=v.useContext(Hn);return h.jsx(h.Fragment,{children:P.map(C=>{const _=xe(C),j=o&&!l?!1:f===P||g.includes(_),B=()=>{if(w.current.has(_))return;if(x.has(_))w.current.add(_),x.set(_,!0);else return;let W=!0;x.forEach(et=>{et||(W=!1)}),W&&(R?.(),V(b.current),o&&d?.(),s&&s())};return h.jsx(sh,{isPresent:j,initial:!y.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:u,onExitComplete:j?void 0:B,anchorX:a,anchorY:c,children:C},_)})})},Cr=v.createContext({strict:!1}),Ei={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 Ri=!1;function oh(){if(Ri)return;const t={};for(const e in Ei)t[e]={isEnabled:n=>Ei[e].some(s=>!!n[s])};nr(t),Ri=!0}function Ar(){return oh(),Wc()}function rh(t){const e=Ar();for(const n in t)e[n]={...e[n],...t[n]};nr(e)}const ah=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 Oe(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||ah.has(t)}let jr=t=>!Oe(t);function lh(t){typeof t=="function"&&(jr=e=>e.startsWith("on")?!Oe(e):t(e))}try{lh(require("@emotion/is-prop-valid").default)}catch{}function ch(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||ot(t[i])||(jr(i)||n===!0&&Oe(i)||!e&&!Oe(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const He=v.createContext({});function uh(t,e){if(Ke(t)){const{initial:n,animate:s}=t;return{initial:n===!1||ce(n)?n:void 0,animate:ce(s)?s:void 0}}return t.inherit!==!1?e:{}}function hh(t){const{initial:e,animate:n}=uh(t,v.useContext(He));return v.useMemo(()=>({initial:e,animate:n}),[Di(e),Di(n)])}function Di(t){return Array.isArray(t)?t.join(" "):t}const vs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vr(t,e,n){for(const s in e)!ot(e[s])&&!cr(s,n)&&(t[s]=e[s])}function dh({transformTemplate:t},e){return v.useMemo(()=>{const n=vs();return ps(n,e,t),Object.assign({},n.vars,n.style)},[e])}function fh(t,e){const n=t.style||{},s={};return Vr(s,n,t),Object.assign(s,dh(t,e)),s}function mh(t,e){const n={},s=fh(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 Er=()=>({...vs(),attrs:{}});function ph(t,e,n,s){const i=v.useMemo(()=>{const r=Er();return ur(r,e,dr(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Vr(r,t.style,t),i.style={...r,...i.style}}return i}const gh=["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 bs(t){return typeof t!="string"||t.includes("-")?!1:!!(gh.indexOf(t)>-1||/[A-Z]/u.test(t))}function yh(t,e,n,{latestValues:s},i,r=!1,o){const c=(o??bs(t)?ph:mh)(e,s,i,t),u=ch(e,typeof t=="string",r),l=t!==v.Fragment?{...u,...c,ref:n}:{},{children:d}=e,f=v.useMemo(()=>ot(d)?d.get():d,[d]);return v.createElement(t,{...l,children:f})}function xh({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:vh(n,s,i,t),renderState:e()}}function vh(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=je(r[f]);let{initial:o,animate:a}=t;const c=Ke(t),u=tr(t);e&&u&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let l=n?n.initial===!1:!1;l=l||o===!1;const d=l?a:o;if(d&&typeof d!="boolean"&&!ze(d)){const f=Array.isArray(d)?d:[d];for(let g=0;g<f.length;g++){const y=ls(t,f[g]);if(y){const{transitionEnd:b,transition:x,...w}=y;for(const S in w){let T=w[S];if(Array.isArray(T)){const P=l?T.length-1:0;T=T[P]}T!==null&&(i[S]=T)}for(const S in b)i[S]=b[S]}}}return i}const Rr=t=>
vendor: 21,681 bytes, line 9
9(e,n)=>{const s=v.useContext(He),i=v.useContext($e),r=()=>xh(t,e,s,i);return n?r():Gn(r)},bh=Rr({scrapeMotionValuesFromProps:gs,createRenderState:vs}),wh=Rr({scrapeMotionValuesFromProps:fr,createRenderState:Er}),Th=Symbol.for("motionComponentSymbol");function Sh(t,e,n){const s=v.useRef(n);v.useInsertionEffect(()=>{s.current=n});const i=v.useRef(null);return v.useCallback(r=>{r&&t.onMount?.(r),e&&(r?e.mount(r):e.unmount());const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[e])}const Dr=v.createContext({});function Ut(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Mh(t,e,n,s,i,r){const{visualElement:o}=v.useContext(He),a=v.useContext(Cr),c=v.useContext($e),u=v.useContext(ys),l=u.reducedMotion,d=u.skipAnimations,f=v.useRef(null),g=v.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:d,isSVG:r}),g.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const y=f.current,b=v.useContext(Dr);y&&!y.projection&&i&&(y.type==="html"||y.type==="svg")&&Ph(f.current,n,i,b);const x=v.useRef(!1);v.useInsertionEffect(()=>{y&&x.current&&y.update(n,c)});const w=n[$o],S=v.useRef(!!w&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return Ji(()=>{g.current=!0,y&&(x.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),S.current&&y.animationState&&y.animationState.animateChanges())}),v.useEffect(()=>{y&&(!S.current&&y.animationState&&y.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),y.enteringChildren=void 0)}),y}function Ph(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:l,layoutCrossfade:d}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:_r(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&Ut(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:d,layoutScroll:c,layoutRoot:u,layoutAnchor:l})}function _r(t){if(t)return t.options.allowProjection!==!1?t.projection:_r(t.parent)}function an(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&rh(s);const r=n?n==="svg":bs(t),o=r?wh:bh;function a(u,l){let d;const f={...v.useContext(ys),...u,layoutId:kh(u)},{isStatic:g}=f,y=hh(u),b=o(u,g);if(!g&&typeof window<"u"){Ch();const x=Ah(f);d=x.MeasureLayout,y.visualElement=Mh(t,b,f,i,x.ProjectionNode,r)}return h.jsxs(He.Provider,{value:y,children:[d&&y.visualElement?h.jsx(d,{visualElement:y.visualElement,...f}):null,yh(t,u,Sh(b,y.visualElement,l),b,g,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=v.forwardRef(a);return c[Th]=t,c}function kh({layoutId:t}){const e=v.useContext(Hn).id;return e&&t!==void 0?e+"-"+t:t}function Ch(t,e){v.useContext(Cr).strict}function Ah(t){const e=Ar(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function jh(t,e){if(typeof Proxy>"u")return an;const n=new Map,s=(r,o)=>an(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,an(o,void 0,t,e)),n.get(o))})}const Vh=(t,e)=>e.isSVG??bs(t)?new ru(e):new tu(e,{allowProjection:t!==v.Fragment});class Eh extends Rt{constructor(e){super(e),e.animationState||(e.animationState=hu(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ze(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Rh=0;class Dh extends Rt{constructor(){super(...arguments),this.id=Rh++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;if(e&&s===!1){if(this.isExitComplete){const{initial:r,custom:o}=this.node.getProps();if(typeof r=="string"||typeof r=="object"&&r!==null&&!Array.isArray(r)){const a=Bt(this.node,r,o);if(a){const{transition:c,transitionEnd:u,...l}=a;for(const d in l)this.node.getValue(d)?.jump(l[d])}}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 _h={animation:{Feature:Eh},exit:{Feature:Dh}};function pe(t){return{point:{x:t.pageX,y:t.pageY}}}const Nh=t=>e=>hs(e)&&t(e,pe(e));function re(t,e,n,s){return ue(t,e,Nh(n),s)}const Nr=({current:t})=>t?t.ownerDocument.defaultView:null,_i=(t,e)=>Math.abs(t-e);function Lh(t,e){const n=_i(t.x,e.x),s=_i(t.y,e.y);return Math.sqrt(n**2+s**2)}const Ni=new Set(["auto","scroll"]);class Lr{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=g=>{this.handleScroll(g.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ve(this.lastRawMoveEventInfo,this.transformPagePoint));const g=ln(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,b=Lh(g.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!b)return;const{point:x}=g,{timestamp:w}=it;this.history.push({...x,timestamp:w});const{onStart:S,onMove:T}=this.handlers;y||(S&&S(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,g)},this.handlePointerMove=(g,y)=>{this.lastMoveEvent=g,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=ve(y,this.transformPagePoint),K.update(this.updatePoint,!0)},this.handlePointerUp=(g,y)=>{this.end();const{onEnd:b,onSessionEnd:x,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=ln(g.type==="pointercancel"?this.lastMoveEventInfo:ve(y,this.transformPagePoint),this.history);this.startEvent&&b&&b(g,S),x&&x(g,S)},!hs(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const c=pe(e),u=ve(c,this.transformPagePoint),{point:l}=u,{timestamp:d}=it;this.history=[{...l,timestamp:d}];const{onSessionStart:f}=n;f&&f(e,ln(u,this.history)),this.removeListeners=de(re(this.contextWindow,"pointermove",this.handlePointerMove),re(this.contextWindow,"pointerup",this.handlePointerUp),re(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Ni.has(s.overflowX)||Ni.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),K.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Et(this.updatePoint)}}function ve(t,e){return e?{point:e(t.point)}:t}function Li(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ln({point:t},e){return{point:t,delta:Li(t,Ir(e)),offset:Li(t,Ih(e)),velocity:Fh(e,.1)}}function Ih(t){return t[0]}function Ir(t){return t[t.length-1]}function Fh(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Ir(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>ct(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>ct(e)*2&&(s=t[1]);const r=dt(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 Bh(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?z(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?z(n,t,s.max):Math.min(t,n)),t}function Ii(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 Oh(t,{top:e,left:n,bottom:s,right:i}){return{x:Ii(t.x,n,i),y:Ii(t.y,e,s)}}function Fi(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 Uh(t,e){return{x:Fi(t.x,e.x),y:Fi(t.y,e.y)}}function $h(t,e){let n=.5;const s=at(t),i=at(e);return i>s?n=ae(e.min,e.max-s,t.min):s>i&&(n=ae(t.min,t.max-i,e.min)),Mt(0,1,n)}function Wh(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 In=.35;function zh(t=In){return t===!1?t=0:t===!0&&(t=In),{x:Bi(t,"left","right"),y:Bi(t,"top","bottom")}}function Bi(t,e,n){return{min:Oi(t,e),max:Oi(t,n)}}function Oi(t,e){return typeof t=="number"?t:t[e]||0}const Kh=new WeakMap;class Hh{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=tt(),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=d=>{n&&this.snapToCursor(pe(d).point),this.stopAnimation()},o=(d,f)=>{const{drag:g,dragPropagation:y,onDragStart:b}=this.getProps();if(g&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vc(g),!this.openDragLock))return;this.latestPointerEvent=d,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),wt(w=>{let S=this.getAxisMotionValue(w).get()||0;if(St.test(S)){const{projection:T}=this.visualElement;if(T&&T.layout){const P=T.layout.layoutBox[w];P&&(S=at(P)*(parseFloat(S)/100))}}this.originPoint[w]=S}),b&&K.update(()=>b(d,f),!1,!0),Cn(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:b,onDrag:x}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:w}=f;if(y&&this.currentDirection===null){this.currentDirection=qh(w),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),x&&K.update(()=>x(d,f),!1,!0)},c=(d,f)=>{this.latestPointerEvent=d,this.latestPanInfo=f,this.stop(d,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:d}=this.getProps();(d||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Lr(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Nr(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&&K.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||!be(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=Bh(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&Ut(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=Oh(s.layoutBox,e):this.constraints=!1,this.elastic=zh(n),i!==this.constraints&&!Ut(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&wt(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Wh(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ut(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());const r=qc(s,i.root,this.visualElement.getTransformPagePoint());let o=Uh(i.layout.layoutBox,r);if(n){const a=n(Kc(o));this.hasMutatedConstraints=!!a,a&&(o=ir(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=wt(l=>{if(!be(l,n,this.currentDirection))return;let d=c&&c[l]||{};(o===!0||o===l)&&(d={min:0,max:0});const f=i?200:1e6,g=i?40:1e7,y={type:"inertia",velocity:s?e[l]:0,bounceStiffness:f,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...r,...d};return this.startAxisValueAnimation(l,y)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Cn(this.visualElement,e),s.start(as(e,s,0,n,this.visualElement,!1))}stopAnimation(){wt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){wt(n=>{const{drag:s}=this.getProps();if(!be(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],c=r.get()||0;r.set(e[n]-z(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Ut(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};wt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=$h({min:c,max:c},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(),wt(o=>{if(!be(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(z(c,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Kh.set(this.visualElement,this);const e=this.visualElement.current,n=re(e,"pointerdown",u=>{const{drag:l,dragListener:d=!0}=this.getProps(),f=u.target,g=f!==e&&Pc(f);l&&d&&!g&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();Ut(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=Gh(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),K.read(i);const a=ue(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(wt(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=u[d].translate,f.set(f.get()+u[d].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),c&&c(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=In,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Ui(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Gh(t,e,n){const s=qs(t,Ui(n)),i=qs(e,Ui(n));return()=>{s(),i()}}function be(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function qh(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Xh extends Rt{constructor(e){super(e),this.removeGroupControls=mt,this.removeListeners=mt,this.controls=new Hh(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mt}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 cn=t=>(e,n)=>{t&&K.update(()=>t(e,n),!1,!0)};class Yh extends Rt{constructor(){super(...arguments),this.removePointerDownListener=mt}onPointerDown(e){this.session=new Lr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Nr(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:cn(e),onStart:cn(n),onMove:cn(s),onEnd:(r,o)=>{delete this.session,i&&K.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=re(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 un=!1;class Zh extends v.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),un&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ve.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}),un=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||K.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(),us.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;un=!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 Fr(t){const[e,n]=kr(),s=v.useContext(Hn);return h.jsx(Zh,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(Dr),isPresent:e,safeToRemove:n})}const Qh={pan:{Feature:Yh},drag:{Feature:Xh,ProjectionNode:Pr,MeasureLayout:Fr}};function $i(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&&K.postRender(()=>r(e,pe(e)))}class Jh extends Rt{mount(){const{current:e}=this.node;e&&(this.unmount=wc(e,(n,s)=>($i(this.node,s,"Start"),i=>$i(this.node,i,"End"))))}unmount(){}}class td extends Rt{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=de(ue(this.node.current,"focus",()=>this.onFocus()),ue(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wi(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&&K.postRender(()=>r(e,pe(e)))}class ed extends Rt{mount(){const{current:e}=this.node;if(!e)return;
9const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Cc(e,(i,r)=>(Wi(this.node,r,"Start"),(o,{success:a})=>Wi(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const Fn=new WeakMap,hn=new WeakMap,nd=t=>{const e=Fn.get(t.target);e&&e(t)},sd=t=>{t.forEach(nd)};function id({root:t,...e}){const n=t||document;hn.has(n)||hn.set(n,{});const s=hn.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(sd,{root:t,...e})),s[i]}function od(t,e,n){const s=id(e);return Fn.set(t,n),s.observe(t),()=>{Fn.delete(t),s.unobserve(t)}}const rd={some:0,all:1};class ad extends Rt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();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:rd[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:l,onViewportLeave:d}=this.node.getProps(),f=u?l:d;f&&f(c)};this.stopObserver=od(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(ld(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function ld({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const cd={inView:{Feature:ad},tap:{Feature:ed},focus:{Feature:td},hover:{Feature:Jh}},ud={layout:{ProjectionNode:Pr,MeasureLayout:Fr}},hd={..._h,...cd,...Qh,...ud},ut=jh(hd,Vh);var ws={};(function t(e,n,s,i){var r=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",a=(function(){if(!e.OffscreenCanvas)return!1;try{var p=new OffscreenCanvas(1,1),m=p.getContext("2d");m.fillRect(0,0,1,1);var M=p.transferToImageBitmap();m.createPattern(M,"no-repeat")}catch{return!1}return!0})();function c(){}function u(p){var m=n.exports.Promise,M=m!==void 0?m:e.Promise;return typeof M=="function"?new M(p):(p(c,c),null)}var l=(function(p,m){return{transform:function(M){if(p)return M;if(m.has(M))return m.get(M);var k=new OffscreenCanvas(M.width,M.height),D=k.getContext("2d");return D.drawImage(M,0,0),m.set(M,k),k},clear:function(){m.clear()}}})(a,new Map),d=(function(){var p=Math.floor(16.666666666666668),m,M,k={},D=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(m=function(L){var F=Math.random();return k[F]=requestAnimationFrame(function E(I){D===I||D+p-1<I?(D=I,delete k[F],L()):k[F]=requestAnimationFrame(E)}),F},M=function(L){k[L]&&cancelAnimationFrame(k[L])}):(m=function(L){return setTimeout(L,p)},M=function(L){return clearTimeout(L)}),{frame:m,cancel:M}})(),f=(function(){var p,m,M={};function k(D){function L(F,E){D.postMessage({options:F||{},callback:E})}D.init=function(E){var I=E.transferControlToOffscreen();D.postMessage({canvas:I},[I])},D.fire=function(E,I,O){if(m)return L(E,null),m;var G=Math.random().toString(36).slice(2);return m=u(function($){function q(st){st.data.callback===G&&(delete M[G],D.removeEventListener("message",q),m=null,l.clear(),O(),$())}D.addEventListener("message",q),L(E,G),M[G]=q.bind(null,{data:{callback:G}})}),m},D.reset=function(){D.postMessage({reset:!0});for(var E in M)M[E](),delete M[E]}}return function(){if(p)return p;if(!s&&r){var D=["var CONFETTI, SIZE = {}, module = {};","("+t.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` 10`);
vendor: 3,852 bytes, line 10
10try{p=new Worker(URL.createObjectURL(new Blob([D])))}catch(L){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("ð Could not load worker",L),null}k(p)}return p}})(),g={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function y(p,m){return m?m(p):p}function b(p){return p!=null}function x(p,m,M){return y(p&&b(p[m])?p[m]:g[m],M)}function w(p){return p<0?0:Math.floor(p)}function S(p,m){return Math.floor(Math.random()*(m-p))+p}function T(p){return parseInt(p,16)}function P(p){return p.map(V)}function V(p){var m=String(p).replace(/[^0-9a-f]/gi,"");return m.length<6&&(m=m[0]+m[0]+m[1]+m[1]+m[2]+m[2]),{r:T(m.substring(0,2)),g:T(m.substring(2,4)),b:T(m.substring(4,6))}}function N(p){var m=x(p,"origin",Object);return m.x=x(m,"x",Number),m.y=x(m,"y",Number),m}function R(p){p.width=document.documentElement.clientWidth,p.height=document.documentElement.clientHeight}function C(p){var m=p.getBoundingClientRect();p.width=m.width,p.height=m.height}function _(p){var m=document.createElement("canvas");return m.style.position="fixed",m.style.top="0px",m.style.left="0px",m.style.pointerEvents="none",m.style.zIndex=p,m}function j(p,m,M,k,D,L,F,E,I){p.save(),p.translate(m,M),p.rotate(L),p.scale(k,D),p.arc(0,0,1,F,E,I),p.restore()}function B(p){var m=p.angle*(Math.PI/180),M=p.spread*(Math.PI/180);return{x:p.x,y:p.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:p.startVelocity*.5+Math.random()*p.startVelocity,angle2D:-m+(.5*M-Math.random()*M),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:p.color,shape:p.shape,tick:0,totalTicks:p.ticks,decay:p.decay,drift:p.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:p.gravity*3,ovalScalar:.6,scalar:p.scalar,flat:p.flat}}function W(p,m){m.x+=Math.cos(m.angle2D)*m.velocity+m.drift,m.y+=Math.sin(m.angle2D)*m.velocity+m.gravity,m.velocity*=m.decay,m.flat?(m.wobble=0,m.wobbleX=m.x+10*m.scalar,m.wobbleY=m.y+10*m.scalar,m.tiltSin=0,m.tiltCos=0,m.random=1):(m.wobble+=m.wobbleSpeed,m.wobbleX=m.x+10*m.scalar*Math.cos(m.wobble),m.wobbleY=m.y+10*m.scalar*Math.sin(m.wobble),m.tiltAngle+=.1,m.tiltSin=Math.sin(m.tiltAngle),m.tiltCos=Math.cos(m.tiltAngle),m.random=Math.random()+2);var M=m.tick++/m.totalTicks,k=m.x+m.random*m.tiltCos,D=m.y+m.random*m.tiltSin,L=m.wobbleX+m.random*m.tiltCos,F=m.wobbleY+m.random*m.tiltSin;if(p.fillStyle="rgba("+m.color.r+", "+m.color.g+", "+m.color.b+", "+(1-M)+")",p.beginPath(),o&&m.shape.type==="path"&&typeof m.shape.path=="string"&&Array.isArray(m.shape.matrix))p.fill(Pt(m.shape.path,m.shape.matrix,m.x,m.y,Math.abs(L-k)*.1,Math.abs(F-D)*.1,Math.PI/10*m.wobble));else if(m.shape.type==="bitmap"){var E=Math.PI/10*m.wobble,I=Math.abs(L-k)*.1,O=Math.abs(F-D)*.1,G=m.shape.bitmap.width*m.scalar,$=m.shape.bitmap.height*m.scalar,q=new DOMMatrix([Math.cos(E)*I,Math.sin(E)*I,-Math.sin(E)*O,Math.cos(E)*O,m.x,m.y]);q.multiplySelf(new DOMMatrix(m.shape.matrix));var st=p.createPattern(l.transform(m.shape.bitmap),"no-repeat");st.setTransform(q),p.globalAlpha=1-M,p.fillStyle=st,p.fillRect(m.x-G/2,m.y-$/2,G,$),p.globalAlpha=1}else if(m.shape==="circle")p.ellipse?p.ellipse(m.x,m.y,Math.abs(L-k)*m.ovalScalar,Math.abs(F-D)*m.ovalScalar,Math.PI/10*m.wobble,0,2*Math.PI):j(p,m.x,m.y,Math.abs(L-k)*m.ovalScalar,Math.abs(F-D)*m.ovalScalar,Math.PI/10*m.wobble,0,2*Math.PI);else if(m.shape==="star")for(var U=Math.PI/2*3,lt=4*m.scalar,pt=8*m.scalar,gt=m.x,kt=m.y,Dt=5,bt=Math.PI/Dt;Dt--;)gt=m.x+Math.cos(U)*pt,kt=m.y+Math.sin(U)*pt,p.lineTo(gt,kt),U+=bt,gt=m.x+Math.cos(U)*lt,kt=m.y+Math.sin(U)*lt,p.lineTo(gt,kt),U+=bt;else p.moveTo(Math.floor(m.x),Math.floor(m.y)),p.lineTo(Math.floor(m.w
10obbleX),Math.floor(D)),p.lineTo(Math.floor(L),Math.floor(F)),p.lineTo(Math.floor(k),Math.floor(m.wobbleY));return p.closePath(),p.fill(),m.tick<m.totalTicks}function et(p,m,M,k,D){var L=m.slice(),F=p.getContext("2d"),E,I,O=u(function(G){function $(){E=I=null,F.clearRect(0,0,k.width,k.height),l.clear(),D(),G()}function q(){s&&!(k.width===i.width&&k.height===i.height)&&(k.width=p.width=i.width,k.height=p.height=i.height),!k.width&&!k.height&&(M(p),k.width=p.width,k.height=p.height),F.clearRect(0,0,k.width,k.height),L=L.filter(function(st){return W(F,st)}),L.length?E=d.frame(q):$()}E=d.frame(q),I=$});return{addFettis:function(G){return L=L.concat(G),O},canvas:p,promise:O,reset:function(){E&&d.cancel(E),I&&I()}}}function X(p,m){var M=!p,k=!!x(m||{},"resize"),D=!1,L=x(m,"disableForReducedMotion",Boolean),F=r&&!!x(m||{},"useWorker"),E=F?f():null,I=M?R:C,O=p&&E?!!p.__confetti_initialized:!1,G=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,$;function q(U,lt,pt){for(var gt=x(U,"particleCount",w),kt=x(U,"angle",Number),Dt=x(U,"spread",Number),bt=x(U,"startVelocity",Number),Wr=x(U,"decay",Number),zr=x(U,"gravity",Number),Kr=x(U,"drift",Number),Ss=x(U,"colors",P),Hr=x(U,"ticks",Number),Ms=x(U,"shapes"),Gr=x(U,"scalar"),qr=!!x(U,"flat"),Ps=N(U),ks=gt,qe=[],Xr=p.width*Ps.x,Yr=p.height*Ps.y;ks--;)qe.push(B({x:Xr,y:Yr,angle:kt,spread:Dt,startVelocity:bt,color:Ss[ks%Ss.length],shape:Ms[S(0,Ms.length)],ticks:Hr,decay:Wr,gravity:zr,drift:Kr,scalar:Gr,flat:qr}));return $?$.addFettis(qe):($=et(p,qe,I,lt,pt),$.promise)}function st(U){var lt=L||x(U,"disableForReducedMotion",Boolean),pt=x(U,"zIndex",Number);if(lt&&G)return u(function(bt){bt()});M&&$?p=$.canvas:M&&!p&&(p=_(pt),document.body.appendChild(p)),k&&!O&&I(p);var gt={width:p.width,height:p.height};E&&!O&&E.init(p),O=!0,E&&(p.__confetti_initialized=!0);function kt(){if(E){var bt={getBoundingClientRect:function(){if(!M)return p.getBoundingClientRect()}};I(bt),E.postMessage({resize:{width:bt.width,height:bt.height}});return}gt.width=gt.height=null}function Dt(){$=null,k&&(D=!1,e.removeEventListener("resize",kt)),M&&p&&(document.body.contains(p)&&document.body.removeChild(p),p=null,O=!1)}return k&&!D&&(D=!0,e.addEventListener("resize",kt,!1)),E?E.fire(U,gt,Dt):q(U,gt,Dt)}return st.reset=function(){E&&E.reset(),$&&$.reset()},st}var Z;function nt(){return Z||(Z=X(null,{useWorker:!0,resize:!0})),Z}function Pt(p,m,M,k,D,L,F){var E=new Path2D(p),I=new Path2D;I.addPath(E,new DOMMatrix(m));var O=new Path2D;return O.addPath(I,new DOMMatrix([Math.cos(F)*D,Math.sin(F)*D,-Math.sin(F)*L,Math.cos(F)*L,M,k])),O}function H(p){if(!o)throw new Error("path confetti are not supported in this browser");var m,M;typeof p=="string"?m=p:(m=p.path,M=p.matrix);var k=new Path2D(m),D=document.createElement("canvas"),L=D.getContext("2d");if(!M){for(var F=1e3,E=F,I=F,O=0,G=0,$,q,st=0;st<F;st+=2)for(var U=0;U<F;U+=2)L.isPointInPath(k,st,U,"nonzero")&&(E=Math.min(E,st),I=Math.min(I,U),O=Math.max(O,st),G=Math.max(G,U));$=O-E,q=G-I;var lt=10,pt=Math.min(lt/$,lt/q);M=[pt,0,0,pt,-Math.round($/2+E)*pt,-Math.round(q/2+I)*pt]}return{type:"path",path:m,matrix:M}}function Q(p){var m,M=1,k="#000000",D='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof p=="string"?m=p:(m=p.text,M="scalar"in p?p.scalar:M,D="fontFamily"in p?p.fontFamily:D,k="color"in p?p.color:k);var L=10*M,F=""+L+"px "+D,E=new OffscreenCanvas(L,L),I=E.getContext("2d");I.font=F;var O=I.measureText(m),G=Math.ceil(O.actualBoundingBoxRight+O.actualBoundingBoxLeft),$=Math.ceil(O.actualBoundingBoxAscent+O.actualBoundingBoxDescent),q=2,st=O.actualBoundingBoxLeft+q,U=O.actualBoundingBoxAscent+q;G+=q+q,$+=q+q,E=new OffscreenCanvas(G,$),I=E.getContext("2d"),I.font=F,I.fillStyle=k,I.fillText(m,st,U);var lt=1/M;return{type:"bitmap",bitmap:E.transferToImageBitmap(),matrix:[lt,0,0,lt,-G*lt/2,-$*lt/2]}}n.exports=function(){return nt().apply(this,arguments)},n.exports.reset=function(){nt().reset()},n.exports.create=X,n.exports.shapeFromPath=H,n.exports.shapeFromText=Q})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),ws,!1);const dn=ws.exports;ws.exports.create;const dd=["CBT","DBT","ACT","EMDR","IFS","Psychodynamic","Humanistic / Person-Centered","Solution-Focused Brief Therapy","Schema Therapy","Motivational Interviewing","Trauma-Focused CBT","Polyvagal-informed"],fd=["intern","licensed","expert"],md=Bn({method:"POST"}).middleware([On]).handler(Un("63ad145f9d4b516b4e574e8b770a5fe5e368e7947d8d6eb506e5e10544f3e36d")),Ts=Bn({method:"POST"}).middleware([On]).handler(Un("68f5bc32480ed7a29b016407f7a079f7eb8eb025bd8f4de16f9ba0f2234901b2")),pd=Bn({method:"POST"}).middleware([On]).handler(Un("e960f5e62c13693ae44d04b4579dc819f2d342e7b1aa19ac206413692de71294")),Br="mm:audio:muted:v1";let we=null;function gd(){if(typeof window>"u")return null;if(we)return we;try{const t=window.AudioContext||window.webkitAudioContext;return t?(we=new t,we):null}catch{return null}}function Or(){return typeof window>"u"?!1:window.localStorage.getItem(Br)==="1"}function yd(t){typeof window>"u"||window.localStorage.setItem(Br,t?"1":"0")}function ht(t,e,n="sine",s=.08,i=0){if(Or())return;const r=gd();if(!r)return;const o=r.currentTime+i/1e3,a=r.createOscillator(),c=r.createGain();a.type=n,a.frequency.setValueAtTime(t,o),c.gain.setValueAtTime(0,o),c.gain.linearRampToValueAtTime(s,o+.01),c.gain.exponentialRampToValueAtTime(1e-4,o+e/1e3),a.connect(c).connect(r.destination),a.start(o),a.stop(o+e/1e3+.02)}const ft={correct(){ht(660,120,"triangle",.07),ht(990,180,"triangle",.06,90)},wrong(){ht(220,220,"sawtooth",.06),ht(160,260,"sawtooth",.05,80)},tick(){ht(540,60,"square",.03)},win(){ht(523,140,"triangle",.07),ht(659,140,"triangle",.07,130),ht(784,220,"triangle",.08,260),ht(1047,320,"triangle",.08,420)},lose(){ht(392,180,"triangle",.06),ht(311,220,"triangle",.06,160),ht(247,300,"triangle",.06,340)}};function Ur(){if(typeof window>"u")return;const t=["#7cf2d8","#a4f08a","#5fd0e5","#ffffff"];dn({particleCount:90,spread:70,origin:{y:.6},colors:t,disableForReducedMotion:!0}
10),setTimeout(()=>dn({particleCount:60,angle:60,spread:55,origin:{x:0,y:.7},colors:t,disableForReducedMotion:!0}),180),setTimeout(()=>dn({particleCount:60,angle:120,spread:55,origin:{x:1,y:.7},colors:t,disableForReducedMotion:!0}),320)}function xd({title:t,subtitle:e,won:n,primaryLabel:s,onPrimary:i,onClose:r}){return h.jsx(ut.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 grid place-items-center bg-[oklch(0.08_0.03_215/0.8)] backdrop-blur-sm px-4",onClick:r,children:h.jsxs(ut.div,{initial:{scale:.9,y:12,opacity:0},animate:{scale:1,y:0,opacity:1},exit:{scale:.95,opacity:0},transition:{type:"spring",stiffness:280,damping:22},onClick:o=>o.stopPropagation(),className:"relative w-full max-w-sm rounded-3xl border border-[oklch(0.88_0.20_140/0.4)] bg-[oklch(0.14_0.04_215/0.95)] p-8 text-center shadow-2xl",children:[h.jsx("div",{className:`mx-auto mb-4 inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-gradient-to-br ${n?"from-[oklch(0.88_0.20_140)] to-[oklch(0.78_0.16_200)]":"from-[oklch(0.78_0.16_200)] to-[oklch(0.62_0.10_215)]"} text-[oklch(0.14_0.04_215)]`,children:h.jsx(Wn,{className:"h-7 w-7"})}),h.jsx("div",{className:"text-[10px] uppercase tracking-[0.3em] text-muted-foreground",children:"Match complete"}),h.jsx("h2",{className:"mm-display text-4xl mt-1",children:h.jsx("span",{className:"mm-gradient-text",children:t})}),h.jsx("p",{className:"mt-2 text-base text-foreground/90",children:e}),h.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[h.jsxs("button",{onClick:i,className:"mm-btn-primary justify-center",children:[s," ",h.jsx(Kt,{className:"h-4 w-4"})]}),h.jsx("button",{onClick:r,className:"text-xs text-muted-foreground hover:text-foreground uppercase tracking-widest",children:"View board"})]})]})})}const $r="mm:stats:v1";function vd(){if(typeof window>"u")return{xp:0,streak:0,best:0};try{return{xp:0,streak:0,best:0,...JSON.parse(localStorage.getItem($r)||"{}")}}catch{return{xp:0,streak:0,best:0}}}function bd(t){typeof window<"u"&&localStorage.setItem($r,JSON.stringify(t))}function Bd(){const t=Zr(),[e,n]=v.useState(null),[s,i]=v.useState("home"),[r,o]=v.useState(()=>vd()),[a,c]=v.useState("licensed");v.useEffect(()=>{Qr("route:/mind-masters")},[]),v.useEffect(()=>{let l=!0;Cs.auth.getSession().then(({data:f})=>{l&&n(!!f.session)});const{data:d}=Cs.auth.onAuthStateChange((f,g)=>n(!!g));return()=>{l=!1,d.subscription.unsubscribe()}},[]),v.useEffect(()=>{bd(r)},[r]);function u(l,d){o(f=>{if(l){const g=f.streak+1,y=Math.min(g,10)*2;return{xp:f.xp+d+y,streak:g,best:Math.max(f.best,g)}}return{...f,streak:0}})}return e===!1?h.jsxs("div",{className:"mm-scope min-h-dvh grid place-items-center text-center px-6",children:[h.jsx(zi,{}),h.jsxs("div",{className:"relative max-w-md",children:[h.jsx("h1",{className:"mm-title text-4xl mb-3",children:"Mind Masters"}),h.jsx("p",{className:"text-muted-foreground mb-6",children:"Sign in to start training. Your XP and streak save to this device."}),h.jsxs("button",{onClick:()=>t({to:"/login",search:{next:"/home"}}),className:"mm-btn-primary",children:["Sign in to play ",h.jsx(Kt,{className:"h-4 w-4"})]}),h.jsx("div",{className:"mt-3",children:h.jsx($n,{to:"/home",className:"text-sm text-muted-foreground hover:text-foreground",children:"â Back to hub"})})]})]}):h.jsxs("div",{className:"mm-scope relative min-h-dvh text-foreground",children:[h.jsx(zi,{}),h.jsx(wd,{stats:r,onHome:()=>i("home")}),h.jsx("main",{className:"relative mx-auto max-w-7xl px-4 pb-24 pt-6 md:px-8",children:h.jsxs(xs,{mode:"wait",children:[s==="home"&&h.jsx(ut.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.25},children:h.jsx(Td,{difficulty:a,setDifficulty:c,onPick:l=>i(l)})},"home"),s==="case"&&h.jsx(Sd,{difficulty:a,onExit:()=>i("home"),onScore:l=>u(l,10)},"case"),s==="quiz"&&h.jsx(Md,{difficulty:a,onExit:()=>i("home"),onScore:l=>u(l,5)},"quiz"),s==="model"&&h.jsx(Pd,{onExit:()=>i("home")},"model"),s==="vsai"&&h.jsx(Cd,{difficulty:a,onExit:()=>i("home"),onScore:l=>u(l,8)},"vsai"),s==="team"&&h.jsx(Ad,{difficulty:a,onExit:()=>i("home"),onScore:l=>u(l,8)},"team")]})})]})}
10function zi(){return h.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0 -z-10 overflow-hidden bg-[oklch(0.12_0.03_215)]",children:[h.jsx("div",{className:"absolute inset-0 mm-grid opacity-50"}),h.jsx("div",{className:"absolute -top-40 left-1/2 h-[42rem] w-[42rem] -translate-x-1/2 rounded-full bg-[oklch(0.78_0.16_200/0.22)] blur-3xl animate-pulse-glow"}),h.jsx("div",{className:"absolute bottom-0 -left-32 h-[28rem] w-[28rem] rounded-full bg-[oklch(0.78_0.16_180/0.18)] blur-3xl animate-pulse-glow",style:{animationDelay:"2s"}}),h.jsx("div",{className:"absolute top-1/3 -right-32 h-[28rem] w-[28rem] rounded-full bg-[oklch(0.85_0.18_160/0.14)] blur-3xl animate-pulse-glow",style:{animationDelay:"4s"}})]})}function wd({stats:t,onHome:e}){const[n,s]=v.useState(()=>Or());function i(){const r=!n;yd(r),s(r)}return h.jsx("header",{className:"relative z-10 border-b border-[oklch(0.78_0.16_200/0.15)] backdrop-blur-xl",children:h.jsxs("div",{className:"mx-auto flex max-w-7xl items-center justify-between px-4 py-4 md:px-8",children:[h.jsxs("button",{onClick:e,className:"flex items-center gap-3 group",children:[h.jsx("img",{src:Jr,alt:"Mind Masters logo",className:"h-10 w-10 rounded-full object-contain drop-shadow-[0_0_24px_oklch(0.78_0.16_200/0.65)]"}),h.jsxs("div",{className:"leading-tight text-left",children:[h.jsx("div",{className:"mm-title text-lg md:text-xl",children:"Mind Masters"}),h.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground",children:"Master the mind. Master the game."})]})]}),h.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[h.jsx(fn,{icon:Wn,label:"XP",value:t.xp,accent:"cyan"}),h.jsx(fn,{icon:ua,label:"Streak",value:t.streak,accent:"lime"}),h.jsx(fn,{icon:Kn,label:"Best",value:t.best,accent:"teal"}),h.jsx("button",{onClick:i,"aria-label":n?"Unmute sound effects":"Mute sound effects",title:n?"Sound off":"Sound on",className:"rounded-xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.5)] p-2 backdrop-blur text-muted-foreground hover:text-foreground transition",children:n?h.jsx(fa,{className:"h-4 w-4"}):h.jsx(ia,{className:"h-4 w-4"})}),h.jsxs($n,{to:"/home",className:"ml-1 hidden md:inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[h.jsx(Hi,{className:"h-3.5 w-3.5"})," Hub"]})]})]})})}function fn({icon:t,label:e,value:n,accent:s}){const i=s==="cyan"?"text-[oklch(0.85_0.16_200)]":s==="lime"?"text-[oklch(0.88_0.20_140)]":"text-[oklch(0.82_0.14_180)]";return h.jsxs("div",{className:"rounded-xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.5)] px-3 py-1.5 backdrop-blur",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(t,{className:`h-3.5 w-3.5 ${i}`}),h.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:e})]}),h.jsx("div",{className:`font-display text-lg font-bold leading-none ${i}`,children:n})]})}function Td({difficulty:t,setDifficulty:e,onPick:n}){const s=[{id:"case",icon:Yi,title:"Case Mode",blurb:"Clinical vignettes with multiple-choice decision points. +10 XP per correct.",accent:"from-[oklch(0.78_0.16_200)] to-[oklch(0.72_0.14_195)]"},{id:"quiz",icon:Kn,title:"Quiz Mode",blurb:"Rapid-fire knowledge across therapy models. +5 XP per correct, streak bonuses stack.",accent:"from-[oklch(0.88_0.20_140)] to-[oklch(0.78_0.16_180)]"},{id:"model",icon:Zi,title:"Model Mode",blurb:"Deep dive into a therapy model: techniques, evidence base, cautions, and a mnemonic.",accent:"from-[oklch(0.82_0.14_180)] to-[oklch(0.78_0.16_200)]"},{id:"vsai",icon:Qi,title:"Vs AI",blurb:"Race the AI on rapid-fire questions. Beat the bot to the right answer for +8 XP.",accent:"from-[oklch(0.85_0.18_30)] to-[oklch(0.78_0.16_200)]"},{id:"team",icon:ee,title:"Team Mode",blurb:"Form a study squad, share a room code, and out-score other teams. Beta soon.",accent:"from-[oklch(0.88_0.20_140)] to-[oklch(0.82_0.14_180)]"}];return h.jsxs("section",{children:[h.jsxs("div",{className:"text-center mt-6 mb-10",children:[h.jsx(ut.h1,{initial:{opacity:0,y:10}
10,animate:{opacity:1,y:0},className:"mm-display text-5xl md:text-7xl",children:h.jsx("span",{className:"mm-gradient-text",children:"Mind Masters"})}),h.jsxs("p",{className:"mt-3 text-base md:text-lg text-muted-foreground",children:["Master the mind. ",h.jsx("span",{className:"text-foreground/90",children:"Master the game."})]}),h.jsx("div",{className:"mt-6 inline-flex items-center gap-1 rounded-full border border-[oklch(0.78_0.16_200/0.25)] bg-[oklch(0.16_0.04_215/0.6)] p-1 backdrop-blur",children:fd.map(i=>h.jsx("button",{onClick:()=>e(i),className:`px-4 py-1.5 text-xs font-semibold uppercase tracking-wider rounded-full transition ${t===i?"bg-gradient-to-r from-[oklch(0.78_0.16_200)] to-[oklch(0.88_0.20_140)] text-[oklch(0.14_0.04_215)]":"text-muted-foreground hover:text-foreground"}`,"aria-pressed":t===i,children:i},i))})]}),h.jsx("div",{className:"grid gap-5 md:grid-cols-3",children:s.map((i,r)=>{const o=i.icon;return h.jsxs(ut.button,{onClick:()=>n(i.id),initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.05*r,duration:.35},whileHover:{y:-4},whileTap:{scale:.98},className:"group relative overflow-hidden rounded-2xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.55)] p-6 text-left backdrop-blur transition focus:outline-none focus-visible:ring-2 focus-visible:ring-[oklch(0.88_0.20_140)]",children:[h.jsx("div",{className:`absolute inset-x-0 -top-px h-px bg-gradient-to-r ${i.accent} opacity-80`}),h.jsx("div",{className:`mb-4 inline-flex h-12 w-12 items-center justify-center rounded-xl bg-gradient-to-br ${i.accent} text-[oklch(0.14_0.04_215)]`,children:h.jsx(o,{className:"h-6 w-6"})}),h.jsx("h2",{className:"mm-title text-xl mb-1",children:i.title}),h.jsx("p",{className:"text-sm text-muted-foreground",children:i.blurb}),h.jsxs("div",{className:"mt-4 inline-flex items-center gap-1 text-xs font-semibold text-[oklch(0.88_0.20_140)]",children:["Start ",h.jsx(Kt,{className:"h-4 w-4 transition group-hover:translate-x-0.5"})]})]},i.id)})}),h.jsx("p",{className:"mt-10 text-center text-xs text-muted-foreground",children:"Powered by Lovable AI. Items generated each round â no two sessions are identical."})]})}function Sd({difficulty:t,onExit:e,onScore:n}){const s=At(md),[i,r]=v.useState(!0),[o,a]=v.useState(null),[c,u]=v.useState(null),[l,d]=v.useState(0),[f,g]=v.useState(null),[y,b]=v.useState(!1);async function x(){r(!0),a(null),u(null),d(0),g(null),b(!1);try{const T=await s({data:{difficulty:t,seed:Math.random().toString(36).slice(2)}});u(T)}catch(T){a(T instanceof Error?T.message:"Failed to load case")}finally{r(!1)}}v.useEffect(()=>{x()},[]);function w(T){if(!y&&(g(T),b(!0),c)){const P=T===c.questions[l].correctIndex;P?ft.correct():ft.wrong(),n(P)}}function S(){c&&(l+1<c.questions.length?(d(l+1),g(null),b(!1)):x())}return h.jsxs(ut.section,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},children:[h.jsx(qt,{title:"Case Mode",icon:Yi,onExit:e,onReload:x,loading:i}),i&&h.jsx(Xt,{label:"Generating clinical caseâ¦"}),o&&h.jsx(Yt,{error:o,onRetry:x}),c&&!i&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"rounded-2xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.55)] p-6 backdrop-blur",children:[h.jsxs("div",{className:"mb-2 inline-flex items-center gap-2 rounded-full bg-[oklch(0.78_0.16_200/0.15)] px-3 py-1 text-[10px] font-bold uppercase tracking-widest text-[oklch(0.85_0.16_200)]",children:[h.jsx(ta,{className:"h-3 w-3"})," ",c.model]}),h.jsx("h2",{className:"mm-title text-2xl mb-3",children:c.title}),h.jsx("p",{className:"text-sm leading-relaxed text-foreground/90 whitespace-pre-wrap",children:c.vignette})]}),h.jsx(Ge,{qIndex:l,total:c.questions.length,question:c.questions[l],picked:f,revealed:y,onPick:w,onNext:S,nextLabel:l+1<c.questions.length?"Next question":"New case"})]})]})}function Md({difficulty:t,onExit:e,onScore:n}){const s=At(Ts),[i,r]=v.useState(!0),[o,a]=v.useState(null),[c,u]=v.useState([]),[l,d]=v.useState(0),[f,g]=v.useState(null),[y,b]=v.useState(!1),[x,w]=v.useState(0);async function S(){r(!0),a(null),u([]),d(0),g(null),b(!1),w(0);try{const{items:R}=await s({data:{difficulty:t,count:3,seed:Math.random().toString(36).slice(2)}});u(R)}catch(R){a(R instanceof Error?R.message:"Failed to load quiz")}finally{r(!1)}}v.useEffect(()=>{S()},[]);function T(R){if(y||!c.length)return;g(R),b(!0);const C=R===c[l].correctIndex;C&&w(_=>_+1),C?ft.correct():ft.wrong(),n(C)}function P(){l+1<c.length?(d(l+1),g(null),b(!1)):S()}const V=c[l],N=c.length>0&&l+1>=c.length;return h.jsxs(ut.section,{initial:{opacity:0,y:12}
10,animate:{opacity:1,y:0},exit:{opacity:0,y:-8},children:[h.jsx(qt,{title:"Quiz Mode",icon:Kn,onExit:e,onReload:S,loading:i}),i&&h.jsx(Xt,{label:"Loading quiz roundâ¦"}),o&&h.jsx(Yt,{error:o,onRetry:S}),V&&!i&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[h.jsxs("span",{children:["Question ",l+1," / ",c.length]}),h.jsx("span",{className:"rounded-full bg-[oklch(0.78_0.16_200/0.15)] px-2 py-0.5 text-[10px] font-bold uppercase tracking-widest text-[oklch(0.85_0.16_200)]",children:V.model})]}),h.jsx("div",{className:"h-1 w-full overflow-hidden rounded-full bg-[oklch(0.16_0.04_215)]",children:h.jsx(ut.div,{className:"h-full bg-gradient-to-r from-[oklch(0.78_0.16_200)] to-[oklch(0.88_0.20_140)]",animate:{width:`${(l+(y?1:0))/c.length*100}%`},transition:{duration:.4}})}),h.jsx(Ge,{qIndex:l,total:c.length,question:V,picked:f,revealed:y,onPick:T,onNext:P,nextLabel:N?`New round (${x}/${c.length})`:"Next"})]})]})}function Pd({onExit:t}){const e=At(pd),[n,s]=v.useState(null),[i,r]=v.useState(!1),[o,a]=v.useState(null),[c,u]=v.useState(null);async function l(d){s(d),r(!0),a(null),u(null);try{const f=await e({data:{model:d}});u(f)}catch(f){a(f instanceof Error?f.message:"Failed to load")}finally{r(!1)}}return h.jsxs(ut.section,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},children:[h.jsx(qt,{title:"Model Mode",icon:Zi,onExit:t,onReload:()=>n&&l(n),loading:i}),h.jsx("div",{className:"mb-6 flex flex-wrap gap-2",children:dd.map(d=>h.jsx("button",{onClick:()=>l(d),className:`rounded-full border px-3 py-1.5 text-xs font-semibold transition ${n===d?"border-transparent bg-gradient-to-r from-[oklch(0.78_0.16_200)] to-[oklch(0.88_0.20_140)] text-[oklch(0.14_0.04_215)]":"border-[oklch(0.78_0.16_200/0.25)] bg-[oklch(0.16_0.04_215/0.5)] text-foreground/90 hover:border-[oklch(0.88_0.20_140/0.6)] hover:text-[oklch(0.88_0.20_140)]"}`,children:d},d))}),!n&&h.jsx("div",{className:"rounded-2xl border border-dashed border-[oklch(0.78_0.16_200/0.25)] p-10 text-center text-muted-foreground",children:"Pick a model above to generate a study card."}),i&&h.jsx(Xt,{label:`Generating deep dive on ${n}â¦`}),o&&h.jsx(Yt,{error:o,onRetry:()=>n&&l(n)}),c&&!i&&h.jsxs("article",{className:"rounded-2xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.55)] p-6 backdrop-blur space-y-6",children:[h.jsxs("header",{children:[h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full bg-[oklch(0.78_0.16_200/0.15)] px-3 py-1 text-[10px] font-bold uppercase tracking-widest text-[oklch(0.85_0.16_200)]",children:[h.jsx(oa,{className:"h-3 w-3"})," Study Card"]}),h.jsx("h2",{className:"mm-title text-3xl mt-3",children:c.model}),h.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:c.origin})]}),h.jsx(Ot,{title:"Core Ideas",children:h.jsx("ul",{className:"grid gap-2 sm:grid-cols-2",children:c.coreIdeas?.map((d,f)=>h.jsxs("li",{className:"flex gap-2 text-sm",children:[h.jsx(Gi,{className:"mt-0.5 h-4 w-4 flex-none text-[oklch(0.88_0.20_140)]"}),h.jsx("span",{children:d})]},f))})}),h.jsx(Ot,{title:"Key Techniques",children:h.jsx("ul",{className:"space-y-3",children:c.keyTechniques?.map((d,f)=>h.jsxs("li",{className:"rounded-lg border border-[oklch(0.78_0.16_200/0.15)] bg-[oklch(0.12_0.03_215/0.6)] p-3",children:[h.jsx("div",{className:"font-semibold text-foreground",children:d.name}),h.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:d.description})]},f))})}),h.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[h.jsx(Ot,{title:"Best Fit For",children:h.jsx("ul",{className:"space-y-1.5 text-sm",children:c.bestFitFor?.map((d,f)=>h.jsxs("li",{className:"flex gap-2",children:[h.jsx("span",{className:"text-[oklch(0.88_0.20_140)]",children:"âº"})," ",d]},f))})}),h.jsx(Ot,{title:"Cautions",children:h.jsx("ul",{className:"space-y-1.5 text-sm",children:c.cautions?.map((d,f)=>h.jsxs("li",{className:"flex gap-2",children:[h.jsx(qi,{className:"mt-0.5 h-3.5 w-3.5 flex-none text-[oklch(0.78_0.18_30)]"})," ",d]},f))})})]}),h.jsx(Ot,{title:"Evidence Base",children:h.jsx("p",{className:"text-sm text-foreground
10/90",children:c.evidenceBase})}),h.jsx(Ot,{title:"Trauma-Informed Notes",children:h.jsx("p",{className:"text-sm text-foreground/90",children:c.traumaInformedNotes})}),h.jsxs("div",{className:"rounded-xl border border-[oklch(0.88_0.20_140/0.4)] bg-gradient-to-br from-[oklch(0.78_0.16_200/0.12)] to-[oklch(0.88_0.20_140/0.12)] p-4",children:[h.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[oklch(0.88_0.20_140)] font-bold mb-1",children:"Mnemonic"}),h.jsx("div",{className:"font-display text-lg text-foreground",children:c.studyMnemonic})]})]})]})}function Ot({title:t,children:e}){return h.jsxs("section",{children:[h.jsx("h3",{className:"text-xs font-bold uppercase tracking-widest text-muted-foreground mb-2",children:t}),e]})}function qt({title:t,icon:e,onExit:n,onReload:s,loading:i}){return h.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[h.jsxs("button",{onClick:n,className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[h.jsx(Hi,{className:"h-4 w-4"})," Back"]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(e,{className:"h-4 w-4 text-[oklch(0.85_0.16_200)]"}),h.jsx("span",{className:"font-display font-bold uppercase tracking-[0.2em] text-sm",children:t})]}),h.jsxs("button",{onClick:s,disabled:i,"aria-label":"New round",className:"inline-flex items-center gap-1 rounded-full border border-[oklch(0.78_0.16_200/0.25)] px-3 py-1.5 text-xs text-foreground/90 hover:border-[oklch(0.88_0.20_140/0.6)] hover:text-[oklch(0.88_0.20_140)] disabled:opacity-50",children:[h.jsx(zn,{className:`h-3.5 w-3.5 ${i?"animate-spin":""}`}),"New"]})]})}function Xt({label:t}){return h.jsxs("div",{className:"rounded-2xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.5)] p-10 text-center backdrop-blur",children:[h.jsx(Xi,{className:"mx-auto h-8 w-8 animate-spin text-[oklch(0.88_0.20_140)]"}),h.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:t})]})}function Yt({error:t,onRetry:e}){return h.jsxs("div",{role:"alert",className:"rounded-2xl border border-[oklch(0.78_0.18_30/0.4)] bg-[oklch(0.78_0.18_30/0.08)] p-6",children:[h.jsx("div",{className:"font-semibold text-foreground",children:"Something went wrong"}),h.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:t}),h.jsxs("button",{onClick:e,className:"mt-4 mm-btn-primary",children:[h.jsx(zn,{className:"h-4 w-4"})," Try again"]})]})}function Ge({qIndex:t,total:e,question:n,picked:s,revealed:i,onPick:r,onNext:o,nextLabel:a}){return v.useEffect(()=>{function c(u){if(i){u.key==="Enter"&&o();return}const l=parseInt(u.key,10);!isNaN(l)&&l>=1&&l<=n.choices.length&&r(l-1)}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[i,n,r,o]),h.jsxs("div",{className:"rounded-2xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.55)] p-6 backdrop-blur",children:[h.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground mb-2",children:["Question ",t+1," of ",e]}),h.jsx("h3",{className:"mm-title text-xl mb-5",children:n.prompt}),h.jsx("ul",{className:"space-y-2.5",role:"radiogroup","aria-label":"Answer choices",children:n.choices.map((c,u)=>{const l=u===n.correctIndex,d=u===s;let f="border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.12_0.03_215/0.6)] hover:border-[oklch(0.88_0.20_140/0.6)]";return i&&l?f="border-[oklch(0.88_0.20_140)] bg-[oklch(0.88_0.20_140/0.12)]":i&&d&&!l&&(f="border-[oklch(0.78_0.18_30)] bg-[oklch(0.78_0.18_30/0.12)]"),h.jsx("li",{children:h.jsx("button",{role:"radio","aria-checked":d,disabled:i,onClick:()=>r(u),className:`w-full text-left rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus-visible:ring-2 focus-visible:ring-[oklch(0.88_0.20_140)] ${f}`,children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx("span",{className:"mt-0.5 inline-flex h-6 w-6 flex-none items-center justify-center rounded-md border border-[oklch(0.78_0.16_200/0.3)] text-[11px] font-bold text-muted-foreground",children:u+1}
10),h.jsx("span",{className:"flex-1 text-foreground/95",children:c}),i&&l&&h.jsx(Gi,{className:"h-4 w-4 flex-none text-[oklch(0.88_0.20_140)]"}),i&&d&&!l&&h.jsx(qi,{className:"h-4 w-4 flex-none text-[oklch(0.78_0.18_30)]"})]})})},u)})}),h.jsx(xs,{children:i&&h.jsxs(ut.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:[h.jsxs("div",{className:"mt-5 rounded-xl border border-[oklch(0.78_0.16_200/0.25)] bg-[oklch(0.12_0.03_215/0.6)] p-4",children:[h.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[oklch(0.88_0.20_140)] font-bold mb-1",children:"Rationale"}),h.jsx("p",{className:"text-sm text-foreground/90",children:n.rationale})]}),h.jsx("div",{className:"mt-4 flex justify-end",children:h.jsxs("button",{onClick:o,className:"mm-btn-primary",children:[a," ",h.jsx(Kt,{className:"h-4 w-4"})]})})]})}),!i&&h.jsxs("p",{className:"mt-3 text-[11px] text-muted-foreground",children:["Tip: press 1â",n.choices.length," to choose, Enter to advance."]})]})}const kd={intern:.6,licensed:.78,expert:.9};function Cd({difficulty:t,onExit:e,onScore:n}){const s=At(Ts),[i,r]=v.useState(!0),[o,a]=v.useState(null),[c,u]=v.useState([]),[l,d]=v.useState(0),[f,g]=v.useState(null),[y,b]=v.useState(!1),[x,w]=v.useState(0),[S,T]=v.useState(0),[P,V]=v.useState(null),[N,R]=v.useState(!1),[C,_]=v.useState(0),[j,B]=v.useState(null),[W,et]=v.useState(null);async function X(){r(!0),a(null),u([]),d(0),g(null),b(!1),w(0),T(0),V(null),et(null),B(null);try{const{items:k}=await s({data:{difficulty:t,count:3,seed:Math.random().toString(36).slice(2)}});u(k),Z(k,0)}catch(k){a(k instanceof Error?k.message:"Failed to load match")}finally{r(!1)}}function Z(k,D){if(!k[D])return;const L=k[D].correctIndex,F=k[D].choices.map(($,q)=>q).filter($=>$!==L),I=Math.random()<kd[t]?L:F[Math.floor(Math.random()*F.length)],O=1400+Math.random()*2600;V(null),et(null),B(null),R(!0),_(Date.now());const G=setTimeout(()=>{V(I),et(O),R(!1)},O);return()=>clearTimeout(G)}v.useEffect(()=>{X()},[]);function nt(k){y||!c.length||(g(k),B(Date.now()-C))}v.useEffect(()=>{if(y||!c.length||f===null||P===null)return;const k=c[l].correctIndex,D=f===k,L=P===k,F=(j??1/0)<=(W??1/0);let E=0,I=0;D&&L?F?E=1:I=1:(D&&(E=1),L&&(I=1)),w(O=>O+E),T(O=>O+I),n(D),b(!0),E?ft.correct():ft.wrong()},[f,P,y,c,l,j,W,n]);function Pt(){if(c.length)if(l+1<c.length){const k=l+1;d(k),g(null),b(!1),Z(c,k)}else X()}const H=c[l],Q=c.length>0&&l+1>=c.length,p=y&&Q,[m,M]=v.useState(!1);return v.useEffect(()=>{p&&!m&&(M(!0),x>S?(ft.win(),Ur()):x<S&&ft.lose()),!p&&m&&M(!1)},[p,m,x,S]),h.jsxs(ut.section,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},children:[h.jsx(qt,{title:"Vs AI",icon:Qi,onExit:e,onReload:X,loading:i}),i&&h.jsx(Xt,{label:"Spinning up your AI opponentâ¦"}),o&&h.jsx(Yt,{error:o,onRetry:X}),H&&!i&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsx(Ue,{icon:ra,label:"You",value:x,accent:"from-[oklch(0.78_0.16_200)] to-[oklch(0.88_0.20_140)]",active:f!==null}),h.jsx(Ue,{icon:la,label:`AI · ${t}`,value:S,accent:"from-[oklch(0.85_0.18_30)] to-[oklch(0.78_0.16_200)]",active:P!==null,thinking:N})]}),h.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[h.jsxs("span",{children:["Round ",l+1," / ",c.length]}),h.jsx("span",{className:"rounded-full bg-[oklch(0.78_0.16_200/0.15)] px-2 py-0.5 text-[10px] font-bold uppercase tracking-widest text-[oklch(0.85_0.16_200)]",children:H.model})]}),h.jsx(Ge,{qIndex:l,total:c.length,question:H,picked:f,revealed:y,onPick:nt,onNext:p?X:Pt,nextLabel:p?x>S?`You win ${x}â${S} · Rematch`:x<S?`AI wins ${S}â${x} · Rematch`:`Tie ${x}â${S} · Rematch`:"Next round"}),y&&h.jsxs("div",{className:"rounded-xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.12_0.03_215/0.5)] p-3 text-xs text-muted-foreground flex flex-wrap gap-x-6 gap-y-1",children:[h.jsxs("span",{children:["You: ",j!==null?`${(j/1e3).toFixed(2)}s`:"â"]}),h.jsxs("span",{children:["AI: ",W!==null?`${(W/1e3).toFixed(2)}s`:"â"]}),h.jsxs("span",{children:["AI picked: ",h.jsx("span",{className:"text-foreground",children:H.choices[P??0]?.slice(0,60)})]})]})]}),h.jsx(xs,{children:p&&m&&h.jsx(xd,{title:x>
10S?"Victory":x<S?"AI takes it":"Stalemate",subtitle:`Final ${x}â${S}`,won:x>S,primaryLabel:"Rematch",onPrimary:()=>{M(!1),X()},onClose:()=>M(!1)})})]})}function Ue({icon:t,label:e,value:n,accent:s,active:i,thinking:r}){return h.jsxs("div",{className:`relative overflow-hidden rounded-2xl border p-4 backdrop-blur transition ${i?"border-[oklch(0.88_0.20_140/0.6)] bg-[oklch(0.16_0.04_215/0.7)]":"border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.5)]"}`,children:[h.jsx("div",{className:`absolute inset-x-0 -top-px h-px bg-gradient-to-r ${s} opacity-80`}),h.jsxs("div",{className:"flex items-center gap-2 text-[10px] uppercase tracking-widest text-muted-foreground",children:[h.jsx(t,{className:"h-3.5 w-3.5"})," ",e,r&&h.jsx(Xi,{className:"h-3 w-3 animate-spin text-[oklch(0.88_0.20_140)]"})]}),h.jsx("div",{className:"mt-1 font-display text-3xl font-bold text-foreground",children:n})]})}function Ad({difficulty:t,onExit:e,onScore:n}){const s=At(ea),i=At(Ts),r=At(na),o=At(sa),[a,c]=v.useState(null),[u,l]=v.useState(null),[d,f]=v.useState(null),[g,y]=v.useState(!1),[b,x]=v.useState(null),[w,S]=v.useState([]),[T,P]=v.useState(0),[V,N]=v.useState(null),[R,C]=v.useState(!1),[_,j]=v.useState(0),[B,W]=v.useState(!1),[et,X]=v.useState(null);v.useEffect(()=>{let M=!0;return s().then(k=>{M&&c(k.filter(D=>D.my_status==="accepted"))}).catch(k=>M&&l(k instanceof Error?k.message:"Failed to load teams")),()=>{M=!1}},[s]);async function Z(){y(!0),x(null),S([]),P(0),N(null),C(!1),j(0),W(!1);try{const{items:M}=await i({data:{difficulty:t,count:1,seed:Math.random().toString(36).slice(2)}});S(M)}catch(M){x(M instanceof Error?M.message:"Failed to load round")}finally{y(!1)}}function nt(M){if(R||!w.length)return;N(M);const k=M===w[T].correctIndex;k&&j(D=>D+1),k?ft.correct():ft.wrong(),n(k),C(!0)}async function Pt(){try{const M=await o({data:{gameMode:"mm_team",modelId:null}});X(M)}catch{}}async function H(){if(T+1<w.length){P(T+1),N(null),C(!1);return}if(d&&!B)try{await r({data:{teamId:d.id,gameMode:"mm_team",difficulty:t,totalScore:_*10,correctAnswers:_,totalPlayed:w.length}}),W(!0),_/w.length>=.6?(ft.win(),Ur()):ft.lose(),Pt()}catch(M){x(M instanceof Error?M.message:"Failed to save score")}}if(v.useEffect(()=>{d&&(Z(),Pt())},[d]),!d)return h.jsxs(ut.section,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},children:[h.jsx(qt,{title:"Team Mode",icon:ee,onExit:e,onReload:()=>{},loading:!1}),a===null&&!u&&h.jsx(Xt,{label:"Loading your teamsâ¦"}),u&&h.jsx(Yt,{error:u,onRetry:()=>window.location.reload()}),a&&a.length===0&&h.jsxs("div",{className:"rounded-2xl border border-dashed border-[oklch(0.78_0.16_200/0.25)] bg-[oklch(0.16_0.04_215/0.5)] p-10 text-center backdrop-blur",children:[h.jsx(ee,{className:"mx-auto h-10 w-10 text-[oklch(0.88_0.20_140)]"}),h.jsx("h2",{className:"mm-title text-2xl mt-4",children:"No teams yet"}),h.jsx("p",{className:"mt-2 text-sm text-muted-foreground max-w-md mx-auto",children:"Create or join a team first â then come back here to play on their behalf."}),h.jsxs($n,{to:"/teams",className:"mt-6 inline-flex mm-btn-primary",children:["Manage teams ",h.jsx(Kt,{className:"h-4 w-4"})]})]}),a&&a.length>0&&h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs uppercase tracking-widest text-muted-foreground mb-3",children:"Play for your team"}),h.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:a.map(M=>h.jsxs("button",{onClick:()=>f(M),className:"group flex items-center justify-between gap-3 rounded-2xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.55)] p-4 text-left backdrop-blur transition hover:border-[oklch(0.88_0.20_140/0.6)]",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-[oklch(0.78_0.16_200)] to-[oklch(0.88_0.20_140)] font-display text-[oklch(0.14_0.04_215)]",children:M.name.slice(0,2).toUpperCase()}),h.jsxs("div",{children:[h.jsx("div",{className:"mm-title text-base",children:M.name}),h.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:[M.member_count," ",M.member_count===1?"player":"players"," ·"," ",M.my_role]})]})]}),h.jsx(Kt,{className:"h-4 w-4 text-muted-foreground transition group-hover:translate-x-0.5 group-hover:text-foreground"})]},M.id))})]}),h.jsx(Ki,{rows:et,onLoad:Pt})]})]});const Q=w[T],p=w.length>0&&T+1>=w.length,m=R&&p;return h.jsxs(ut.section,{initial:{opacity:0,y:12}
10,animate:{opacity:1,y:0},exit:{opacity:0,y:-8},children:[h.jsx(qt,{title:`Team · ${d.name}`,icon:ee,onExit:()=>f(null),onReload:Z,loading:g}),g&&h.jsx(Xt,{label:"Loading questions for your teamâ¦"}),b&&h.jsx(Yt,{error:b,onRetry:Z}),Q&&!g&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsx(Ue,{icon:ee,label:d.name,value:_,accent:"from-[oklch(0.78_0.16_200)] to-[oklch(0.88_0.20_140)]",active:V!==null}),h.jsx(Ue,{icon:Wn,label:"Round",value:T+1,accent:"from-[oklch(0.82_0.14_180)] to-[oklch(0.78_0.16_200)]",active:!0})]}),h.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[h.jsxs("span",{children:["Question ",T+1," / ",w.length]}),h.jsx("span",{className:"rounded-full bg-[oklch(0.78_0.16_200/0.15)] px-2 py-0.5 text-[10px] font-bold uppercase tracking-widest text-[oklch(0.85_0.16_200)]",children:Q.model})]}),h.jsx(Ge,{qIndex:T,total:w.length,question:Q,picked:V,revealed:R,onPick:nt,onNext:m?Z:H,nextLabel:m?B?"Saved · Play again":`Finish & save (${_}/${w.length})`:"Next question"}),m&&B&&h.jsxs("div",{className:"rounded-xl border border-[oklch(0.88_0.20_140/0.4)] bg-[oklch(0.16_0.04_215/0.5)] p-4 text-sm text-foreground",children:["Score saved for ",h.jsx("span",{className:"font-bold",children:d.name})," â +",_*10," team points."]}),m&&h.jsx(Ki,{rows:et,onLoad:Pt})]})]})}function Ki({rows:t,onLoad:e}){return v.useEffect(()=>{t===null&&e()},[]),h.jsxs("div",{className:"rounded-2xl border border-[oklch(0.78_0.16_200/0.2)] bg-[oklch(0.16_0.04_215/0.55)] p-5 backdrop-blur",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("h3",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Team Leaderboard"}),h.jsxs("button",{onClick:e,className:"text-[10px] uppercase tracking-widest text-muted-foreground hover:text-foreground inline-flex items-center gap-1",children:[h.jsx(zn,{className:"h-3 w-3"})," Refresh"]})]}),!t&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"Loadingâ¦"}),t&&t.length===0&&h.jsx("p",{className:"text-sm text-muted-foreground",children:"No team scores yet. Be the first to log one."}),t&&t.length>0&&h.jsx("ol",{className:"space-y-2",children:t.slice(0,10).map((n,s)=>h.jsxs("li",{className:"flex items-center justify-between rounded-xl border border-[oklch(0.78_0.16_200/0.15)] bg-[oklch(0.12_0.03_215/0.5)] px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("span",{className:"font-display text-sm font-bold text-[oklch(0.88_0.20_140)] w-6 text-center",children:s+1}),h.jsxs("div",{children:[h.jsx("div",{className:"text-sm font-semibold text-foreground",children:n.team_name}),h.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-muted-foreground",children:[n.correct_answers,"/",n.total_played," correct"]})]})]}),h.jsx("div",{className:"font-display text-lg font-bold text-[oklch(0.85_0.16_200)]",children:n.total_score})]},n.team_ref))})]})}export{Bd as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.