llmtap 0.1.2 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/dashboard/assets/Costs-DcNWZXjX.js +1 -0
  2. package/dist/dashboard/assets/Dashboard-Dkx38fyX.js +9 -0
  3. package/dist/dashboard/assets/DataTable-CBsuKoTx.js +1 -0
  4. package/dist/dashboard/assets/Models-CESHenJX.js +1 -0
  5. package/dist/dashboard/assets/Sessions-BcRE0OFh.js +3 -0
  6. package/dist/dashboard/assets/Settings-BUDP0ZDT.js +12 -0
  7. package/dist/dashboard/assets/StatusDot-BAf4TSfE.js +1 -0
  8. package/dist/dashboard/assets/TraceDetail-ByibqI-g.js +17 -0
  9. package/dist/dashboard/assets/Traces-D9kJG7O9.js +1 -0
  10. package/dist/dashboard/assets/charts-BXAtT8sy.js +89 -0
  11. package/dist/dashboard/assets/constants-OlSc-7iA.js +1 -0
  12. package/dist/dashboard/assets/content-BRoZVvRJ.js +2 -0
  13. package/dist/dashboard/assets/format-CgXokIEM.js +1 -0
  14. package/dist/dashboard/assets/icons-DhpK1vUv.js +1 -0
  15. package/dist/dashboard/assets/index-C7GMIuGj.css +1 -0
  16. package/dist/dashboard/assets/index-jVcSWGwX.js +58 -0
  17. package/dist/dashboard/assets/motion-Bw6xJyTE.js +9 -0
  18. package/dist/dashboard/assets/number-ticker-C1hiu1bi.js +1 -0
  19. package/dist/dashboard/assets/provider-colors-DcHYMgVv.js +1 -0
  20. package/dist/dashboard/assets/query-BSZkMKN4.js +4 -0
  21. package/dist/dashboard/assets/select-CbYE6Q0M.js +1 -0
  22. package/dist/dashboard/index.html +6 -2
  23. package/dist/index.js +14 -0
  24. package/dist/index.js.map +1 -1
  25. package/package.json +7 -4
  26. package/dist/dashboard/assets/BarChart-N8X7TKRf.js +0 -1
  27. package/dist/dashboard/assets/Costs-BhWdS2kw.js +0 -4
  28. package/dist/dashboard/assets/Dashboard-DnHLwJsN.js +0 -9
  29. package/dist/dashboard/assets/Models-5jWcyfAk.js +0 -1
  30. package/dist/dashboard/assets/Sessions-IXJPYjKe.js +0 -3
  31. package/dist/dashboard/assets/Settings-kxBLuIHe.js +0 -6
  32. package/dist/dashboard/assets/TraceDetail-DdKFps7x.js +0 -18
  33. package/dist/dashboard/assets/Traces-Cv9L_xTe.js +0 -2
  34. package/dist/dashboard/assets/chevron-down-B0xosrpl.js +0 -1
  35. package/dist/dashboard/assets/clock-CSGov78l.js +0 -1
  36. package/dist/dashboard/assets/coins-RIVI5-1a.js +0 -1
  37. package/dist/dashboard/assets/download-PygxZ--5.js +0 -1
  38. package/dist/dashboard/assets/format-BiBDo3KS.js +0 -1
  39. package/dist/dashboard/assets/gauge-BBNKtqFH.js +0 -1
  40. package/dist/dashboard/assets/generateCategoricalChart-CylgFInn.js +0 -61
  41. package/dist/dashboard/assets/index-BBr9_AHg.js +0 -22
  42. package/dist/dashboard/assets/index-CIGK6hiV.css +0 -1
  43. package/dist/dashboard/assets/layers--K2XRXAx.js +0 -1
  44. package/dist/dashboard/assets/message-square-DdcqfsnD.js +0 -1
  45. package/dist/dashboard/assets/orbit-2k6lSwt7.js +0 -1
  46. package/dist/dashboard/assets/search-BwbP84dP.js +0 -1
  47. package/dist/dashboard/assets/zap-Ccrxhk2Q.js +0 -1
@@ -0,0 +1,9 @@
1
+ import{r as v,j as et}from"./query-BSZkMKN4.js";const tn=v.createContext({});function jt(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const No=typeof window<"u",en=No?v.useLayoutEffect:v.useEffect,ue=v.createContext(null);function nn(t,e){t.indexOf(e)===-1&&t.push(e)}function ne(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const J=(t,e,n)=>n>e?e:n<t?t:n;let sn=()=>{};const nt={},Zs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Js(t){return typeof t=="object"&&t!==null}const Qs=t=>/^0[^.\s]+$/u.test(t);function ti(t){let e;return()=>(e===void 0&&(e=t()),e)}const H=t=>t,Uo=(t,e)=>n=>e(t(n)),Ot=(...t)=>t.reduce(Uo),kt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class on{constructor(){this.subscriptions=[]}add(e){return nn(this.subscriptions,e),()=>ne(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const W=t=>t*1e3,$=t=>t/1e3;function ei(t,e){return e?t*(1e3/e):0}const ni=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Wo=1e-7,Ko=12;function $o(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=ni(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Wo&&++a<Ko);return o}function Nt(t,e,n,s){if(t===e&&n===s)return H;const i=r=>$o(r,0,1,t,n);return r=>r===0||r===1?r:ni(i(r),e,s)}const si=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ii=t=>e=>1-t(1-e),oi=Nt(.33,1.53,.69,.99),rn=ii(oi),ri=si(rn),ai=t=>(t*=2)<1?.5*rn(t):.5*(2-Math.pow(2,-10*(t-1))),an=t=>1-Math.sin(Math.acos(t)),li=ii(an),ci=si(an),Ho=Nt(.42,0,1,1),zo=Nt(0,0,.58,1),ui=Nt(.42,0,.58,1),Go=t=>Array.isArray(t)&&typeof t[0]!="number",hi=t=>Array.isArray(t)&&typeof t[0]=="number",_o={linear:H,easeIn:Ho,easeInOut:ui,easeOut:zo,circIn:an,circInOut:ci,circOut:li,backIn:rn,backInOut:ri,backOut:oi,anticipate:ai},Xo=t=>typeof t=="string",Rn=t=>{if(hi(t)){sn(t.length===4);const[e,n,s,i]=t;return Nt(e,n,s,i)}else if(Xo(t))return _o[t];return t},$t=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Yo(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,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&o.add(l),p.has(l)||p.add(l),l},cancel:l=>{s.delete(l),o.delete(l)},process:l=>{if(a=l,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),n.clear(),i=!1,r&&(r=!1,u.process(l))}};return u}const qo=40;function fi(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=$t.reduce((T,w)=>(T[w]=Yo(r),T),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:h,preRender:f,render:d,postRender:p}=o,m=()=>{const T=nt.useManualTiming?i.timestamp:performance.now();n=!1,nt.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(T-i.timestamp,qo),1)),i.timestamp=T,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},y=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:$t.reduce((T,w)=>{const b=o[w];return T[w]=(D,I=!1,A=!1)=>(n||y(),b.schedule(D,I,A)),T},{}),cancel:T=>{for(let w=0;w<$t.length;w++)o[$t[w]].cancel(T)},state:i,steps:o}}const{schedule:C,cancel:st,state:O,steps:me}=fi(typeof requestAnimationFrame<"u"?requestAnimationFrame:H,!0);let Xt;function Zo(){Xt=void 0}const N={now:()=>(Xt===void 0&&N.set(O.isProcessing||nt.useManualTiming?O.timestamp:performance.now()),Xt),set:t=>{Xt=t,queueMicrotask(Zo)}},di=t=>e=>typeof e=="string"&&e.startsWith(t),pi=di("--"),Jo=di("var(--"),ln=t=>Jo(t)?Qo.test(t.split("/*")[0].trim()):!1,Qo=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ln(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const St={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},It={...St,transform:t=>J(0,1,t)},Ht={...St,default:1},Mt=t=>Math.round(t*1e5)/1e5,cn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function tr(t){return t==null}const er=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,un=(t,e)=>n=>!!(typeof n=="string"&&er.test(n)&&n.startsWith(t)||e&&!tr(n)&&Object.prototype.hasOwnProperty.call(n,e)),mi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(cn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},nr=t=>J(0,255,t),ge={...St,transform:t=>Math.round(nr(t))},ut={test:un("rgb","red"),parse:mi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ge.transform(t)+", "+ge.transform(e)+", "+ge.transform(n)+", "+Mt(It.transform(s))+")"};function sr(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 Re={test:un("#"),parse:sr,transform:ut.transform},Ut=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),it=Ut("deg"),Z=Ut("%"),P=Ut("px"),ir=Ut("vh"),or=Ut("vw"),kn={...Z,parse:t=>Z.parse(t)/100,transform:t=>Z.transform(t*100)},gt={test:un("hsl","hue"),parse:mi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Z.transform(Mt(e))+", "+Z.transform(Mt(n))+", "+Mt(It.transform(s))+")"},L={test:t=>ut.test(t)||Re.test(t)||gt.test(t),parse:t=>ut.test(t)?ut.parse(t):gt.test(t)?gt.parse(t):Re.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ut.transform(t):gt.transform(t),getAnimatableNone:t=>{const e=L.parse(t);return e.alpha=0,L.transform(e)}},rr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ar(t){return isNaN(t)&&typeof t=="string"&&(t.match(cn)?.length||0)+(t.match(rr)?.length||0)>0}const gi="number",yi="color",lr="var",cr="var(",In="${}",ur=/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 Pt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(ur,c=>(L.test(c)?(s.color.push(r),i.push(yi),n.push(L.parse(c))):c.startsWith(cr)?(s.var.push(r),i.push(lr),n.push(c)):(s.number.push(r),i.push(gi),n.push(parseFloat(c))),++r,In)).split(In);return{values:n,split:a,indexes:s,types:i}}function hr(t){return Pt(t).values}function vi({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===gi?i+=Mt(s[r]):o===yi?i+=L.transform(s[r]):i+=s[r]}return i}}function fr(t){return vi(Pt(t))}const dr=t=>typeof t=="number"?0:L.test(t)?L.getAnimatableNone(t):t,pr=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:dr(t);function mr(t){const e=Pt(t);return vi(e)(e.values.map((s,i)=>pr(s,e.split[i])))}const _={test:ar,parse:hr,createTransformer:fr,getAnimatableNone:mr};function ye(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 gr({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=ye(c,a,t+1/3),r=ye(c,a,t),o=ye(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function se(t,e){return n=>n>0?e:t}const E=(t,e,n)=>t+(e-t)*n,ve=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},yr=[Re,ut,gt],vr=t=>yr.find(e=>e.test(t));function Fn(t){const e=vr(t);if(!e)return!1;let n=e.parse(t);return e===gt&&(n=gr(n)),n}const Bn=(t,e)=>{const n=Fn(t),s=Fn(e);if(!n||!s)return se(t,e);const i={...n};return r=>(i.red=ve(n.red,s.red,r),i.green=ve(n.green,s.green,r),i.blue=ve(n.blue,s.blue,r),i.alpha=E(n.alpha,s.alpha,r),ut.transform(i))},Le=new Set(["none","hidden"]);function Tr(t,e){return Le.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function xr(t,e){return n=>E(t,e,n)}function hn(t){return typeof t=="number"?xr:typeof t=="string"?ln(t)?se:L.test(t)?Bn:Sr:Array.isArray(t)?Ti:typeof t=="object"?L.test(t)?Bn:wr:se}function Ti(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>hn(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function wr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=hn(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Pr(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 Sr=(t,e)=>{const n=_.createTransformer(e),s=Pt(t),i=Pt(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?Le.has(t)&&!i.values.length||Le.has(e)&&!s.values.length?Tr(t,e):Ot(Ti(Pr(s,i),i.values),n):se(t,e)};function xi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?E(t,e,n):hn(t)(t,e)}const br=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>C.update(e,n),stop:()=>st(e),now:()=>O.isProcessing?O.timestamp:N.now()}},wi=(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)})`},ie=2e4;function fn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<ie;)e+=n,s=t.next(e);return e>=ie?1/0:e}function Ar(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(fn(s),ie);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:$(i)}}const R={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 ke(t,e){return t*Math.sqrt(1-e*e)}const Vr=12;function Cr(t,e,n){let s=n;for(let i=1;i<Vr;i++)s=s-t(s)/e(s);return s}const Te=.001;function Mr({duration:t=R.duration,bounce:e=R.bounce,velocity:n=R.velocity,mass:s=R.mass}){let i,r,o=1-e;o=J(R.minDamping,R.maxDamping,o),t=J(R.minDuration,R.maxDuration,$(t)),o<1?(i=u=>{const l=u*o,h=l*t,f=l-n,d=ke(u,o),p=Math.exp(-h);return Te-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),m=ke(Math.pow(u,2),o);return(-i(u)+Te>0?-1:1)*((f-d)*p)/m}):(i=u=>{const l=Math.exp(-u*t),h=(u-n)*t+1;return-Te+l*h},r=u=>{const l=Math.exp(-u*t),h=(n-u)*(t*t);return l*h});const a=5/t,c=Cr(i,r,a);if(t=W(t),isNaN(c))return{stiffness:R.stiffness,damping:R.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Dr=["duration","bounce"],Er=["stiffness","damping","mass"];function jn(t,e){return e.some(n=>t[n]!==void 0)}function Rr(t){let e={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...t};if(!jn(t,Er)&&jn(t,Dr))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*J(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:R.mass,stiffness:i,damping:r}}else{const n=Mr({...t,velocity:0});e={...e,...n,mass:R.mass},e.isResolvedFromDuration=!0}return e}function oe(t=R.visualDuration,e=R.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:h,velocity:f,isResolvedFromDuration:d}=Rr({...n,velocity:-$(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(c*l)),y=o-r,g=$(Math.sqrt(c/l)),x=Math.abs(y)<5;s||(s=x?R.restSpeed.granular:R.restSpeed.default),i||(i=x?R.restDelta.granular:R.restDelta.default);let T,w,b,D,I,A;if(m<1)b=ke(g,m),D=(p+m*g*y)/b,T=S=>{const M=Math.exp(-m*g*S);return o-M*(D*Math.sin(b*S)+y*Math.cos(b*S))},I=m*g*D+y*b,A=m*g*y-D*b,w=S=>Math.exp(-m*g*S)*(I*Math.sin(b*S)+A*Math.cos(b*S));else if(m===1){T=M=>o-Math.exp(-g*M)*(y+(p+g*y)*M);const S=p+g*y;w=M=>Math.exp(-g*M)*(g*S*M-p)}else{const S=g*Math.sqrt(m*m-1);T=X=>{const tt=Math.exp(-m*g*X),Y=Math.min(S*X,300);return o-tt*((p+m*g*y)*Math.sinh(Y)+S*y*Math.cosh(Y))/S};const M=(p+m*g*y)/S,B=m*g*M-y*S,Q=m*g*y-M*S;w=X=>{const tt=Math.exp(-m*g*X),Y=Math.min(S*X,300);return tt*(B*Math.sinh(Y)+Q*Math.cosh(Y))}}const V={calculatedDuration:d&&h||null,velocity:S=>W(w(S)),next:S=>{if(!d&&m<1){const B=Math.exp(-m*g*S),Q=Math.sin(b*S),X=Math.cos(b*S),tt=o-B*(D*Q+y*X),Y=W(B*(I*Q+A*X));return a.done=Math.abs(Y)<=s&&Math.abs(o-tt)<=i,a.value=a.done?o:tt,a}const M=T(S);if(d)a.done=S>=h;else{const B=W(w(S));a.done=Math.abs(B)<=s&&Math.abs(o-M)<=i}return a.value=a.done?o:M,a},toString:()=>{const S=Math.min(fn(V),ie),M=wi(B=>V.next(S*B).value,S,30);return S+"ms "+M},toTransition:()=>{}};return V}oe.applyToOptions=t=>{const e=Ar(t,100,oe);return t.ease=e.ease,t.duration=W(e.duration),t.type="keyframes",t};const Lr=5;function Pi(t,e,n){const s=Math.max(e-Lr,0);return ei(n-t(s),e-s)}function Ie({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 h=t[0],f={done:!1,value:h},d=A=>a!==void 0&&A<a||c!==void 0&&A>c,p=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let m=n*e;const y=h+m,g=o===void 0?y:o(y);g!==y&&(m=g-h);const x=A=>-m*Math.exp(-A/s),T=A=>g+x(A),w=A=>{const V=x(A),S=T(A);f.done=Math.abs(V)<=u,f.value=f.done?g:S};let b,D;const I=A=>{d(f.value)&&(b=A,D=oe({keyframes:[f.value,p(f.value)],velocity:Pi(T,A,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:l}))};return I(0),{calculatedDuration:null,next:A=>{let V=!1;return!D&&b===void 0&&(V=!0,w(A),I(A)),b!==void 0&&A>=b?D.next(A-b):(!V&&w(A),f)}}}function kr(t,e,n){const s=[],i=n||nt.mix||xi,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]||H:e;a=Ot(c,a)}s.push(a)}return s}function Si(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(sn(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=kr(e,s,i),c=a.length,u=l=>{if(o&&l<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(l<t[h+1]);h++);const f=kt(t[h],t[h+1],l);return a[h](f)};return n?l=>u(J(t[0],t[r-1],l)):u}function Ir(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=kt(0,e,s);t.push(E(n,1,i))}}function Fr(t){const e=[0];return Ir(e,t.length-1),e}function Br(t,e){return t.map(n=>n*e)}function jr(t,e){return t.map(()=>e||ui).splice(0,t.length-1)}function Dt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Go(s)?s.map(Rn):Rn(s),r={done:!1,value:e[0]},o=Br(n&&n.length===e.length?n:Fr(e),t),a=Si(o,e,{ease:Array.isArray(i)?i:jr(e,i)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}const Or=t=>t!==null;function dn(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Or),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Nr={decay:Ie,inertia:Ie,tween:Dt,keyframes:Dt,spring:oe};function bi(t){typeof t.type=="string"&&(t.type=Nr[t.type])}class pn{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 Ur=t=>t/100;class he extends pn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==N.now()&&this.tick(N.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;bi(e);const{type:n=Dt,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const c=n||Dt;c!==Dt&&typeof a[0]!="number"&&(this.mixKeyframes=Ot(Ur,xi(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=fn(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:h,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:y}=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 g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let T=this.currentTime,w=s;if(h){const A=Math.min(this.currentTime,i)/a;let V=Math.floor(A),S=A%1;!S&&A>=1&&(S=1),S===1&&V--,V=Math.min(V,h+1),V%2&&(f==="reverse"?(S=1-S,d&&(S-=d/a)):f==="mirror"&&(w=o)),T=J(0,1,S)*a}const b=x?{done:!1,value:l[0]}:w.next(T);r&&!x&&(b.value=r(b.value));let{done:D}=b;!x&&c!==null&&(D=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return I&&p!==Ie&&(b.value=dn(l,this.options,y,this.speed)),m&&m(b.value),I&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return $(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(this.currentTime)}set time(e){e=W(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Pi(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(N.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=$(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=br,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(N.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 Wr(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ht=t=>t*180/Math.PI,Fe=t=>{const e=ht(Math.atan2(t[1],t[0]));return Be(e)},Kr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Fe,rotateZ:Fe,skewX:t=>ht(Math.atan(t[1])),skewY:t=>ht(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Be=t=>(t=t%360,t<0&&(t+=360),t),On=Fe,Nn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Un=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),$r={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Nn,scaleY:Un,scale:t=>(Nn(t)+Un(t))/2,rotateX:t=>Be(ht(Math.atan2(t[6],t[5]))),rotateY:t=>Be(ht(Math.atan2(-t[2],t[0]))),rotateZ:On,rotate:On,skewX:t=>ht(Math.atan(t[4])),skewY:t=>ht(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function je(t){return t.includes("scale")?1:0}function Oe(t,e){if(!t||t==="none")return je(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=$r,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Kr,i=a}if(!i)return je(e);const r=s[e],o=i[1].split(",").map(zr);return typeof r=="function"?r(o):o[r]}const Hr=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Oe(n,e)};function zr(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],At=new Set(bt),Wn=t=>t===St||t===P,Gr=new Set(["x","y","z"]),_r=bt.filter(t=>!Gr.has(t));function Xr(t){const e=[];return _r.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ot={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Oe(e,"x"),y:(t,{transform:e})=>Oe(e,"y")};ot.translateX=ot.x;ot.translateY=ot.y;const ft=new Set;let Ne=!1,Ue=!1,We=!1;function Ai(){if(Ue){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=Xr(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)})}Ue=!1,Ne=!1,ft.forEach(t=>t.complete(We)),ft.clear()}function Vi(){ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ue=!0)})}function Yr(){We=!0,Vi(),Ai(),We=!1}class mn{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),Ne||(Ne=!0,C.read(Vi),C.resolveKeyframes(Ai))):(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])}Wr(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 qr=t=>t.startsWith("--");function Ci(t,e,n){qr(e)?t.style.setProperty(e,n):t.style[e]=n}const Zr={};function Mi(t,e){const n=ti(t);return()=>Zr[e]??n()}const Jr=Mi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Di=Mi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ct=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Kn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ct([0,.65,.55,1]),circOut:Ct([.55,0,1,.45]),backIn:Ct([.31,.01,.66,-.59]),backOut:Ct([.33,1.53,.69,.99])};function Ei(t,e){if(t)return typeof t=="function"?Di()?wi(t,e):"ease-out":hi(t)?Ct(t):Array.isArray(t)?t.map(n=>Ei(n,e)||Kn.easeOut):Kn[t]}function Qr(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 h=Ei(a,i);Array.isArray(h)&&(l.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(l,f)}function Ri(t){return typeof t=="function"&&"applyToOptions"in t}function ta({type:t,...e}){return Ri(t)&&Di()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Li extends pn{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,sn(typeof e.type!="string");const u=ta(e);this.animation=Qr(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const l=dn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),Ci(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 $(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+$(e)}get time(){return $(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=W(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Jr()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),H):i(this)}}const ki={anticipate:ai,backInOut:ri,circInOut:ci};function ea(t){return t in ki}function na(t){typeof t.ease=="string"&&ea(t.ease)&&(t.ease=ki[t.ease])}const xe=10;class sa extends Li{constructor(e){na(e),bi(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 he({...o,autoplay:!1}),c=Math.max(xe,N.now()-this.startTime),u=J(0,xe,c-xe),l=a.sample(c).value,{name:h}=this.options;r&&h&&Ci(r,h,l),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}}const $n=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_.test(t)||t==="0")&&!t.startsWith("url("));function ia(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 oa(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=$n(i,e),a=$n(r,e);return!o||!a?!1:ia(t)||(n==="spring"||Ri(n))&&s}function Ke(t){t.duration=0,t.type="keyframes"}const ra=new Set(["opacity","clipPath","filter","transform"]),aa=ti(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function la(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return aa()&&n&&ra.has(n)&&(n!=="transform"||!u)&&!c&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const ca=40;class ua extends pn{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,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:u,element:l,...h},d=l?.KeyframeResolver||mn;this.keyframeResolver=new d(a,(p,m,y)=>this.onKeyframesResolved(p,m,f,!y),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=N.now(),oa(e,r,o,a)||((nt.instantAnimations||!c)&&l?.(dn(e,s,n)),e[0]=e[e.length-1],Ke(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>ca?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&la(f),p=f.motionValue?.owner?.current,m=d?new sa({...f,element:p}):new he(f);m.finished.then(()=>{this.notifyFinished()}).catch(H),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Yr()),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 Ii(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 ha=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fa(t){const e=ha.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Fi(t,e,n=1){const[s,i]=fa(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Zs(o)?parseFloat(o):o}return ln(i)?Fi(i,e,n+1):i}const da={type:"spring",stiffness:500,damping:25,restSpeed:10},pa=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),ma={type:"keyframes",duration:.8},ga={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ya=(t,{keyframes:e})=>e.length>2?ma:At.has(t)?t.startsWith("scale")?pa(e[1]):da:ga,va=t=>t!==null;function Ta(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(va),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}function Bi(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function gn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Bi(n,t):n}function xa({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:c,elapsed:u,...l}){return!!Object.keys(l).length}const yn=(t,e,n,s={},i,r)=>o=>{const a=gn(s,t)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-W(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};xa(a)||Object.assign(l,ya(t,l)),l.duration&&(l.duration=W(l.duration)),l.repeatDelay&&(l.repeatDelay=W(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let h=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(Ke(l),l.delay===0&&(h=!0)),(nt.instantAnimations||nt.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,Ke(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=Ta(l.keyframes,a);if(f!==void 0){C.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new he(l):new ua(l)};function Hn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function vn(t,e,n,s){if(typeof e=="function"){const[i,r]=Hn(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]=Hn(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function wt(t,e,n){const s=t.getProps();return vn(s,e,n!==void 0?n:s.custom,t)}const ji=new Set(["width","height","top","left","right","bottom",...bt]),zn=30,wa=t=>!isNaN(parseFloat(t)),Et={current:void 0};class Pa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=N.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=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wa(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 on);const s=this.events[e].add(n);return e==="change"?()=>{s(),C.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 Et.current&&Et.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>zn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,zn);return ei(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 dt(t,e){return new Pa(t,e)}const $e=t=>Array.isArray(t);function Sa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,dt(n))}function ba(t){return $e(t)?t[t.length-1]||0:t}function Aa(t,e){const n=wt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=ba(r[o]);Sa(t,o,a)}}const F=t=>!!(t&&t.getVelocity);function Va(t){return!!(F(t)&&t.add)}function He(t,e){const n=t.getValue("willChange");if(Va(n))return n.add(e);if(!n&&nt.WillChange){const s=new nt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Tn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ca="framerAppearId",Oi="data-"+Tn(Ca);function Ni(t){return t.props[Oi]}function Ma({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ui(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const c=t.getDefaultTransition();r=r?Bi(r,c):c;const u=r?.reduceMotion;s&&(r=s);const l=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),p=a[f];if(p===void 0||h&&Ma(h,f))continue;const m={delay:n,...gn(r||{},f)},y=d.get();if(y!==void 0&&!d.isAnimating&&!Array.isArray(p)&&p===y&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const w=Ni(t);if(w){const b=window.MotionHandoffAnimation(w,f,C);b!==null&&(m.startTime=b,g=!0)}}He(t,f);const x=u??t.shouldReduceMotion;d.start(yn(f,d,p,x&&ji.has(f)?{type:!1}:m,t,g));const T=d.animation;T&&l.push(T)}if(o){const f=()=>C.update(()=>{o&&Aa(t,o)});l.length?Promise.all(l).then(f):f()}return l}function ze(t,e,n={}){const s=wt(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(Ui(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:l,staggerDirection:h}=i;return Da(t,e,c,u,l,h,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 Da(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(ze(c,e,{...o,delay:n+(typeof s=="function"?0:s)+Ii(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Ea(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>ze(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=ze(t,e,n);else{const i=typeof e=="function"?wt(t,e,n.custom):e;s=Promise.all(Ui(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Ra={test:t=>t==="auto",parse:t=>t},Wi=t=>e=>e.test(t),Ki=[St,P,Z,it,or,ir,Ra],Gn=t=>Ki.find(Wi(t));function La(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Qs(t):!0}const ka=new Set(["brightness","contrast","saturate","opacity"]);function Ia(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(cn)||[];if(!s)return t;const i=n.replace(s,"");let r=ka.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Fa=/\b([a-z-]*)\(.*?\)/gu,Ge={..._,getAnimatableNone:t=>{const e=t.match(Fa);return e?e.map(Ia).join(" "):t}},_e={..._,getAnimatableNone:t=>{const e=_.parse(t);return _.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},_n={...St,transform:Math.round},Ba={rotate:it,rotateX:it,rotateY:it,rotateZ:it,scale:Ht,scaleX:Ht,scaleY:Ht,scaleZ:Ht,skew:it,skewX:it,skewY:it,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:It,originX:kn,originY:kn,originZ:P},xn={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,...Ba,zIndex:_n,fillOpacity:It,strokeOpacity:It,numOctaves:_n},ja={...xn,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:Ge,WebkitFilter:Ge,mask:_e,WebkitMask:_e},$i=t=>ja[t],Oa=new Set([Ge,_e]);function Hi(t,e){let n=$i(t);return Oa.has(n)||(n=_),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Na=new Set(["auto","none","0"]);function Ua(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Na.has(r)&&Pt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Hi(n,i)}class Wa extends mn{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 h=e[l];if(typeof h=="string"&&(h=h.trim(),ln(h))){const f=Fi(h,n.current);f!==void 0&&(e[l]=f),l===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!ji.has(s)||e.length!==2)return;const[i,r]=e,o=Gn(i),a=Gn(r),c=Ln(i),u=Ln(r);if(c!==u&&ot[s]){this.needsMeasurement=!0;return}if(o!==a)if(Wn(o)&&Wn(a))for(let l=0;l<e.length;l++){const h=e[l];typeof h=="string"&&(e[l]=parseFloat(h))}else ot[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||La(e[i]))&&s.push(i);s.length&&Ua(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ot[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=ot[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const Ka=new Set(["opacity","clipPath","filter","transform"]);function wn(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const zi=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Yt(t){return Js(t)&&"offsetHeight"in t}const{schedule:Pn}=fi(queueMicrotask,!1),G={x:!1,y:!1};function Gi(){return G.x||G.y}function $a(t){return t==="x"||t==="y"?G[t]?null:(G[t]=!0,()=>{G[t]=!1}):G.x||G.y?null:(G.x=G.y=!0,()=>{G.x=G.y=!1})}function _i(t,e){const n=wn(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Ha(t){return!(t.pointerType==="touch"||Gi())}function za(t,e,n={}){const[s,i,r]=_i(t,n);return s.forEach(o=>{let a=!1,c=!1,u;const l=()=>{o.removeEventListener("pointerleave",p)},h=y=>{u&&(u(y),u=void 0),l()},f=y=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,h(y))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=y=>{if(y.pointerType!=="touch"){if(a){c=!0;return}h(y)}},m=y=>{if(!Ha(y))return;c=!1;const g=e(o,y);typeof g=="function"&&(u=g,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",d,i)}),r}const Xi=(t,e)=>e?t===e?!0:Xi(t,e.parentElement):!1,Sn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ga=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _a(t){return Ga.has(t.tagName)||t.isContentEditable===!0}const Xa=new Set(["INPUT","SELECT","TEXTAREA"]);function Ya(t){return Xa.has(t.tagName)||t.isContentEditable===!0}const qt=new WeakSet;function Xn(t){return e=>{e.key==="Enter"&&t(e)}}function we(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const qa=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Xn(()=>{if(qt.has(n))return;we(n,"down");const i=Xn(()=>{we(n,"up")}),r=()=>we(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 Yn(t){return Sn(t)&&!Gi()}const qn=new WeakSet;function Za(t,e,n={}){const[s,i,r]=_i(t,n),o=a=>{const c=a.currentTarget;if(!Yn(a)||qn.has(a))return;qt.add(c),n.stopPropagation&&qn.add(a);const u=e(c,a),l=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),qt.has(c)&&qt.delete(c),Yn(d)&&typeof u=="function"&&u(d,{success:p})},h=d=>{l(d,c===window||c===document||n.useGlobalTarget||Xi(c,d.target))},f=d=>{l(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Yt(a)&&(a.addEventListener("focus",u=>qa(u,i)),!_a(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function bn(t){return Js(t)&&"ownerSVGElement"in t}const Zt=new WeakMap;let Jt;const Yi=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:bn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Ja=Yi("inline","width","offsetWidth"),Qa=Yi("block","height","offsetHeight");function tl({target:t,borderBoxSize:e}){Zt.get(t)?.forEach(n=>{n(t,{get width(){return Ja(t,e)},get height(){return Qa(t,e)}})})}function el(t){t.forEach(tl)}function nl(){typeof ResizeObserver>"u"||(Jt=new ResizeObserver(el))}function sl(t,e){Jt||nl();const n=wn(t);return n.forEach(s=>{let i=Zt.get(s);i||(i=new Set,Zt.set(s,i)),i.add(e),Jt?.observe(s)}),()=>{n.forEach(s=>{const i=Zt.get(s);i?.delete(e),i?.size||Jt?.unobserve(s)})}}const Qt=new Set;let yt;function il(){yt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Qt.forEach(e=>e(t))},window.addEventListener("resize",yt)}function ol(t){return Qt.add(t),yt||il(),()=>{Qt.delete(t),!Qt.size&&typeof yt=="function"&&(window.removeEventListener("resize",yt),yt=void 0)}}function Zn(t,e){return typeof t=="function"?ol(t):sl(t,e)}function rl(t){return bn(t)&&t.tagName==="svg"}function al(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=Si(i,r,o);return e?a(s):a}function ll(t,e,n={}){const s=t.get();let i=null,r=s,o;const a=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,c=()=>{i&&(i.stop(),i=null)},u=()=>{const h=Qn(t.get()),f=Qn(r);if(h===f){c();return}const d=i?i.getGeneratorVelocity():t.getVelocity();c(),i=new he({keyframes:[h,f],velocity:d,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},l=()=>{u(),t.events.animationStart?.notify(),i?.then(()=>{t.events.animationComplete?.notify()})};if(t.attach((h,f)=>{r=h,o=d=>f(Jn(d,a)),C.postRender(l)},c),F(e)){const h=e.on("change",d=>t.set(Jn(d,a))),f=t.on("destroy",h);return()=>{h(),f()}}return c}function Jn(t,e){return e?t+e:t}function Qn(t){return typeof t=="number"?t:parseFloat(t)}const cl=[...Ki,L,_],ul=t=>cl.find(Wi(t)),ts=()=>({translate:0,scale:1,origin:0,originPoint:0}),vt=()=>({x:ts(),y:ts()}),es=()=>({min:0,max:0}),k=()=>({x:es(),y:es()}),hl=new WeakMap;function fe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ft(t){return typeof t=="string"||Array.isArray(t)}const An=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vn=["initial",...An];function de(t){return fe(t.animate)||Vn.some(e=>Ft(t[e]))}function qi(t){return!!(de(t)||t.variants)}function fl(t,e,n){for(const s in e){const i=e[s],r=n[s];if(F(i))t.addValue(s,i);else if(F(r))t.addValue(s,dt(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,dt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Xe={current:null},Zi={current:!1},dl=typeof window<"u";function pl(){if(Zi.current=!0,!!dl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Xe.current=t.matches;t.addEventListener("change",e),e()}else Xe.current=!1}const ns=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let re={};function Ji(t){re=t}function ml(){return re}class gl{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=mn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=N.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,C.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=de(n),this.isVariantNode=qi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];u[d]!==void 0&&F(p)&&p.set(u[d])}}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,hl.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:(Zi.current||pl(),this.shouldReduceMotion=Xe.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(),st(this.notifyUpdate),st(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&&Ka.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,h=new Li({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:W(l)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=At.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&C.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in re){const n=re[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):k()}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<ns.length;s++){const i=ns[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=fl(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=dt(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"&&(Zs(s)||Qs(s))?s=parseFloat(s):!ul(s)&&_.test(n)&&(s=Hi(e,n)),this.setBaseTarget(e,F(s)?s.get():s)),F(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=vn(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&&!F(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 on),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Pn.render(this.render)}}class Qi extends gl{constructor(){super(...arguments),this.KeyframeResolver=Wa}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;F(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 to({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function yl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function vl(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 Pe(t){return t===void 0||t===1}function Ye({scale:t,scaleX:e,scaleY:n}){return!Pe(t)||!Pe(e)||!Pe(n)}function ct(t){return Ye(t)||eo(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function eo(t){return ss(t.x)||ss(t.y)}function ss(t){return t&&t!=="0%"}function ae(t,e,n){const s=t-n,i=e*s;return n+i}function is(t,e,n,s,i){return i!==void 0&&(t=ae(t,i,s)),ae(t,n,s)+e}function qe(t,e=0,n=1,s,i){t.min=is(t.min,e,n,s,i),t.max=is(t.max,e,n,s,i)}function no(t,{x:e,y:n}){qe(t.x,e.translate,e.scale,e.originPoint),qe(t.y,n.translate,n.scale,n.originPoint)}const os=.999999999999,rs=1.0000000000001;function Tl(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&&xt(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,no(t,o)),s&&ct(r.latestValues)&&xt(t,r.latestValues,r.layout?.layoutBox))}e.x<rs&&e.x>os&&(e.x=1),e.y<rs&&e.y>os&&(e.y=1)}function Tt(t,e){t.min=t.min+e,t.max=t.max+e}function as(t,e,n,s,i=.5){const r=E(t.min,t.max,i);qe(t,e,n,r,s)}function ls(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function xt(t,e,n){const s=n??t;as(t.x,ls(e.x,s.x),e.scaleX,e.scale,e.originX),as(t.y,ls(e.y,s.y),e.scaleY,e.scale,e.originY)}function so(t,e){return to(vl(t.getBoundingClientRect(),e))}function xl(t,e,n){const s=so(t,n),{scroll:i}=e;return i&&(Tt(s.x,i.offset.x),Tt(s.y,i.offset.y)),s}const wl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Pl=bt.length;function Sl(t,e,n){let s="",i=!0;for(let r=0;r<Pl;r++){const o=bt[r],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);c=o.startsWith("scale")?u===1:u===0}if(!c||n){const u=zi(a,xn[o]);if(!c){i=!1;const l=wl[o]||o;s+=`${l}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Cn(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(At.has(c)){o=!0;continue}else if(pi(c)){i[c]=u;continue}else{const l=zi(u,xn[c]);c.startsWith("origin")?(a=!0,r[c]=l):s[c]=l}}if(e.transform||(o||n?s.transform=Sl(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 io(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 cs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Vt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=cs(t,e.target.x),s=cs(t,e.target.y);return`${n}% ${s}%`}},bl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=_.parse(t);if(i.length>5)return s;const r=_.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const u=E(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},Ze={borderRadius:{...Vt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vt,borderTopRightRadius:Vt,borderBottomLeftRadius:Vt,borderBottomRightRadius:Vt,boxShadow:bl};function oo(t,{layout:e,layoutId:n}){return At.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ze[t]||t==="opacity")}function Mn(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(F(s[o])||i&&F(i[o])||oo(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function Al(t){return window.getComputedStyle(t)}class Vl extends Qi{constructor(){super(...arguments),this.type="html",this.renderInstance=io}readValueFromInstance(e,n){if(At.has(n))return this.projection?.isProjecting?je(n):Hr(e,n);{const s=Al(e),i=(pi(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return so(e,n)}build(e,n,s){Cn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Mn(e,n,s)}}const Cl={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ml={offset:"strokeDashoffset",array:"strokeDasharray"};function Dl(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Cl:Ml;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const El=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ro(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,u,l){if(Cn(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=l?.transformBox??"fill-box",delete h.transformBox);for(const d of El)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Dl(h,i,r,o,!1)}const ao=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"]),lo=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Rl(t,e,n,s){io(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(ao.has(i)?i:Tn(i),e.attrs[i])}function co(t,e,n){const s=Mn(t,e,n);for(const i in t)if(F(t[i])||F(e[i])){const r=bt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class Ll extends Qi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(At.has(n)){const s=$i(n);return s&&s.default||0}return n=ao.has(n)?n:Tn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return co(e,n,s)}build(e,n,s){ro(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Rl(e,n,s,i)}mount(e){this.isSVGTag=lo(e.tagName),super.mount(e)}}const kl=Vn.length;function uo(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?uo(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<kl;n++){const s=Vn[n],i=t.props[s];(Ft(i)||i===!1)&&(e[s]=i)}return e}function ho(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 Il=[...An].reverse(),Fl=An.length;function Bl(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Ea(t,n,s)))}function jl(t){let e=Bl(t),n=us(),s=!0,i=!1;const r=u=>(l,h)=>{const f=wt(t,h,u==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;l={...l,...m,...p}}return l};function o(u){e=u(t)}function a(u){const{props:l}=t,h=uo(t.parent)||{},f=[],d=new Set;let p={},m=1/0;for(let g=0;g<Fl;g++){const x=Il[g],T=n[x],w=l[x]!==void 0?l[x]:h[x],b=Ft(w),D=x===u?T.isActive:null;D===!1&&(m=g);let I=w===h[x]&&w!==l[x]&&b;if(I&&(s||i)&&t.manuallyAnimateOnMount&&(I=!1),T.protectedKeys={...p},!T.isActive&&D===null||!w&&!T.prevProp||fe(w)||typeof w=="boolean")continue;if(x==="exit"&&T.isActive&&D!==!0){T.prevResolvedValues&&(p={...p,...T.prevResolvedValues});continue}const A=Ol(T.prevProp,w);let V=A||x===u&&T.isActive&&!I&&b||g>m&&b,S=!1;const M=Array.isArray(w)?w:[w];let B=M.reduce(r(x),{});D===!1&&(B={});const{prevResolvedValues:Q={}}=T,X={...Q,...B},tt=j=>{V=!0,d.has(j)&&(S=!0,d.delete(j)),T.needsAnimating[j]=!0;const K=t.getValue(j);K&&(K.liveStyle=!1)};for(const j in X){const K=B[j],at=Q[j];if(p.hasOwnProperty(j))continue;let pt=!1;$e(K)&&$e(at)?pt=!ho(K,at):pt=K!==at,pt?K!=null?tt(j):d.add(j):K!==void 0&&d.has(j)?tt(j):T.protectedKeys[j]=!0}T.prevProp=w,T.prevResolvedValues=B,T.isActive&&(p={...p,...B}),(s||i)&&t.blockInitialAnimation&&(V=!1);const Y=I&&A;V&&(!Y||S)&&f.push(...M.map(j=>{const K={type:x};if(typeof j=="string"&&(s||i)&&!Y&&t.manuallyAnimateOnMount&&t.parent){const{parent:at}=t,pt=wt(at,j);if(at.enteringChildren&&pt){const{delayChildren:Oo}=pt.transition||{};K.delay=Ii(at.enteringChildren,t,Oo)}}return{animation:j,options:K}}))}if(d.size){const g={};if(typeof l.initial!="boolean"){const x=wt(t,Array.isArray(l.initial)?l.initial[0]:l.initial);x&&x.transition&&(g.transition=x.transition)}d.forEach(x=>{const T=t.getBaseTarget(x),w=t.getValue(x);w&&(w.liveStyle=!0),g[x]=T??null}),f.push({animation:g})}let y=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(y=!1),s=!1,i=!1,y?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 h=a(u);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=us(),i=!0}}}function Ol(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!ho(e,t):!1}function lt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function us(){return{animate:lt(!0),whileInView:lt(),whileHover:lt(),whileTap:lt(),whileDrag:lt(),whileFocus:lt(),exit:lt()}}function hs(t,e){t.min=e.min,t.max=e.max}function z(t,e){hs(t.x,e.x),hs(t.y,e.y)}function fs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const fo=1e-4,Nl=1-fo,Ul=1+fo,po=.01,Wl=0-po,Kl=0+po;function U(t){return t.max-t.min}function $l(t,e,n){return Math.abs(t-e)<=n}function ds(t,e,n,s=.5){t.origin=s,t.originPoint=E(e.min,e.max,t.origin),t.scale=U(n)/U(e),t.translate=E(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Nl&&t.scale<=Ul||isNaN(t.scale))&&(t.scale=1),(t.translate>=Wl&&t.translate<=Kl||isNaN(t.translate))&&(t.translate=0)}function Rt(t,e,n,s){ds(t.x,e.x,n.x,s?s.originX:void 0),ds(t.y,e.y,n.y,s?s.originY:void 0)}function ps(t,e,n){t.min=n.min+e.min,t.max=t.min+U(e)}function Hl(t,e,n){ps(t.x,e.x,n.x),ps(t.y,e.y,n.y)}function ms(t,e,n){t.min=e.min-n.min,t.max=t.min+U(e)}function le(t,e,n){ms(t.x,e.x,n.x),ms(t.y,e.y,n.y)}function gs(t,e,n,s,i){return t-=e,t=ae(t,1/n,s),i!==void 0&&(t=ae(t,1/i,s)),t}function zl(t,e=0,n=1,s=.5,i,r=t,o=t){if(Z.test(e)&&(e=parseFloat(e),e=E(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=E(r.min,r.max,s);t===r&&(a-=e),t.min=gs(t.min,e,n,a,i),t.max=gs(t.max,e,n,a,i)}function ys(t,e,[n,s,i],r,o){zl(t,e[n],e[s],e[i],e.scale,r,o)}const Gl=["x","scaleX","originX"],_l=["y","scaleY","originY"];function vs(t,e,n,s){ys(t.x,e,Gl,n?n.x:void 0,s?s.x:void 0),ys(t.y,e,_l,n?n.y:void 0,s?s.y:void 0)}function Ts(t){return t.translate===0&&t.scale===1}function mo(t){return Ts(t.x)&&Ts(t.y)}function xs(t,e){return t.min===e.min&&t.max===e.max}function Xl(t,e){return xs(t.x,e.x)&&xs(t.y,e.y)}function ws(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function go(t,e){return ws(t.x,e.x)&&ws(t.y,e.y)}function Ps(t){return U(t.x)/U(t.y)}function Ss(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function q(t){return[t("x"),t("y")]}function Yl(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,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),l&&(s+=`rotate(${l}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const yo=["TopLeft","TopRight","BottomLeft","BottomRight"],ql=yo.length,bs=t=>typeof t=="string"?parseFloat(t):t,As=t=>typeof t=="number"||P.test(t);function Zl(t,e,n,s,i,r){i?(t.opacity=E(0,n.opacity??1,Jl(s)),t.opacityExit=E(e.opacity??1,0,Ql(s))):r&&(t.opacity=E(e.opacity??1,n.opacity??1,s));for(let o=0;o<ql;o++){const a=`border${yo[o]}Radius`;let c=Vs(e,a),u=Vs(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||As(c)===As(u)?(t[a]=Math.max(E(bs(c),bs(u),s),0),(Z.test(u)||Z.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=E(e.rotate||0,n.rotate||0,s))}function Vs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Jl=vo(0,.5,li),Ql=vo(.5,.95,H);function vo(t,e,n){return s=>s<t?0:s>e?1:n(kt(t,e,s))}function tc(t,e,n){const s=F(t)?t:dt(t);return s.start(yn("",s,e,n)),s.animation}function Bt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const ec=(t,e)=>t.depth-e.depth;class nc{constructor(){this.children=[],this.isDirty=!1}add(e){nn(this.children,e),this.isDirty=!0}remove(e){ne(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ec),this.isDirty=!1,this.children.forEach(e)}}function sc(t,e){const n=N.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(st(s),t(r-e))};return C.setup(s,!0),()=>st(s)}function te(t){return F(t)?t.get():t}class ic{constructor(){this.members=[]}add(e){nn(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&&(ne(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(ne(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 ee={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Se=["","X","Y","Z"],oc=1e3;let rc=0;function be(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function To(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ni(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",C,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&To(s)}function xo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=rc++,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(cc),this.nodes.forEach(dc),this.nodes.forEach(pc),this.nodes.forEach(uc)},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 nc)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new on),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=bn(o)&&!rl(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,h=0;const f=()=>this.root.updateBlockedByResize=!1;C.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,l&&l(),l=sc(f,250),ee.hasAnimatedSinceResize&&(ee.hasAnimatedSinceResize=!1,this.nodes.forEach(Ds)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Tc,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!go(this.targetLayout,d),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...gn(p,"layout"),onPlay:m,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(l,x)}else h||Ds(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),st(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(mc),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&&To(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const h=this.path[l];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout: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()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Cs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ms);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(fc),this.nodes.forEach(ac),this.nodes.forEach(lc)):this.nodes.forEach(Ms),this.clearAllSnapshots();const a=N.now();O.delta=J(0,1e3/60,a-O.timestamp),O.timestamp=a,O.isProcessing=!0,me.update.process(O),me.preRender.process(O),me.render.process(O),O.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hc),this.sharedNodes.forEach(gc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,C.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){C.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!U(this.snapshot.measuredBox.x)&&!U(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=k(),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&&!mo(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||ct(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)),xc(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return k();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(wc))){const{scroll:u}=this.root;u&&(Tt(a.x,u.offset.x),Tt(a.y,u.offset.y))}return a}removeElementScroll(o){const a=k();if(z(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:h}=u;u!==this.root&&l&&h.layoutScroll&&(l.wasRoot&&z(a,o),Tt(a.x,l.offset.x),Tt(a.y,l.offset.y))}return a}applyTransform(o,a=!1){const c=k();z(c,o);for(let u=0;u<this.path.length;u++){const l=this.path[u];!a&&l.options.layoutScroll&&l.scroll&&l!==l.root&&xt(c,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),ct(l.latestValues)&&xt(c,l.latestValues,l.layout?.layoutBox)}return ct(this.latestValues)&&xt(c,this.latestValues,this.layout?.layoutBox),c}removeTransform(o){const a=k();z(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!ct(u.latestValues))continue;let l;u.instance&&(Ye(u.latestValues)&&u.updateSnapshot(),l=k(),z(l,u.measurePageBox())),vs(a,u.latestValues,u.snapshot?.layoutBox,l)}return ct(this.latestValues)&&vs(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==O.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){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:h}=this.options;if(!this.layout||!(l||h))return;this.resolvedRelativeTargetAt=O.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=k(),this.targetWithTransforms=k()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Hl(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):z(this.target,this.layout.layoutBox),no(this.target,this.targetDelta)):z(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!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||Ye(this.parent.latestValues)||eo(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=k(),this.relativeTargetOrigin=k(),le(this.relativeTargetOrigin,a,c),z(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===O.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;z(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Tl(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=k());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fs(this.prevProjectionDelta.x,this.projectionDelta.x),fs(this.prevProjectionDelta.y,this.projectionDelta.y)),Rt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Ss(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ss(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){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=vt(),this.projectionDelta=vt(),this.projectionDeltaWithTransform=vt()}setAnimationOrigin(o,a=!1){const c=this.snapshot,u=c?c.latestValues:{},l={...this.latestValues},h=vt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=k(),d=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,y=this.getStack(),g=!y||y.members.length<=1,x=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(vc));this.animationProgress=0;let T;this.mixTargetDelta=w=>{const b=w/1e3;Es(h.x,o.x,b),Es(h.y,o.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(le(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),yc(this.relativeTarget,this.relativeTargetOrigin,f,b),T&&Xl(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=k()),z(T,this.relativeTarget)),m&&(this.animationValues=l,Zl(l,u,this.latestValues,b,x,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(st(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=C.update(()=>{ee.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=dt(0)),this.motionValue.jump(0,!1),this.currentAnimation=tc(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(oc),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&&wo(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||k();const h=U(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const f=U(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}z(a,c),xt(a,l),Rt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ic),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&&be("z",o,u,this.animationValues);for(let l=0;l<Se.length;l++)be(`rotate${Se[l]}`,o,u,this.animationValues),be(`skew${Se[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=te(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=te(a?.pointerEvents)||""),this.hasProjected&&!ct(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Yl(this.projectionDeltaWithTransform,this.treeScale,l);c&&(h=c(l,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.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 p in Ze){if(l[p]===void 0)continue;const{correct:m,applyTo:y,isCSSVariable:g}=Ze[p],x=h==="none"?l[p]:m(l[p],u);if(y){const T=y.length;for(let w=0;w<T;w++)o[y[w]]=x}else g?this.options.visualElement.renderState.vars[p]=x:o[p]=x}this.options.layoutId&&(o.pointerEvents=u===this?te(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(Cs),this.root.sharedNodes.clear()}}}function ac(t){t.updateLayout()}function lc(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;i==="size"?q(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=U(h);h.min=n[l].min,h.max=h.min+f}):wo(i,e.layoutBox,n)&&q(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=U(n[l]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+f)});const o=vt();Rt(o,n,e.layoutBox);const a=vt();r?Rt(a,t.applyTransform(s,!0),e.measuredBox):Rt(a,n,e.layoutBox);const c=!mo(o);let u=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:h,layout:f}=l;if(h&&f){const d=k();le(d,e.layoutBox,h.layoutBox);const p=k();le(p,n,f.layoutBox),go(d,p)||(u=!0),l.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=d,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 cc(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function uc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function hc(t){t.clearSnapshot()}function Cs(t){t.clearMeasurements()}function Ms(t){t.isLayoutDirty=!1}function fc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ds(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function dc(t){t.resolveTargetDelta()}function pc(t){t.calcProjection()}function mc(t){t.resetSkewAndRotation()}function gc(t){t.removeLeadSnapshot()}function Es(t,e,n){t.translate=E(e.translate,0,n),t.scale=E(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Rs(t,e,n,s){t.min=E(e.min,n.min,s),t.max=E(e.max,n.max,s)}function yc(t,e,n,s){Rs(t.x,e.x,n.x,s),Rs(t.y,e.y,n.y,s)}function vc(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Tc={duration:.45,ease:[.4,0,.1,1]},Ls=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ks=Ls("applewebkit/")&&!Ls("chrome/")?Math.round:H;function Is(t){t.min=ks(t.min),t.max=ks(t.max)}function xc(t){Is(t.x),Is(t.y)}function wo(t,e,n){return t==="position"||t==="preserve-aspect"&&!$l(Ps(e),Ps(n),.2)}function wc(t){return t!==t.root&&t.scroll?.wasRoot}const Pc=xo({attachResizeListener:(t,e)=>Bt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Ae={current:void 0},Po=xo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ae.current){const t=new Pc({});t.mount(window),t.setOptions({layoutScroll:!0}),Ae.current=t}return Ae.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Wt=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Fs(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Sc(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Fs(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():Fs(t[i],null)}}}}function bc(...t){return v.useCallback(Sc(...t),t)}class Ac extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(Yt(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=Yt(s)&&s.offsetWidth||0,r=Yt(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Vc({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}),{nonce:u}=v.useContext(Wt),l=t.props?.ref??t?.ref,h=bc(a,l);return v.useInsertionEffect(()=>{const{width:f,height:d,top:p,left:m,right:y,bottom:g}=c.current;if(e||r===!1||!a.current||!f||!d)return;const x=n==="left"?`left: ${m}`:`right: ${y}`,T=s==="bottom"?`bottom: ${g}`:`top: ${p}`;a.current.dataset.motionPopId=o;const w=document.createElement("style");u&&(w.nonce=u);const b=i??document.head;return b.appendChild(w),w.sheet&&w.sheet.insertRule(`
2
+ [data-motion-pop-id="${o}"] {
3
+ position: absolute !important;
4
+ width: ${f}px !important;
5
+ height: ${d}px !important;
6
+ ${x}px !important;
7
+ ${T}px !important;
8
+ }
9
+ `),()=>{b.contains(w)&&b.removeChild(w)}},[e]),et.jsx(Ac,{isPresent:e,childRef:a,sizeRef:c,pop:r,children:r===!1?t:v.cloneElement(t,{ref:h})})}const Cc=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:c,root:u})=>{const l=jt(Mc),h=v.useId();let f=!0,d=v.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const m of l.values())if(!m)return;s&&s()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,s]);return r&&f&&(d={...d}),v.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),v.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),t=et.jsx(Vc,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),et.jsx(ue.Provider,{value:d,children:t})};function Mc(){return new Map}function So(t=!0){const e=v.useContext(ue);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 zt=t=>t.key||"";function Bs(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const Hu=({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,h]=So(o),f=v.useMemo(()=>Bs(t),[t]),d=o&&!l?[]:f.map(zt),p=v.useRef(!0),m=v.useRef(f),y=jt(()=>new Map),g=v.useRef(new Set),[x,T]=v.useState(f),[w,b]=v.useState(f);en(()=>{p.current=!1,m.current=f;for(let A=0;A<w.length;A++){const V=zt(w[A]);d.includes(V)?(y.delete(V),g.current.delete(V)):y.get(V)!==!0&&y.set(V,!1)}},[w,d.length,d.join("-")]);const D=[];if(f!==x){let A=[...f];for(let V=0;V<w.length;V++){const S=w[V],M=zt(S);d.includes(M)||(A.splice(V,0,S),D.push(S))}return r==="wait"&&D.length&&(A=D),b(Bs(A)),T(f),null}const{forceRender:I}=v.useContext(tn);return et.jsx(et.Fragment,{children:w.map(A=>{const V=zt(A),S=o&&!l?!1:f===w||d.includes(V),M=()=>{if(g.current.has(V))return;if(g.current.add(V),y.has(V))y.set(V,!0);else return;let B=!0;y.forEach(Q=>{Q||(B=!1)}),B&&(I?.(),b(m.current),o&&h?.(),s&&s())};return et.jsx(Cc,{isPresent:S,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:u,onExitComplete:S?void 0:M,anchorX:a,anchorY:c,children:A},V)})})},bo=v.createContext({strict:!1}),js={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 Os=!1;function Dc(){if(Os)return;const t={};for(const e in js)t[e]={isEnabled:n=>js[e].some(s=>!!n[s])};Ji(t),Os=!0}function Ao(){return Dc(),ml()}function Ec(t){const e=Ao();for(const n in t)e[n]={...e[n],...t[n]};Ji(e)}const Rc=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 ce(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Rc.has(t)}let Vo=t=>!ce(t);function Lc(t){typeof t=="function"&&(Vo=e=>e.startsWith("on")?!ce(e):t(e))}try{Lc(require("@emotion/is-prop-valid").default)}catch{}function kc(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Vo(i)||n===!0&&ce(i)||!e&&!ce(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const pe=v.createContext({});function Ic(t,e){if(de(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Ft(n)?n:void 0,animate:Ft(s)?s:void 0}}return t.inherit!==!1?e:{}}function Fc(t){const{initial:e,animate:n}=Ic(t,v.useContext(pe));return v.useMemo(()=>({initial:e,animate:n}),[Ns(e),Ns(n)])}function Ns(t){return Array.isArray(t)?t.join(" "):t}const Dn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Co(t,e,n){for(const s in e)!F(e[s])&&!oo(s,n)&&(t[s]=e[s])}function Bc({transformTemplate:t},e){return v.useMemo(()=>{const n=Dn();return Cn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function jc(t,e){const n=t.style||{},s={};return Co(s,n,t),Object.assign(s,Bc(t,e)),s}function Oc(t,e){const n={},s=jc(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 Mo=()=>({...Dn(),attrs:{}});function Nc(t,e,n,s){const i=v.useMemo(()=>{const r=Mo();return ro(r,e,lo(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Co(r,t.style,t),i.style={...r,...i.style}}return i}const Uc=["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 En(t){return typeof t!="string"||t.includes("-")?!1:!!(Uc.indexOf(t)>-1||/[A-Z]/u.test(t))}function Wc(t,e,n,{latestValues:s},i,r=!1,o){const c=(o??En(t)?Nc:Oc)(e,s,i,t),u=kc(e,typeof t=="string",r),l=t!==v.Fragment?{...u,...c,ref:n}:{},{children:h}=e,f=v.useMemo(()=>F(h)?h.get():h,[h]);return v.createElement(t,{...l,children:f})}function Kc({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:$c(n,s,i,t),renderState:e()}}function $c(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=te(r[f]);let{initial:o,animate:a}=t;const c=de(t),u=qi(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 h=l?a:o;if(h&&typeof h!="boolean"&&!fe(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=vn(t,f[d]);if(p){const{transitionEnd:m,transition:y,...g}=p;for(const x in g){let T=g[x];if(Array.isArray(T)){const w=l?T.length-1:0;T=T[w]}T!==null&&(i[x]=T)}for(const x in m)i[x]=m[x]}}}return i}const Do=t=>(e,n)=>{const s=v.useContext(pe),i=v.useContext(ue),r=()=>Kc(t,e,s,i);return n?r():jt(r)},Hc=Do({scrapeMotionValuesFromProps:Mn,createRenderState:Dn}),zc=Do({scrapeMotionValuesFromProps:co,createRenderState:Mo}),Gc=Symbol.for("motionComponentSymbol");function _c(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);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&&(r?e.mount(r):e.unmount())},[e])}const Eo=v.createContext({});function mt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Xc(t,e,n,s,i,r){const{visualElement:o}=v.useContext(pe),a=v.useContext(bo),c=v.useContext(ue),u=v.useContext(Wt),l=u.reducedMotion,h=u.skipAnimations,f=v.useRef(null),d=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:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,m=v.useContext(Eo);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&Yc(f.current,n,i,m);const y=v.useRef(!1);v.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const g=n[Oi],x=v.useRef(!!g&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return en(()=>{d.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),x.current&&p.animationState&&p.animationState.animateChanges())}),v.useEffect(()=>{p&&(!x.current&&p.animationState&&p.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),x.current=!1),p.enteringChildren=void 0)}),p}function Yc(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutCrossfade:l}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ro(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&mt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:l,layoutScroll:c,layoutRoot:u})}function Ro(t){if(t)return t.options.allowProjection!==!1?t.projection:Ro(t.parent)}function Ve(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Ec(s);const r=n?n==="svg":En(t),o=r?zc:Hc;function a(u,l){let h;const f={...v.useContext(Wt),...u,layoutId:qc(u)},{isStatic:d}=f,p=Fc(u),m=o(u,d);if(!d&&typeof window<"u"){Zc();const y=Jc(f);h=y.MeasureLayout,p.visualElement=Xc(t,m,f,i,y.ProjectionNode,r)}return et.jsxs(pe.Provider,{value:p,children:[h&&p.visualElement?et.jsx(h,{visualElement:p.visualElement,...f}):null,Wc(t,u,_c(m,p.visualElement,l),m,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=v.forwardRef(a);return c[Gc]=t,c}function qc({layoutId:t}){const e=v.useContext(tn).id;return e&&t!==void 0?e+"-"+t:t}function Zc(t,e){v.useContext(bo).strict}function Jc(t){const e=Ao(),{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 Qc(t,e){if(typeof Proxy>"u")return Ve;const n=new Map,s=(r,o)=>Ve(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,Ve(o,void 0,t,e)),n.get(o))})}const tu=(t,e)=>e.isSVG??En(t)?new Ll(e):new Vl(e,{allowProjection:t!==v.Fragment});class eu extends rt{constructor(e){super(e),e.animationState||(e.animationState=jl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();fe(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 nu=0;class su extends rt{constructor(){super(...arguments),this.id=nu++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const iu={animation:{Feature:eu},exit:{Feature:su}};function Kt(t){return{point:{x:t.pageX,y:t.pageY}}}const ou=t=>e=>Sn(e)&&t(e,Kt(e));function Lt(t,e,n,s){return Bt(t,e,ou(n),s)}const Lo=({current:t})=>t?t.ownerDocument.defaultView:null,Us=(t,e)=>Math.abs(t-e);function ru(t,e){const n=Us(t.x,e.x),s=Us(t.y,e.y);return Math.sqrt(n**2+s**2)}const Ws=new Set(["auto","scroll"]);class ko{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Gt(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Ce(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=ru(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:y}=d,{timestamp:g}=O;this.history.push({...y,timestamp:g});const{onStart:x,onMove:T}=this.handlers;p||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=Gt(p,this.transformPagePoint),C.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ce(d.type==="pointercancel"?this.lastMoveEventInfo:Gt(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,x),y&&y(d,x)},!Sn(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const c=Kt(e),u=Gt(c,this.transformPagePoint),{point:l}=u,{timestamp:h}=O;this.history=[{...l,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Ce(u,this.history)),this.removeListeners=Ot(Lt(this.contextWindow,"pointermove",this.handlePointerMove),Lt(this.contextWindow,"pointerup",this.handlePointerUp),Lt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Ws.has(s.overflowX)||Ws.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),C.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),st(this.updatePoint)}}function Gt(t,e){return e?{point:e(t.point)}:t}function Ks(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ce({point:t},e){return{point:t,delta:Ks(t,Io(e)),offset:Ks(t,au(e)),velocity:lu(e,.1)}}function au(t){return t[0]}function Io(t){return t[t.length-1]}function lu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Io(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>W(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>W(e)*2&&(s=t[1]);const r=$(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function cu(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?E(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?E(n,t,s.max):Math.min(t,n)),t}function $s(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 uu(t,{top:e,left:n,bottom:s,right:i}){return{x:$s(t.x,n,i),y:$s(t.y,e,s)}}function Hs(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 hu(t,e){return{x:Hs(t.x,e.x),y:Hs(t.y,e.y)}}function fu(t,e){let n=.5;const s=U(t),i=U(e);return i>s?n=kt(e.min,e.max-s,t.min):s>i&&(n=kt(t.min,t.max-i,e.min)),J(0,1,n)}function du(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 Je=.35;function pu(t=Je){return t===!1?t=0:t===!0&&(t=Je),{x:zs(t,"left","right"),y:zs(t,"top","bottom")}}function zs(t,e,n){return{min:Gs(t,e),max:Gs(t,n)}}function Gs(t,e){return typeof t=="number"?t:t[e]||0}const mu=new WeakMap;class gu{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=k(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(Kt(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$a(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),q(g=>{let x=this.getAxisMotionValue(g).get()||0;if(Z.test(x)){const{projection:T}=this.visualElement;if(T&&T.layout){const w=T.layout.layoutBox[g];w&&(x=U(w)*(parseFloat(x)/100))}}this.originPoint[g]=x}),m&&C.update(()=>m(h,f),!1,!0),He(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:g}=f;if(p&&this.currentDirection===null){this.currentDirection=vu(g),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),y&&C.update(()=>y(h,f),!1,!0)},c=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new ko(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Lo(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&&C.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||!_t(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=cu(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&&mt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=uu(s.layoutBox,e):this.constraints=!1,this.elastic=pu(n),i!==this.constraints&&!mt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&q(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=du(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!mt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=xl(s,i.root,this.visualElement.getTransformPagePoint());let o=hu(i.layout.layoutBox,r);if(n){const a=n(yl(o));this.hasMutatedConstraints=!!a,a&&(o=to(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=q(l=>{if(!_t(l,n,this.currentDirection))return;let h=c&&c[l]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[l]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(l,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return He(this.visualElement,e),s.start(yn(e,s,0,n,this.visualElement,!1))}stopAnimation(){q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){q(n=>{const{drag:s}=this.getProps();if(!_t(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]-E(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!mt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};q(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=fu({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(),q(o=>{if(!_t(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(E(c,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;mu.set(this.visualElement,this);const e=this.visualElement.current,n=Lt(e,"pointerdown",u=>{const{drag:l,dragListener:h=!0}=this.getProps(),f=u.target,d=f!==e&&Ya(f);l&&h&&!d&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();mt(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=yu(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),C.read(i);const a=Bt(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(q(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].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=Je,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function _s(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function yu(t,e,n){const s=Zn(t,_s(n)),i=Zn(e,_s(n));return()=>{s(),i()}}function _t(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function vu(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Tu extends rt{constructor(e){super(e),this.removeGroupControls=H,this.removeListeners=H,this.controls=new gu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||H}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 Me=t=>(e,n)=>{t&&C.update(()=>t(e,n),!1,!0)};class xu extends rt{constructor(){super(...arguments),this.removePointerDownListener=H}onPointerDown(e){this.session=new ko(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Lo(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Me(e),onStart:Me(n),onMove:Me(s),onEnd:(r,o)=>{delete this.session,i&&C.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Lt(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 De=!1;class wu 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),De&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ee.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}),De=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||C.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Pn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;De=!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 Fo(t){const[e,n]=So(),s=v.useContext(tn);return et.jsx(wu,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(Eo),isPresent:e,safeToRemove:n})}const Pu={pan:{Feature:xu},drag:{Feature:Tu,ProjectionNode:Po,MeasureLayout:Fo}};function Xs(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&&C.postRender(()=>r(e,Kt(e)))}class Su extends rt{mount(){const{current:e}=this.node;e&&(this.unmount=za(e,(n,s)=>(Xs(this.node,s,"Start"),i=>Xs(this.node,i,"End"))))}unmount(){}}class bu 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=Ot(Bt(this.node.current,"focus",()=>this.onFocus()),Bt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ys(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&&C.postRender(()=>r(e,Kt(e)))}class Au extends rt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Za(e,(i,r)=>(Ys(this.node,r,"Start"),(o,{success:a})=>Ys(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const Qe=new WeakMap,Ee=new WeakMap,Vu=t=>{const e=Qe.get(t.target);e&&e(t)},Cu=t=>{t.forEach(Vu)};function Mu({root:t,...e}){const n=t||document;Ee.has(n)||Ee.set(n,{});const s=Ee.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Cu,{root:t,...e})),s[i]}function Du(t,e,n){const s=Mu(e);return Qe.set(t,n),s.observe(t),()=>{Qe.delete(t),s.unobserve(t)}}const Eu={some:0,all:1};class Ru extends rt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Eu[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:h}=this.node.getProps(),f=u?l:h;f&&f(c)};return Du(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(Lu(e,n))&&this.startObserver()}unmount(){}}function Lu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ku={inView:{Feature:Ru},tap:{Feature:Au},focus:{Feature:bu},hover:{Feature:Su}},Iu={layout:{ProjectionNode:Po,MeasureLayout:Fo}},Fu={...iu,...ku,...Pu,...Iu},zu=Qc(Fu,tu);function Bo(t){const e=jt(()=>dt(t)),{isStatic:n}=v.useContext(Wt);if(n){const[,s]=v.useState(t);v.useEffect(()=>e.on("change",s),[])}return e}function jo(t,e){const n=Bo(e()),s=()=>n.set(e());return s(),en(()=>{const i=()=>C.preRender(s,!1,!0),r=t.map(o=>o.on("change",i));return()=>{r.forEach(o=>o()),st(s)}}),n}function Bu(t){Et.current=[],t();const e=jo(Et.current,t);return Et.current=void 0,e}function ju(t,e,n,s){if(typeof t=="function")return Bu(t);const r=typeof e=="function"?e:al(e,n,s),o=Array.isArray(t)?qs(t,r):qs([t],([c])=>r(c)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&s?.clamp!==!1&&(o.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),o}function qs(t,e){const n=jt(()=>[]);return jo(t,()=>{n.length=0;const s=t.length;for(let i=0;i<s;i++)n[i]=t[i].get();return e(n)})}function Ou(t,e={}){const{isStatic:n}=v.useContext(Wt),s=()=>F(t)?t.get():t;if(n)return ju(s);const i=Bo(s());return v.useInsertionEffect(()=>ll(i,t,e),[i,JSON.stringify(e)]),i}function Gu(t,e={}){return Ou(t,{type:"spring",...e})}const Nu={some:0,all:1};function Uu(t,e,{root:n,margin:s,amount:i="some"}={}){const r=wn(t),o=new WeakMap,a=u=>{u.forEach(l=>{const h=o.get(l.target);if(l.isIntersecting!==!!h)if(l.isIntersecting){const f=e(l.target,l);typeof f=="function"?o.set(l.target,f):c.unobserve(l.target)}else typeof h=="function"&&(h(l),o.delete(l.target))})},c=new IntersectionObserver(a,{root:n,rootMargin:s,threshold:typeof i=="number"?i:Nu[i]});return r.forEach(u=>c.observe(u)),()=>c.disconnect()}function _u(t,{root:e,margin:n,amount:s,once:i=!1,initial:r=!1}={}){const[o,a]=v.useState(r);return v.useEffect(()=>{if(!t.current||i&&o)return;const c=()=>(a(!0),i?void 0:()=>a(!1)),u={root:e&&e.current||void 0,margin:n,amount:s};return Uu(t.current,c,u)},[e,t,n,i,s]),o}export{Hu as A,Gu as a,ju as b,zu as m,_u as u};
@@ -0,0 +1 @@
1
+ import{r as e,j as d}from"./query-BSZkMKN4.js";import{c as l}from"./index-jVcSWGwX.js";import{u as w,a as E,b as N}from"./motion-Bw6xJyTE.js";function F({value:t,direction:n="up",delay:o=0,decimalPlaces:u=0,className:c,prefix:f="",suffix:p=""}){const i=e.useRef(null),m=w(i,{once:!0,margin:"0px"}),r=E(n==="down"?t:0,{damping:60,stiffness:100}),a=N(r,s=>Intl.NumberFormat("en-US",{minimumFractionDigits:u,maximumFractionDigits:u}).format(s)),[b,x]=e.useState("");return e.useEffect(()=>{if(m){const s=setTimeout(()=>{r.set(n==="down"?0:t)},o*1e3);return()=>clearTimeout(s)}},[r,m,o,t,n]),e.useEffect(()=>a.on("change",g=>{x(g)}),[a]),d.jsxs("span",{ref:i,className:l("tabular-nums",c),children:[f,b,p]})}export{F as N};
@@ -0,0 +1 @@
1
+ const e={openai:"#10B981",anthropic:"#F59E0B",google:"#3B82F6",deepseek:"#8B5CF6",groq:"#F97316",xai:"#EC4899"},r={openai:{bg:"bg-emerald-500/12",text:"text-emerald-400",border:"border-emerald-500/20"},anthropic:{bg:"bg-amber-500/12",text:"text-amber-400",border:"border-amber-500/20"},google:{bg:"bg-blue-500/12",text:"text-blue-400",border:"border-blue-500/20"},deepseek:{bg:"bg-violet-500/12",text:"text-violet-400",border:"border-violet-500/20"},groq:{bg:"bg-orange-500/12",text:"text-orange-400",border:"border-orange-500/20"},xai:{bg:"bg-pink-500/12",text:"text-pink-400",border:"border-pink-500/20"}},t={bg:"bg-slate-500/12",text:"text-slate-400",border:"border-slate-500/20"};export{e as a,t as d,r as p};
@@ -0,0 +1,4 @@
1
+ function Ot(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var me={exports:{}},ne={};var ke;function At(){if(ke)return ne;ke=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var u in i)u!=="key"&&(s[u]=i[u])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:s}}return ne.Fragment=t,ne.jsx=n,ne.jsxs=n,ne}var Ne;function Vt(){return Ne||(Ne=1,me.exports=At()),me.exports}var Tt=Vt(),ve={exports:{}},w={};var Be;function Ht(){if(Be)return w;Be=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),g=Symbol.iterator;function f(l){return l===null||typeof l!="object"?null:(l=g&&l[g]||l["@@iterator"],typeof l=="function"?l:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,C={};function S(l,m,P){this.props=l,this.context=m,this.refs=C,this.updater=P||h}S.prototype.isReactComponent={},S.prototype.setState=function(l,m){if(typeof l!="object"&&typeof l!="function"&&l!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,l,m,"setState")},S.prototype.forceUpdate=function(l){this.updater.enqueueForceUpdate(this,l,"forceUpdate")};function F(){}F.prototype=S.prototype;function M(l,m,P){this.props=l,this.context=m,this.refs=C,this.updater=P||h}var D=M.prototype=new F;D.constructor=M,p(D,S.prototype),D.isPureReactComponent=!0;var O=Array.isArray;function L(){}var E={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function q(l,m,P){var _=P.ref;return{$$typeof:e,type:l,key:m,ref:_!==void 0?_:null,props:P}}function B(l,m){return q(l.type,m,l.props)}function k(l){return typeof l=="object"&&l!==null&&l.$$typeof===e}function ee(l){var m={"=":"=0",":":"=2"};return"$"+l.replace(/[=:]/g,function(P){return m[P]})}var W=/\/+/g;function pe(l,m){return typeof l=="object"&&l!==null&&l.key!=null?ee(""+l.key):m.toString(36)}function Mt(l){switch(l.status){case"fulfilled":return l.value;case"rejected":throw l.reason;default:switch(typeof l.status=="string"?l.then(L,L):(l.status="pending",l.then(function(m){l.status==="pending"&&(l.status="fulfilled",l.value=m)},function(m){l.status==="pending"&&(l.status="rejected",l.reason=m)})),l.status){case"fulfilled":return l.value;case"rejected":throw l.reason}}throw l}function te(l,m,P,_,I){var x=typeof l;(x==="undefined"||x==="boolean")&&(l=null);var $=!1;if(l===null)$=!0;else switch(x){case"bigint":case"string":case"number":$=!0;break;case"object":switch(l.$$typeof){case e:case t:$=!0;break;case d:return $=l._init,te($(l._payload),m,P,_,I)}}if($)return I=I(l),$=_===""?"."+pe(l,0):_,O(I)?(P="",$!=null&&(P=$.replace(W,"$&/")+"/"),te(I,m,P,"",function($t){return $t})):I!=null&&(k(I)&&(I=B(I,P+(I.key==null||l&&l.key===I.key?"":(""+I.key).replace(W,"$&/")+"/")+$)),m.push(I)),1;$=0;var Q=_===""?".":_+":";if(O(l))for(var G=0;G<l.length;G++)_=l[G],x=Q+pe(_,G),$+=te(_,m,P,x,I);else if(G=f(l),typeof G=="function")for(l=G.call(l),G=0;!(_=l.next()).done;)_=_.value,x=Q+pe(_,G++),$+=te(_,m,P,x,I);else if(x==="object"){if(typeof l.then=="function")return te(Mt(l),m,P,_,I);throw m=String(l),Error("Objects are not valid as a React child (found: "+(m==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":m)+"). If you meant to render a collection of children, use an array instead.")}return $}function le(l,m,P){if(l==null)return l;var _=[],I=0;return te(l,_,"","",function(x){return m.call(P,x,I++)}),_}function It(l){if(l._status===-1){var m=l._result;m=m(),m.then(function(P){(l._status===0||l._status===-1)&&(l._status=1,l._result=P)},function(P){(l._status===0||l._status===-1)&&(l._status=2,l._result=P)}),l._status===-1&&(l._status=0,l._result=m)}if(l._status===1)return l._result.default;throw l._result}var Qe=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var m=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(m))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},xt={map:le,forEach:function(l,m,P){le(l,function(){m.apply(this,arguments)},P)},count:function(l){var m=0;return le(l,function(){m++}),m},toArray:function(l){return le(l,function(m){return m})||[]},only:function(l){if(!k(l))throw Error("React.Children.only expected to receive a single React element child.");return l}};return w.Activity=v,w.Children=xt,w.Component=S,w.Fragment=n,w.Profiler=i,w.PureComponent=M,w.StrictMode=r,w.Suspense=a,w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,w.__COMPILER_RUNTIME={__proto__:null,c:function(l){return E.H.useMemoCache(l)}},w.cache=function(l){return function(){return l.apply(null,arguments)}},w.cacheSignal=function(){return null},w.cloneElement=function(l,m,P){if(l==null)throw Error("The argument must be a React element, but you passed "+l+".");var _=p({},l.props),I=l.key;if(m!=null)for(x in m.key!==void 0&&(I=""+m.key),m)!A.call(m,x)||x==="key"||x==="__self"||x==="__source"||x==="ref"&&m.ref===void 0||(_[x]=m[x]);var x=arguments.length-2;if(x===1)_.children=P;else if(1<x){for(var $=Array(x),Q=0;Q<x;Q++)$[Q]=arguments[Q+2];_.children=$}return q(l.type,I,_)},w.createContext=function(l){return l={$$typeof:o,_currentValue:l,_currentValue2:l,_threadCount:0,Provider:null,Consumer:null},l.Provider=l,l.Consumer={$$typeof:s,_context:l},l},w.createElement=function(l,m,P){var _,I={},x=null;if(m!=null)for(_ in m.key!==void 0&&(x=""+m.key),m)A.call(m,_)&&_!=="key"&&_!=="__self"&&_!=="__source"&&(I[_]=m[_]);var $=arguments.length-2;if($===1)I.children=P;else if(1<$){for(var Q=Array($),G=0;G<$;G++)Q[G]=arguments[G+2];I.children=Q}if(l&&l.defaultProps)for(_ in $=l.defaultProps,$)I[_]===void 0&&(I[_]=$[_]);return q(l,x,I)},w.createRef=function(){return{current:null}},w.forwardRef=function(l){return{$$typeof:u,render:l}},w.isValidElement=k,w.lazy=function(l){return{$$typeof:d,_payload:{_status:-1,_result:l},_init:It}},w.memo=function(l,m){return{$$typeof:c,type:l,compare:m===void 0?null:m}},w.startTransition=function(l){var m=E.T,P={};E.T=P;try{var _=l(),I=E.S;I!==null&&I(P,_),typeof _=="object"&&_!==null&&typeof _.then=="function"&&_.then(L,Qe)}catch(x){Qe(x)}finally{m!==null&&P.types!==null&&(m.types=P.types),E.T=m}},w.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},w.use=function(l){return E.H.use(l)},w.useActionState=function(l,m,P){return E.H.useActionState(l,m,P)},w.useCallback=function(l,m){return E.H.useCallback(l,m)},w.useContext=function(l){return E.H.useContext(l)},w.useDebugValue=function(){},w.useDeferredValue=function(l,m){return E.H.useDeferredValue(l,m)},w.useEffect=function(l,m){return E.H.useEffect(l,m)},w.useEffectEvent=function(l){return E.H.useEffectEvent(l)},w.useId=function(){return E.H.useId()},w.useImperativeHandle=function(l,m,P){return E.H.useImperativeHandle(l,m,P)},w.useInsertionEffect=function(l,m){return E.H.useInsertionEffect(l,m)},w.useLayoutEffect=function(l,m){return E.H.useLayoutEffect(l,m)},w.useMemo=function(l,m){return E.H.useMemo(l,m)},w.useOptimistic=function(l,m){return E.H.useOptimistic(l,m)},w.useReducer=function(l,m,P){return E.H.useReducer(l,m,P)},w.useRef=function(l){return E.H.useRef(l)},w.useState=function(l){return E.H.useState(l)},w.useSyncExternalStore=function(l,m,P){return E.H.useSyncExternalStore(l,m,P)},w.useTransition=function(){return E.H.useTransition()},w.version="19.2.4",w}var Ke;function Lt(){return Ke||(Ke=1,ve.exports=Ht()),ve.exports}var T=Lt();const Gt=Dt(T),dr=Ot({__proto__:null,default:Gt},[T]);var ue=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},bt={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zt=class{#e=bt;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},J=new zt;function jt(e){setTimeout(e,0)}var Z=typeof window>"u"||"Deno"in globalThis;function b(){}function qt(e,t){return typeof e=="function"?e(t):e}function Fe(e){return typeof e=="number"&&e>=0&&e!==1/0}function lt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Y(e,t){return typeof e=="function"?e(t):e}function j(e,t){return typeof e=="function"?e(t):e}function Ye(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:u}=e;if(o){if(r){if(t.queryHash!==Le(o,t.options))return!1}else if(!oe(t.queryKey,o))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||s&&!s(t))}function Xe(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(se(t.options.mutationKey)!==se(s))return!1}else if(!oe(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Le(e,t){return(t?.queryKeyHashFn||se)(e)}function se(e){return JSON.stringify(e,(t,n)=>Me(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function oe(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>oe(e[n],t[n])):!1}var Ut=Object.prototype.hasOwnProperty;function at(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=We(e)&&We(t);if(!r&&!(Me(e)&&Me(t)))return t;const s=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),u=o.length,a=r?new Array(u):{};let c=0;for(let d=0;d<u;d++){const v=r?d:o[d],g=e[v],f=t[v];if(g===f){a[v]=g,(r?d<s:Ut.call(e,v))&&c++;continue}if(g===null||f===null||typeof g!="object"||typeof f!="object"){a[v]=f;continue}const h=at(g,f,n+1);a[v]=h,h===g&&c++}return s===u&&c===s?e:a}function Ee(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function We(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Me(e){if(!Je(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Je(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Je(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qt(e){return new Promise(t=>{J.setTimeout(t,e)})}function Ie(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?at(e,t):t}function kt(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Nt(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ge=Symbol();function ct(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ge?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function dt(e,t){return typeof e=="function"?e(...t):!!e}function Bt(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Kt=class extends ue{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Z&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},be=new Kt;function xe(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var Yt=jt;function Xt(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=Yt;const s=u=>{t?e.push(u):i(()=>{n(u)})},o=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(a=>{n(a)})})})};return{batch:u=>{let a;t++;try{a=u()}finally{t--,t||o()}return a},batchCalls:u=>(...a)=>{s(()=>{u(...a)})},schedule:s,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var V=Xt(),Wt=class extends ue{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Z&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ge=new Wt;function Jt(e){return Math.min(1e3*2**e,3e4)}function ft(e){return(e??"online")==="online"?ge.isOnline():!0}var $e=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function gt(e){let t=!1,n=0,r;const i=xe(),s=()=>i.status!=="pending",o=p=>{if(!s()){const C=new $e(p);g(C),e.onCancel?.(C)}},u=()=>{t=!0},a=()=>{t=!1},c=()=>be.isFocused()&&(e.networkMode==="always"||ge.isOnline())&&e.canRun(),d=()=>ft(e.networkMode)&&e.canRun(),v=p=>{s()||(r?.(),i.resolve(p))},g=p=>{s()||(r?.(),i.reject(p))},f=()=>new Promise(p=>{r=C=>{(s()||c())&&p(C)},e.onPause?.()}).then(()=>{r=void 0,s()||e.onContinue?.()}),h=()=>{if(s())return;let p;const C=n===0?e.initialPromise:void 0;try{p=C??e.fn()}catch(S){p=Promise.reject(S)}Promise.resolve(p).then(v).catch(S=>{if(s())return;const F=e.retry??(Z?0:3),M=e.retryDelay??Jt,D=typeof M=="function"?M(n,S):M,O=F===!0||typeof F=="number"&&n<F||typeof F=="function"&&F(n,S);if(t||!O){g(S);return}n++,e.onFail?.(n,S),Qt(D).then(()=>c()?void 0:f()).then(()=>{t?g(S):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:a,canStart:d,start:()=>(d()?h():f().then(h),i)}}var ht=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fe(this.gcTime)&&(this.#e=J.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Z?1/0:300*1e3))}clearGcTimeout(){this.#e&&(J.clearTimeout(this.#e),this.#e=void 0)}},Zt=class extends ht{#e;#t;#n;#i;#r;#u;#o;constructor(e){super(),this.#o=!1,this.#u=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=et(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#u,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=et(this.options);t.data!==void 0&&(this.setState(Ze(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Ie(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(b).catch(b):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>j(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ge||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Y(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!lt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(a=>a.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,r=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const u=ct(this.options,t),c=(()=>{const d={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#o=!1,this.options.persister?this.options.persister(u,c,this):u(c)},o=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(u),u})();this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=gt({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:u=>{u instanceof $e&&u.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(u,a)=>{this.#s({type:"failed",failureCount:u,error:a})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const u=await this.#r.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof $e){if(u.silent)return this.#r.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#s({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...pt(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Ze(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),V.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function pt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ft(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ze(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function et(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var en=class extends ue{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=xe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#u;#o;#s;#p;#f;#g;#a;#c;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),tt(this.#t,this.options)?this.#d():this.updateResult(),this.#C())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Oe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Oe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#y(),this.#R(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof j(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Ee(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&nt(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||j(this.options.enabled,this.#t)!==j(t.enabled,this.#t)||Y(this.options.staleTime,this.#t)!==Y(t.staleTime,this.#t))&&this.#m();const i=this.#v();r&&(this.#t!==n||j(this.options.enabled,this.#t)!==j(t.enabled,this.#t)||i!==this.#l)&&this.#S(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return nn(this,n)&&(this.#i=n,this.#u=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(b)),t}#m(){this.#y();const e=Y(this.options.staleTime,this.#t);if(Z||this.#i.isStale||!Fe(e))return;const n=lt(this.#i.dataUpdatedAt,e)+1;this.#a=J.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#S(e){this.#R(),this.#l=e,!(Z||j(this.options.enabled,this.#t)===!1||!Fe(this.#l)||this.#l===0)&&(this.#c=J.setInterval(()=>{(this.options.refetchIntervalInBackground||be.isFocused())&&this.#d()},this.#l))}#C(){this.#m(),this.#S(this.#v())}#y(){this.#a&&(J.clearTimeout(this.#a),this.#a=void 0)}#R(){this.#c&&(J.clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#i,s=this.#r,o=this.#u,a=e!==n?e.state:this.#n,{state:c}=e;let d={...c},v=!1,g;if(t._optimisticResults){const A=this.hasListeners(),q=!A&&tt(e,t),B=A&&nt(e,n,t,r);(q||B)&&(d={...d,...pt(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:f,errorUpdatedAt:h,status:p}=d;g=d.data;let C=!1;if(t.placeholderData!==void 0&&g===void 0&&p==="pending"){let A;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(A=i.data,C=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#g?.state.data,this.#g):t.placeholderData,A!==void 0&&(p="success",g=Ie(i?.data,A,t),v=!0)}if(t.select&&g!==void 0&&!C)if(i&&g===s?.data&&t.select===this.#p)g=this.#f;else try{this.#p=t.select,g=t.select(g),g=Ie(i?.data,g,t),this.#f=g,this.#s=null}catch(A){this.#s=A}this.#s&&(f=this.#s,g=this.#f,h=Date.now(),p="error");const S=d.fetchStatus==="fetching",F=p==="pending",M=p==="error",D=F&&S,O=g!==void 0,E={status:p,fetchStatus:d.fetchStatus,isPending:F,isSuccess:p==="success",isError:M,isInitialLoading:D,isLoading:D,data:g,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>a.dataUpdateCount||d.errorUpdateCount>a.errorUpdateCount,isFetching:S,isRefetching:S&&!F,isLoadingError:M&&!O,isPaused:d.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:M&&O,isStale:ze(e,t),refetch:this.refetch,promise:this.#o,isEnabled:j(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=E.data!==void 0,q=E.status==="error"&&!A,B=W=>{q?W.reject(E.error):A&&W.resolve(E.data)},k=()=>{const W=this.#o=E.promise=xe();B(W)},ee=this.#o;switch(ee.status){case"pending":e.queryHash===n.queryHash&&B(ee);break;case"fulfilled":(q||E.data!==ee.value)&&k();break;case"rejected":(!q||E.error!==ee.reason)&&k();break}}return E}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#u=this.options,this.#r.data!==void 0&&(this.#g=this.#t),Ee(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const s=new Set(i??this.#h);return this.options.throwOnError&&s.add("error"),Object.keys(this.#i).some(o=>{const u=o;return this.#i[u]!==e[u]&&s.has(u)})};this.#_({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#C()}#_(e){V.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function tn(e,t){return j(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function tt(e,t){return tn(e,t)||e.state.data!==void 0&&Oe(e,t,t.refetchOnMount)}function Oe(e,t,n){if(j(t.enabled,e)!==!1&&Y(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ze(e,t)}return!1}function nt(e,t,n,r){return(e!==t||j(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ze(e,n)}function ze(e,t){return j(t.enabled,e)!==!1&&e.isStaleByTime(Y(t.staleTime,e))}function nn(e,t){return!Ee(e.getCurrentResult(),t)}function rt(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},a=0;const c=async()=>{let d=!1;const v=h=>{Bt(h,()=>t.signal,()=>d=!0)},g=ct(t.options,t.fetchOptions),f=async(h,p,C)=>{if(d)return Promise.reject();if(p==null&&h.pages.length)return Promise.resolve(h);const F=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:p,direction:C?"backward":"forward",meta:t.options.meta};return v(L),L})(),M=await g(F),{maxPages:D}=t.options,O=C?Nt:kt;return{pages:O(h.pages,M,D),pageParams:O(h.pageParams,p,D)}};if(i&&s.length){const h=i==="backward",p=h?rn:it,C={pages:s,pageParams:o},S=p(r,C);u=await f(C,S,h)}else{const h=e??s.length;do{const p=a===0?o[0]??r.initialPageParam:it(r,u);if(a>0&&p==null)break;u=await f(u,p),a++}while(a<h)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function it(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function rn(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var sn=class extends ht{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||on(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=gt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,o)=>{this.#r({type:"failed",failureCount:s,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const s=await this.#i.start();return await this.#n.config.onSuccess?.(s,e,this.state.context,this,n),await this.options.onSuccess?.(s,e,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,e,this.state.context,n),this.#r({type:"success",data:s}),s}catch(s){try{await this.#n.config.onError?.(s,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(s,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,s,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:s}),s}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),V.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function on(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var un=class extends ue{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new sn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=ae(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ae(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ae(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=ae(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){V.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Xe(t,n))}findAll(e={}){return this.getAll().filter(t=>Xe(e,t))}notify(e){V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return V.batch(()=>Promise.all(e.map(t=>t.continue().catch(b))))}};function ae(e){return e.options.scope?.id}var ln=class extends ue{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Le(r,t);let s=this.get(i);return s||(s=new Zt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ye(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ye(e,n)):t}notify(e){V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){V.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){V.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fr=class{#e;#t;#n;#i;#r;#u;#o;#s;constructor(e={}){this.#e=e.queryCache||new ln,this.#t=e.mutationCache||new un,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#u=0}mount(){this.#u++,this.#u===1&&(this.#o=be.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ge.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#u--,this.#u===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Y(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,o=qt(t,s);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return V.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;V.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return V.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=V.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(b).catch(b)}invalidateQueries(e,t={}){return V.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=V.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(b)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(b)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Y(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(b).catch(b)}fetchInfiniteQuery(e){return e.behavior=rt(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(b).catch(b)}ensureInfiniteQueryData(e){return e.behavior=rt(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ge.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(se(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{oe(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(se(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{oe(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Le(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ge&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},mt=T.createContext(void 0),an=e=>{const t=T.useContext(mt);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gr=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Tt.jsx(mt.Provider,{value:e,children:t})),vt=T.createContext(!1),cn=()=>T.useContext(vt);vt.Provider;function dn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var fn=T.createContext(dn()),gn=()=>T.useContext(fn),hn=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?dt(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},pn=e=>{T.useEffect(()=>{e.clearReset()},[e])},mn=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||dt(n,[e.error,r])),vn=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Sn=(e,t)=>e.isLoading&&e.isFetching&&!t,Cn=(e,t)=>e?.suspense&&t.isPending,st=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yn(e,t,n){const r=cn(),i=gn(),s=an(),o=s.defaultQueryOptions(e);s.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=s.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",vn(o),hn(o,i,u),pn(i);const a=!s.getQueryCache().get(o.queryHash),[c]=T.useState(()=>new t(s,o)),d=c.getOptimisticResult(o),v=!r&&e.subscribed!==!1;if(T.useSyncExternalStore(T.useCallback(g=>{const f=v?c.subscribe(V.batchCalls(g)):b;return c.updateResult(),f},[c,v]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),T.useEffect(()=>{c.setOptions(o)},[o,c]),Cn(o,d))throw st(o,c,i);if(mn({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw d.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!Z&&Sn(d,r)&&(a?st(o,c,i):u?.promise)?.catch(b).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?d:c.trackResult(d)}function hr(e,t){return yn(e,en)}function K(e,t){return typeof e=="function"?e(t):e}function z(e,t){return n=>{t.setState(r=>({...r,[e]:K(n,r[e])}))}}function he(e){return e instanceof Function}function Rn(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function wn(e,t){const n=[],r=i=>{i.forEach(s=>{n.push(s);const o=t(s);o!=null&&o.length&&r(o)})};return r(e),n}function y(e,t,n){let r=[],i;return s=>{let o;n.key&&n.debug&&(o=Date.now());const u=e(s);if(!(u.length!==r.length||u.some((d,v)=>r[v]!==d)))return i;r=u;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...u),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-o)*100)/100,v=Math.round((Date.now()-c)*100)/100,g=v/16,f=(h,p)=>{for(h=String(h);h.length<p;)h=" "+h;return h};console.info(`%c⏱ ${f(v,5)} /${f(d,5)} ms`,`
2
+ font-size: .6rem;
3
+ font-weight: bold;
4
+ color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return i}}function R(e,t,n,r){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function _n(e,t,n,r){const i=()=>{var o;return(o=s.getValue())!=null?o:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:y(()=>[e,n,t,s],(o,u,a,c)=>({table:o,column:u,row:a,cell:c,getValue:c.getValue,renderValue:c.renderValue}),R(e.options,"debugCells"))};return e._features.forEach(o=>{o.createCell==null||o.createCell(s,n,t,e)},{}),s}function Pn(e,t,n,r){var i,s;const u={...e._getDefaultColumnDef(),...t},a=u.accessorKey;let c=(i=(s=u.id)!=null?s:a?typeof String.prototype.replaceAll=="function"?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)!=null?i:typeof u.header=="string"?u.header:void 0,d;if(u.accessorFn?d=u.accessorFn:a&&(a.includes(".")?d=g=>{let f=g;for(const p of a.split(".")){var h;f=(h=f)==null?void 0:h[p]}return f}:d=g=>g[u.accessorKey]),!c)throw new Error;let v={id:`${String(c)}`,accessorFn:d,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:y(()=>[!0],()=>{var g;return[v,...(g=v.columns)==null?void 0:g.flatMap(f=>f.getFlatColumns())]},R(e.options,"debugColumns")),getLeafColumns:y(()=>[e._getOrderColumnsFn()],g=>{var f;if((f=v.columns)!=null&&f.length){let h=v.columns.flatMap(p=>p.getLeafColumns());return g(h)}return[v]},R(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(v,e);return v}const H="debugHeaders";function ot(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const o=[],u=a=>{a.subHeaders&&a.subHeaders.length&&a.subHeaders.map(u),o.push(a)};return u(s),o},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(o=>{o.createHeader==null||o.createHeader(s,e)}),s}const Fn={createTable:e=>{e.getHeaderGroups=y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var s,o;const u=(s=r?.map(v=>n.find(g=>g.id===v)).filter(Boolean))!=null?s:[],a=(o=i?.map(v=>n.find(g=>g.id===v)).filter(Boolean))!=null?o:[],c=n.filter(v=>!(r!=null&&r.includes(v.id))&&!(i!=null&&i.includes(v.id)));return ce(t,[...u,...c,...a],e)},R(e.options,H)),e.getCenterHeaderGroups=y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(i!=null&&i.includes(s.id))),ce(t,n,e,"center")),R(e.options,H)),e.getLeftHeaderGroups=y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const s=(i=r?.map(o=>n.find(u=>u.id===o)).filter(Boolean))!=null?i:[];return ce(t,s,e,"left")},R(e.options,H)),e.getRightHeaderGroups=y(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const s=(i=r?.map(o=>n.find(u=>u.id===o)).filter(Boolean))!=null?i:[];return ce(t,s,e,"right")},R(e.options,H)),e.getFooterGroups=y(()=>[e.getHeaderGroups()],t=>[...t].reverse(),R(e.options,H)),e.getLeftFooterGroups=y(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),R(e.options,H)),e.getCenterFooterGroups=y(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),R(e.options,H)),e.getRightFooterGroups=y(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),R(e.options,H)),e.getFlatHeaders=y(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),R(e.options,H)),e.getLeftFlatHeaders=y(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),R(e.options,H)),e.getCenterFlatHeaders=y(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),R(e.options,H)),e.getRightFlatHeaders=y(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),R(e.options,H)),e.getCenterLeafHeaders=y(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),R(e.options,H)),e.getLeftLeafHeaders=y(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),R(e.options,H)),e.getRightLeafHeaders=y(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),R(e.options,H)),e.getLeafHeaders=y(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,s,o,u,a,c;return[...(i=(s=t[0])==null?void 0:s.headers)!=null?i:[],...(o=(u=n[0])==null?void 0:u.headers)!=null?o:[],...(a=(c=r[0])==null?void 0:c.headers)!=null?a:[]].map(d=>d.getLeafHeaders()).flat()},R(e.options,H))}};function ce(e,t,n,r){var i,s;let o=0;const u=function(g,f){f===void 0&&(f=1),o=Math.max(o,f),g.filter(h=>h.getIsVisible()).forEach(h=>{var p;(p=h.columns)!=null&&p.length&&u(h.columns,f+1)},0)};u(e);let a=[];const c=(g,f)=>{const h={depth:f,id:[r,`${f}`].filter(Boolean).join("_"),headers:[]},p=[];g.forEach(C=>{const S=[...p].reverse()[0],F=C.column.depth===h.depth;let M,D=!1;if(F&&C.column.parent?M=C.column.parent:(M=C.column,D=!0),S&&S?.column===M)S.subHeaders.push(C);else{const O=ot(n,M,{id:[r,f,M.id,C?.id].filter(Boolean).join("_"),isPlaceholder:D,placeholderId:D?`${p.filter(L=>L.column===M).length}`:void 0,depth:f,index:p.length});O.subHeaders.push(C),p.push(O)}h.headers.push(C),C.headerGroup=h}),a.push(h),f>0&&c(p,f-1)},d=t.map((g,f)=>ot(n,g,{depth:o,index:f}));c(d,o-1),a.reverse();const v=g=>g.filter(h=>h.column.getIsVisible()).map(h=>{let p=0,C=0,S=[0];h.subHeaders&&h.subHeaders.length?(S=[],v(h.subHeaders).forEach(M=>{let{colSpan:D,rowSpan:O}=M;p+=D,S.push(O)})):p=1;const F=Math.min(...S);return C=C+F,h.colSpan=p,h.rowSpan=C,{colSpan:p,rowSpan:C}});return v((i=(s=a[0])==null?void 0:s.headers)!=null?i:[]),a}const En=(e,t,n,r,i,s,o)=>{let u={id:t,index:r,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:a=>{if(u._valuesCache.hasOwnProperty(a))return u._valuesCache[a];const c=e.getColumn(a);if(c!=null&&c.accessorFn)return u._valuesCache[a]=c.accessorFn(u.original,r),u._valuesCache[a]},getUniqueValues:a=>{if(u._uniqueValuesCache.hasOwnProperty(a))return u._uniqueValuesCache[a];const c=e.getColumn(a);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(u._uniqueValuesCache[a]=c.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[a]):(u._uniqueValuesCache[a]=[u.getValue(a)],u._uniqueValuesCache[a])},renderValue:a=>{var c;return(c=u.getValue(a))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>wn(u.subRows,a=>a.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let a=[],c=u;for(;;){const d=c.getParentRow();if(!d)break;a.push(d),c=d}return a.reverse()},getAllCells:y(()=>[e.getAllLeafColumns()],a=>a.map(c=>_n(e,u,c,c.id)),R(e.options,"debugRows")),_getAllCellsByColumnId:y(()=>[u.getAllCells()],a=>a.reduce((c,d)=>(c[d.column.id]=d,c),{}),R(e.options,"debugRows"))};for(let a=0;a<e._features.length;a++){const c=e._features[a];c==null||c.createRow==null||c.createRow(u,e)}return u},Mn={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},St=(e,t,n)=>{var r,i;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(s))};St.autoRemove=e=>U(e);const Ct=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Ct.autoRemove=e=>U(e);const yt=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};yt.autoRemove=e=>U(e);const Rt=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Rt.autoRemove=e=>U(e);const wt=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});wt.autoRemove=e=>U(e)||!(e!=null&&e.length);const _t=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});_t.autoRemove=e=>U(e)||!(e!=null&&e.length);const Pt=(e,t,n)=>e.getValue(t)===n;Pt.autoRemove=e=>U(e);const Ft=(e,t,n)=>e.getValue(t)==n;Ft.autoRemove=e=>U(e);const je=(e,t,n)=>{let[r,i]=n;const s=e.getValue(t);return s>=r&&s<=i};je.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(i)?1/0:i;if(s>o){const u=s;s=o,o=u}return[s,o]};je.autoRemove=e=>U(e)||U(e[0])&&U(e[1]);const N={includesString:St,includesStringSensitive:Ct,equalsString:yt,arrIncludes:Rt,arrIncludesAll:wt,arrIncludesSome:_t,equals:Pt,weakEquals:Ft,inNumberRange:je};function U(e){return e==null||e===""}const In={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:z("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?N.includesString:typeof r=="number"?N.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?N.equals:Array.isArray(r)?N.arrIncludes:N.weakEquals},e.getFilterFn=()=>{var n,r;return he(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:N[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),s=r?.find(d=>d.id===e.id),o=K(n,s?s.value:void 0);if(ut(i,o,e)){var u;return(u=r?.filter(d=>d.id!==e.id))!=null?u:[]}const a={id:e.id,value:o};if(s){var c;return(c=r?.map(d=>d.id===e.id?a:d))!=null?c:[]}return r!=null&&r.length?[...r,a]:[a]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var s;return(s=K(t,i))==null?void 0:s.filter(o=>{const u=n.find(a=>a.id===o.id);if(u){const a=u.getFilterFn();if(ut(a,o.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function ut(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const xn=(e,t,n)=>n.reduce((r,i)=>{const s=i.getValue(e);return r+(typeof s=="number"?s:0)},0),$n=(e,t,n)=>{let r;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},On=(e,t,n)=>{let r;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},Dn=(e,t,n)=>{let r,i;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r===void 0?o>=o&&(r=i=o):(r>o&&(r=o),i<o&&(i=o)))}),[r,i]},An=(e,t)=>{let n=0,r=0;if(t.forEach(i=>{let s=i.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},Vn=(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!Rn(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((s,o)=>s-o);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},Tn=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Hn=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Ln=(e,t)=>t.length,Se={sum:xn,min:$n,max:On,extent:Dn,mean:An,median:Vn,unique:Tn,uniqueCount:Hn,count:Ln},Gn={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:z("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return Se.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Se.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return he(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Se[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function bn(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(o=>o.id===s)).filter(Boolean),...r]}const zn={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:z("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=y(n=>[ie(t,n)],n=>n.findIndex(r=>r.id===e.id),R(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=ie(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=ie(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=y(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let s=[];if(!(t!=null&&t.length))s=i;else{const o=[...t],u=[...i];for(;u.length&&o.length;){const a=o.shift(),c=u.findIndex(d=>d.id===a);c>-1&&s.push(u.splice(c,1)[0])}s=[...s,...u]}return bn(s,n,r)},R(e.options,"debugTable"))}},Ce=()=>({left:[],right:[]}),jn={getInitialState:e=>({columnPinning:Ce(),...e}),getDefaultOptions:e=>({onColumnPinningChange:z("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var s,o;if(n==="right"){var u,a;return{left:((u=i?.left)!=null?u:[]).filter(v=>!(r!=null&&r.includes(v))),right:[...((a=i?.right)!=null?a:[]).filter(v=>!(r!=null&&r.includes(v))),...r]}}if(n==="left"){var c,d;return{left:[...((c=i?.left)!=null?c:[]).filter(v=>!(r!=null&&r.includes(v))),...r],right:((d=i?.right)!=null?d:[]).filter(v=>!(r!=null&&r.includes(v)))}}return{left:((s=i?.left)!=null?s:[]).filter(v=>!(r!=null&&r.includes(v))),right:((o=i?.right)!=null?o:[]).filter(v=>!(r!=null&&r.includes(v)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,s,o;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((s=(o=t.options.enableColumnPinning)!=null?o:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:r,right:i}=t.getState().columnPinning,s=n.some(u=>r?.includes(u)),o=n.some(u=>i?.includes(u));return s?"left":o?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const s=[...r??[],...i??[]];return n.filter(o=>!s.includes(o.column.id))},R(t.options,"debugRows")),e.getLeftVisibleCells=y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(o=>o.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),R(t.options,"debugRows")),e.getRightVisibleCells=y(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(o=>o.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),R(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Ce():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Ce())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,s;return!!((i=r.left)!=null&&i.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),R(e.options,"debugColumns")),e.getRightLeafColumns=y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),R(e.options,"debugColumns")),e.getCenterLeafColumns=y(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(s=>!i.includes(s.id))},R(e.options,"debugColumns"))}};function qn(e){return e||(typeof document<"u"?document:null)}const de={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ye=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Un={getDefaultColumnDef:()=>de,getInitialState:e=>({columnSizing:{},columnSizingInfo:ye(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:z("columnSizing",e),onColumnSizingInfoChange:z("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:de.minSize,(r=s??e.columnDef.size)!=null?r:de.size),(i=e.columnDef.maxSize)!=null?i:de.maxSize)},e.getStart=y(n=>[n,ie(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,s)=>i+s.getSize(),0),R(t.options,"debugColumns")),e.getAfter=y(n=>[n,ie(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,s)=>i+s.getSize(),0),R(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var s;n+=(s=i.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r?.getCanResize();return s=>{if(!r||!i||(s.persist==null||s.persist(),Re(s)&&s.touches&&s.touches.length>1))return;const o=e.getSize(),u=e?e.getLeafHeaders().map(S=>[S.column.id,S.column.getSize()]):[[r.id,r.getSize()]],a=Re(s)?Math.round(s.touches[0].clientX):s.clientX,c={},d=(S,F)=>{typeof F=="number"&&(t.setColumnSizingInfo(M=>{var D,O;const L=t.options.columnResizeDirection==="rtl"?-1:1,E=(F-((D=M?.startOffset)!=null?D:0))*L,A=Math.max(E/((O=M?.startSize)!=null?O:0),-.999999);return M.columnSizingStart.forEach(q=>{let[B,k]=q;c[B]=Math.round(Math.max(k+k*A,0)*100)/100}),{...M,deltaOffset:E,deltaPercentage:A}}),(t.options.columnResizeMode==="onChange"||S==="end")&&t.setColumnSizing(M=>({...M,...c})))},v=S=>d("move",S),g=S=>{d("end",S),t.setColumnSizingInfo(F=>({...F,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=qn(n),h={moveHandler:S=>v(S.clientX),upHandler:S=>{f?.removeEventListener("mousemove",h.moveHandler),f?.removeEventListener("mouseup",h.upHandler),g(S.clientX)}},p={moveHandler:S=>(S.cancelable&&(S.preventDefault(),S.stopPropagation()),v(S.touches[0].clientX),!1),upHandler:S=>{var F;f?.removeEventListener("touchmove",p.moveHandler),f?.removeEventListener("touchend",p.upHandler),S.cancelable&&(S.preventDefault(),S.stopPropagation()),g((F=S.touches[0])==null?void 0:F.clientX)}},C=Qn()?{passive:!1}:!1;Re(s)?(f?.addEventListener("touchmove",p.moveHandler,C),f?.addEventListener("touchend",p.upHandler,C)):(f?.addEventListener("mousemove",h.moveHandler,C),f?.addEventListener("mouseup",h.upHandler,C)),t.setColumnSizingInfo(S=>({...S,startOffset:a,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?ye():(n=e.initialState.columnSizingInfo)!=null?n:ye())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let fe=null;function Qn(){if(typeof fe=="boolean")return fe;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return fe=e,fe}function Re(e){return e.type==="touchstart"}const kn={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:z("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const i=e.columns;return(n=i.length?i.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=y(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),R(t.options,"debugRows")),e.getVisibleCells=y(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],R(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>y(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),R(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function ie(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Nn={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Bn={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:z("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,i,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>N.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return he(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:N[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Kn={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:z("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,s;e.setExpanded(r?{}:(i=(s=e.initialState)==null?void 0:s.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const o=s.split(".");r=Math.max(r,o.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const s=r===!0?!0:!!(r!=null&&r[e.id]);let o={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{o[u]=!0}):o=r,n=(i=n)!=null?i:!s,!s&&n)return{...o,[e.id]:!0};if(s&&!n){const{[e.id]:u,...a}=o;return a}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},De=0,Ae=10,we=()=>({pageIndex:De,pageSize:Ae}),Yn={getInitialState:e=>({...e,pagination:{...we(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:z("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=s=>K(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?we():(i=e.initialState.pagination)!=null?i:we())},e.setPageIndex=r=>{e.setPagination(i=>{let s=K(r,i.pageIndex);const o=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,o)),{...i,pageIndex:s}})},e.resetPageIndex=r=>{var i,s;e.setPageIndex(r?De:(i=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:De)},e.resetPageSize=r=>{var i,s;e.setPageSize(r?Ae:(i=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:Ae)},e.setPageSize=r=>{e.setPagination(i=>{const s=Math.max(1,K(r,i.pageSize)),o=i.pageSize*i.pageIndex,u=Math.floor(o/s);return{...i,pageIndex:u,pageSize:s}})},e.setPageCount=r=>e.setPagination(i=>{var s;let o=K(r,(s=e.options.pageCount)!=null?s:-1);return typeof o=="number"&&(o=Math.max(-1,o)),{...i,pageCount:o}}),e.getPageOptions=y(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((s,o)=>o)),i},R(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:r<i-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},_e=()=>({top:[],bottom:[]}),Xn={getInitialState:e=>({rowPinning:_e(),...e}),getDefaultOptions:e=>({onRowPinningChange:z("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{const s=r?e.getLeafRows().map(a=>{let{id:c}=a;return c}):[],o=i?e.getParentRows().map(a=>{let{id:c}=a;return c}):[],u=new Set([...o,e.id,...s]);t.setRowPinning(a=>{var c,d;if(n==="bottom"){var v,g;return{top:((v=a?.top)!=null?v:[]).filter(p=>!(u!=null&&u.has(p))),bottom:[...((g=a?.bottom)!=null?g:[]).filter(p=>!(u!=null&&u.has(p))),...Array.from(u)]}}if(n==="top"){var f,h;return{top:[...((f=a?.top)!=null?f:[]).filter(p=>!(u!=null&&u.has(p))),...Array.from(u)],bottom:((h=a?.bottom)!=null?h:[]).filter(p=>!(u!=null&&u.has(p)))}}return{top:((c=a?.top)!=null?c:[]).filter(p=>!(u!=null&&u.has(p))),bottom:((d=a?.bottom)!=null?d:[]).filter(p=>!(u!=null&&u.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,s=n.some(u=>r?.includes(u)),o=n.some(u=>i?.includes(u));return s?"top":o?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const s=(n=i==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(o=>{let{id:u}=o;return u});return(r=s?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?_e():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:_e())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,s;return!!((i=r.top)!=null&&i.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(o=>{const u=e.getRow(o,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(o=>t.find(u=>u.id===o))).filter(Boolean).map(o=>({...o,position:r}))},e.getTopRows=y(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),R(e.options,"debugRows")),e.getBottomRows=y(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),R(e.options,"debugRows")),e.getCenterRows=y(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(s=>!i.has(s.id))},R(e.options,"debugRows"))}},Wn={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:z("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):i.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(s=>{Ve(i,s.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=y(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Pe(e,n):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getFilteredSelectedRowModel=y(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Pe(e,n):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getGroupedSelectedRowModel=y(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Pe(e,n):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(s=>{var o;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return s;const u={...s};return Ve(u,e.id,n,(o=r?.selectChildren)!=null?o:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return qe(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Te(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Te(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},Ve=(e,t,n,r,i)=>{var s;const o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=o.subRows)!=null&&s.length&&o.getCanSelectSubRows()&&o.subRows.forEach(u=>Ve(e,u.id,n,r,i))};function Pe(e,t){const n=e.getState().rowSelection,r=[],i={},s=function(o,u){return o.map(a=>{var c;const d=qe(a,n);if(d&&(r.push(a),i[a.id]=a),(c=a.subRows)!=null&&c.length&&(a={...a,subRows:s(a.subRows)}),d)return a}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:i}}function qe(e,t){var n;return(n=t[e.id])!=null?n:!1}function Te(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,s=!1;return e.subRows.forEach(o=>{if(!(s&&!i)&&(o.getCanSelect()&&(qe(o,t)?s=!0:i=!1),o.subRows&&o.subRows.length)){const u=Te(o,t);u==="all"?s=!0:(u==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const He=/([0-9]+)/gm,Jn=(e,t,n)=>Et(X(e.getValue(n)).toLowerCase(),X(t.getValue(n)).toLowerCase()),Zn=(e,t,n)=>Et(X(e.getValue(n)),X(t.getValue(n))),er=(e,t,n)=>Ue(X(e.getValue(n)).toLowerCase(),X(t.getValue(n)).toLowerCase()),tr=(e,t,n)=>Ue(X(e.getValue(n)),X(t.getValue(n))),nr=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},rr=(e,t,n)=>Ue(e.getValue(n),t.getValue(n));function Ue(e,t){return e===t?0:e>t?1:-1}function X(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Et(e,t){const n=e.split(He).filter(Boolean),r=t.split(He).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),s=r.shift(),o=parseInt(i,10),u=parseInt(s,10),a=[o,u].sort();if(isNaN(a[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(a[1]))return isNaN(o)?-1:1;if(o>u)return 1;if(u>o)return-1}return n.length-r.length}const re={alphanumeric:Jn,alphanumericCaseSensitive:Zn,text:er,textCaseSensitive:tr,datetime:nr,basic:rr},ir={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:z("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const s=i?.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return re.datetime;if(typeof s=="string"&&(r=!0,s.split(He).length>1))return re.alphanumeric}return r?re.text:re.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return he(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:re[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(o=>{const u=o?.find(f=>f.id===e.id),a=o?.findIndex(f=>f.id===e.id);let c=[],d,v=s?n:i==="desc";if(o!=null&&o.length&&e.getCanMultiSort()&&r?u?d="toggle":d="add":o!=null&&o.length&&a!==o.length-1?d="replace":u?d="toggle":d="replace",d==="toggle"&&(s||i||(d="remove")),d==="add"){var g;c=[...o,{id:e.id,desc:v}],c.splice(0,c.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else d==="toggle"?c=o.map(f=>f.id===e.id?{...f,desc:v}:f):d==="remove"?c=o.filter(f=>f.id!==e.id):c=[{id:e.id,desc:v}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const s=e.getFirstSortDir(),o=e.getIsSorted();return o?o!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:o==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},sr=[Fn,kn,zn,jn,Mn,In,Nn,Bn,ir,Gn,Kn,Yn,Xn,Wn,Un];function or(e){var t,n;const r=[...sr,...(t=e._features)!=null?t:[]];let i={_features:r};const s=i._features.reduce((g,f)=>Object.assign(g,f.getDefaultOptions==null?void 0:f.getDefaultOptions(i)),{}),o=g=>i.options.mergeOptions?i.options.mergeOptions(s,g):{...s,...g};let a={...{},...(n=e.initialState)!=null?n:{}};i._features.forEach(g=>{var f;a=(f=g.getInitialState==null?void 0:g.getInitialState(a))!=null?f:a});const c=[];let d=!1;const v={_features:r,options:{...s,...e},initialState:a,_queue:g=>{c.push(g),d||(d=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();d=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{i.setState(i.initialState)},setOptions:g=>{const f=K(g,i.options);i.options=o(f)},getState:()=>i.options.state,setState:g=>{i.options.onStateChange==null||i.options.onStateChange(g)},_getRowId:(g,f,h)=>{var p;return(p=i.options.getRowId==null?void 0:i.options.getRowId(g,f,h))!=null?p:`${h?[h.id,f].join("."):f}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(g,f)=>{let h=(f?i.getPrePaginationRowModel():i.getRowModel()).rowsById[g];if(!h&&(h=i.getCoreRowModel().rowsById[g],!h))throw new Error;return h},_getDefaultColumnDef:y(()=>[i.options.defaultColumn],g=>{var f;return g=(f=g)!=null?f:{},{header:h=>{const p=h.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:h=>{var p,C;return(p=(C=h.renderValue())==null||C.toString==null?void 0:C.toString())!=null?p:null},...i._features.reduce((h,p)=>Object.assign(h,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...g}},R(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:y(()=>[i._getColumnDefs()],g=>{const f=function(h,p,C){return C===void 0&&(C=0),h.map(S=>{const F=Pn(i,S,C,p),M=S;return F.columns=M.columns?f(M.columns,F,C+1):[],F})};return f(g)},R(e,"debugColumns")),getAllFlatColumns:y(()=>[i.getAllColumns()],g=>g.flatMap(f=>f.getFlatColumns()),R(e,"debugColumns")),_getAllFlatColumnsById:y(()=>[i.getAllFlatColumns()],g=>g.reduce((f,h)=>(f[h.id]=h,f),{}),R(e,"debugColumns")),getAllLeafColumns:y(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(g,f)=>{let h=g.flatMap(p=>p.getLeafColumns());return f(h)},R(e,"debugColumns")),getColumn:g=>i._getAllFlatColumnsById()[g]};Object.assign(i,v);for(let g=0;g<i._features.length;g++){const f=i._features[g];f==null||f.createTable==null||f.createTable(i)}return i}function pr(){return e=>y(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,s,o){s===void 0&&(s=0);const u=[];for(let c=0;c<i.length;c++){const d=En(e,e._getRowId(i[c],c,o),i[c],c,s,void 0,o?.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,u.push(d),e.options.getSubRows){var a;d.originalSubRows=e.options.getSubRows(i[c],c),(a=d.originalSubRows)!=null&&a.length&&(d.subRows=r(d.originalSubRows,s+1,d))}}return u};return n.rows=r(t),n},R(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function mr(){return e=>y(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],s=r.filter(a=>{var c;return(c=e.getColumn(a.id))==null?void 0:c.getCanSort()}),o={};s.forEach(a=>{const c=e.getColumn(a.id);c&&(o[a.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const u=a=>{const c=a.map(d=>({...d}));return c.sort((d,v)=>{for(let f=0;f<s.length;f+=1){var g;const h=s[f],p=o[h.id],C=p.sortUndefined,S=(g=h?.desc)!=null?g:!1;let F=0;if(C){const M=d.getValue(h.id),D=v.getValue(h.id),O=M===void 0,L=D===void 0;if(O||L){if(C==="first")return O?-1:1;if(C==="last")return O?1:-1;F=O&&L?0:O?C:-C}}if(F===0&&(F=p.sortingFn(d,v,h.id)),F!==0)return S&&(F*=-1),p.invertSorting&&(F*=-1),F}return d.index-v.index}),c.forEach(d=>{var v;i.push(d),(v=d.subRows)!=null&&v.length&&(d.subRows=u(d.subRows))}),c};return{rows:u(n.rows),flatRows:i,rowsById:n.rowsById}},R(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function vr(e,t){return e?ur(e)?T.createElement(e,t):e:null}function ur(e){return lr(e)||typeof e=="function"||ar(e)}function lr(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function ar(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Sr(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=T.useState(()=>({current:or(t)})),[r,i]=T.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:o=>{i(o),e.onStateChange==null||e.onStateChange(o)}})),n.current}export{fr as Q,Gt as R,Lt as a,gr as b,cr as c,hr as d,Sr as e,vr as f,Dt as g,mr as h,pr as i,Tt as j,T as r,dr as t,an as u};