UNPKG

simple-beautiful-bracket

Version:

A simple and beautiful React component for visualizing tournament brackets.

30 lines 666 kB
(function(Gu,ht){typeof exports=="object"&&typeof module<"u"?ht(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ht):(Gu=typeof globalThis<"u"?globalThis:Gu||self,ht(Gu.SimpleBeautifulBracket={},Gu.React,Gu.ReactDOM))})(this,function(Gu,ht,OS){"use strict";function PE(o){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const d in o)if(d!=="default"){const m=Object.getOwnPropertyDescriptor(o,d);Object.defineProperty(s,d,m.get?m:{enumerable:!0,get:()=>o[d]})}}return s.default=o,Object.freeze(s)}const Bv=PE(ht);var gg={exports:{}},lm={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var CS;function IE(){if(CS)return lm;CS=1;var o=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function d(m,y,b){var v=null;if(b!==void 0&&(v=""+b),y.key!==void 0&&(v=""+y.key),"key"in y){b={};for(var x in y)x!=="key"&&(b[x]=y[x])}else b=y;return y=b.ref,{$$typeof:o,type:m,key:v,ref:y!==void 0?y:null,props:b}}return lm.Fragment=s,lm.jsx=d,lm.jsxs=d,lm}var im={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var zS;function tD(){return zS||(zS=1,process.env.NODE_ENV!=="production"&&function(){function o(Z){if(Z==null)return null;if(typeof Z=="function")return Z.$$typeof===xt?null:Z.displayName||Z.name||null;if(typeof Z=="string")return Z;switch(Z){case mt:return"Fragment";case st:return"Profiler";case rt:return"StrictMode";case vt:return"Suspense";case ot:return"SuspenseList";case ft:return"Activity"}if(typeof Z=="object")switch(typeof Z.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),Z.$$typeof){case et:return"Portal";case it:return(Z.displayName||"Context")+".Provider";case ut:return(Z._context.displayName||"Context")+".Consumer";case St:var Mt=Z.render;return Z=Z.displayName,Z||(Z=Mt.displayName||Mt.name||"",Z=Z!==""?"ForwardRef("+Z+")":"ForwardRef"),Z;case lt:return Mt=Z.displayName||null,Mt!==null?Mt:o(Z.type)||"Memo";case tt:Mt=Z._payload,Z=Z._init;try{return o(Z(Mt))}catch{}}return null}function s(Z){return""+Z}function d(Z){try{s(Z);var Mt=!1}catch{Mt=!0}if(Mt){Mt=console;var yt=Mt.error,Ut=typeof Symbol=="function"&&Symbol.toStringTag&&Z[Symbol.toStringTag]||Z.constructor.name||"Object";return yt.call(Mt,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Ut),s(Z)}}function m(Z){if(Z===mt)return"<>";if(typeof Z=="object"&&Z!==null&&Z.$$typeof===tt)return"<...>";try{var Mt=o(Z);return Mt?"<"+Mt+">":"<...>"}catch{return"<...>"}}function y(){var Z=bt.A;return Z===null?null:Z.getOwner()}function b(){return Error("react-stack-top-frame")}function v(Z){if(Rt.call(Z,"key")){var Mt=Object.getOwnPropertyDescriptor(Z,"key").get;if(Mt&&Mt.isReactWarning)return!1}return Z.key!==void 0}function x(Z,Mt){function yt(){ge||(ge=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Mt))}yt.isReactWarning=!0,Object.defineProperty(Z,"key",{get:yt,configurable:!0})}function A(){var Z=o(this.type);return N[Z]||(N[Z]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),Z=this.props.ref,Z!==void 0?Z:null}function R(Z,Mt,yt,Ut,Wt,xe,ne,Ji){return yt=xe.ref,Z={$$typeof:L,type:Z,key:Mt,props:xe,_owner:Wt},(yt!==void 0?yt:null)!==null?Object.defineProperty(Z,"ref",{enumerable:!1,get:A}):Object.defineProperty(Z,"ref",{enumerable:!1,value:null}),Z._store={},Object.defineProperty(Z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(Z,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(Z,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ne}),Object.defineProperty(Z,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ji}),Object.freeze&&(Object.freeze(Z.props),Object.freeze(Z)),Z}function M(Z,Mt,yt,Ut,Wt,xe,ne,Ji){var Be=Mt.children;if(Be!==void 0)if(Ut)if(ie(Be)){for(Ut=0;Ut<Be.length;Ut++)C(Be[Ut]);Object.freeze&&Object.freeze(Be)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else C(Be);if(Rt.call(Mt,"key")){Be=o(Z);var yn=Object.keys(Mt).filter(function(Ku){return Ku!=="key"});Ut=0<yn.length?"{key: someKey, "+yn.join(": ..., ")+": ...}":"{key: someKey}",Ot[Be+Ut]||(yn=0<yn.length?"{"+yn.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,Ut,Be,yn,Be),Ot[Be+Ut]=!0)}if(Be=null,yt!==void 0&&(d(yt),Be=""+yt),v(Mt)&&(d(Mt.key),Be=""+Mt.key),"key"in Mt){yt={};for(var Ua in Mt)Ua!=="key"&&(yt[Ua]=Mt[Ua])}else yt=Mt;return Be&&x(yt,typeof Z=="function"?Z.displayName||Z.name||"Unknown":Z),R(Z,Be,xe,Wt,y(),yt,ne,Ji)}function C(Z){typeof Z=="object"&&Z!==null&&Z.$$typeof===L&&Z._store&&(Z._store.validated=1)}var z=ht,L=Symbol.for("react.transitional.element"),et=Symbol.for("react.portal"),mt=Symbol.for("react.fragment"),rt=Symbol.for("react.strict_mode"),st=Symbol.for("react.profiler"),ut=Symbol.for("react.consumer"),it=Symbol.for("react.context"),St=Symbol.for("react.forward_ref"),vt=Symbol.for("react.suspense"),ot=Symbol.for("react.suspense_list"),lt=Symbol.for("react.memo"),tt=Symbol.for("react.lazy"),ft=Symbol.for("react.activity"),xt=Symbol.for("react.client.reference"),bt=z.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Rt=Object.prototype.hasOwnProperty,ie=Array.isArray,Qt=console.createTask?console.createTask:function(){return null};z={"react-stack-bottom-frame":function(Z){return Z()}};var ge,N={},P=z["react-stack-bottom-frame"].bind(z,b)(),ct=Qt(m(b)),Ot={};im.Fragment=mt,im.jsx=function(Z,Mt,yt,Ut,Wt){var xe=1e4>bt.recentlyCreatedOwnerStacks++;return M(Z,Mt,yt,!1,Ut,Wt,xe?Error("react-stack-top-frame"):P,xe?Qt(m(Z)):ct)},im.jsxs=function(Z,Mt,yt,Ut,Wt){var xe=1e4>bt.recentlyCreatedOwnerStacks++;return M(Z,Mt,yt,!0,Ut,Wt,xe?Error("react-stack-top-frame"):P,xe?Qt(m(Z)):ct)}}()),im}var wS;function eD(){return wS||(wS=1,process.env.NODE_ENV==="production"?gg.exports=IE():gg.exports=tD()),gg.exports}var J=eD();const Nv=ht.createContext({});function jv(o){const s=ht.useRef(null);return s.current===null&&(s.current=o()),s.current}const Lv=typeof window<"u",US=Lv?ht.useLayoutEffect:ht.useEffect,vg=ht.createContext(null);function _v(o,s){o.indexOf(s)===-1&&o.push(s)}function qv(o,s){const d=o.indexOf(s);d>-1&&o.splice(d,1)}const Xu=(o,s,d)=>d>s?s:d<o?o:d;function Yv(o,s){return s?`${o}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${s}`:o}let Sf=()=>{},Qu=()=>{};process.env.NODE_ENV!=="production"&&(Sf=(o,s,d)=>{!o&&typeof console<"u"&&console.warn(Yv(s,d))},Qu=(o,s,d)=>{if(!o)throw new Error(Yv(s,d))});const Zu={},HS=o=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(o);function VS(o){return typeof o=="object"&&o!==null}const BS=o=>/^0[^.\s]+$/u.test(o);function Gv(o){let s;return()=>(s===void 0&&(s=o()),s)}const vl=o=>o,nD=(o,s)=>d=>s(o(d)),um=(...o)=>o.reduce(nD),om=(o,s,d)=>{const m=s-o;return m===0?1:(d-o)/m};class Xv{constructor(){this.subscriptions=[]}add(s){return _v(this.subscriptions,s),()=>qv(this.subscriptions,s)}notify(s,d,m){const y=this.subscriptions.length;if(y)if(y===1)this.subscriptions[0](s,d,m);else for(let b=0;b<y;b++){const v=this.subscriptions[b];v&&v(s,d,m)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const fi=o=>o*1e3,Ki=o=>o/1e3;function NS(o,s){return s?o*(1e3/s):0}const jS=new Set;function Qv(o,s,d){o||jS.has(s)||(console.warn(Yv(s,d)),jS.add(s))}const LS=(o,s,d)=>(((1-3*d+3*s)*o+(3*d-6*s))*o+3*s)*o,aD=1e-7,lD=12;function iD(o,s,d,m,y){let b,v,x=0;do v=s+(d-s)/2,b=LS(v,m,y)-o,b>0?d=v:s=v;while(Math.abs(b)>aD&&++x<lD);return v}function sm(o,s,d,m){if(o===s&&d===m)return vl;const y=b=>iD(b,0,1,o,d);return b=>b===0||b===1?b:LS(y(b),s,m)}const _S=o=>s=>s<=.5?o(2*s)/2:(2-o(2*(1-s)))/2,qS=o=>s=>1-o(1-s),YS=sm(.33,1.53,.69,.99),Zv=qS(YS),GS=_S(Zv),XS=o=>(o*=2)<1?.5*Zv(o):.5*(2-Math.pow(2,-10*(o-1))),kv=o=>1-Math.sin(Math.acos(o)),QS=qS(kv),ZS=_S(kv),uD=sm(.42,0,1,1),oD=sm(0,0,.58,1),kS=sm(.42,0,.58,1),sD=o=>Array.isArray(o)&&typeof o[0]!="number",KS=o=>Array.isArray(o)&&typeof o[0]=="number",$S={linear:vl,easeIn:uD,easeInOut:kS,easeOut:oD,circIn:kv,circInOut:ZS,circOut:QS,backIn:Zv,backInOut:GS,backOut:YS,anticipate:XS},cD=o=>typeof o=="string",JS=o=>{if(KS(o)){Qu(o.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[s,d,m,y]=o;return sm(s,d,m,y)}else if(cD(o))return Qu($S[o]!==void 0,`Invalid easing type '${o}'`,"invalid-easing-type"),$S[o];return o},bg=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rD(o,s){let d=new Set,m=new Set,y=!1,b=!1;const v=new WeakSet;let x={delta:0,timestamp:0,isProcessing:!1};function A(M){v.has(M)&&(R.schedule(M),o()),M(x)}const R={schedule:(M,C=!1,z=!1)=>{const et=z&&y?d:m;return C&&v.add(M),et.has(M)||et.add(M),M},cancel:M=>{m.delete(M),v.delete(M)},process:M=>{if(x=M,y){b=!0;return}y=!0,[d,m]=[m,d],d.forEach(A),d.clear(),y=!1,b&&(b=!1,R.process(M))}};return R}const fD=40;function WS(o,s){let d=!1,m=!0;const y={delta:0,timestamp:0,isProcessing:!1},b=()=>d=!0,v=bg.reduce((it,St)=>(it[St]=rD(b),it),{}),{setup:x,read:A,resolveKeyframes:R,preUpdate:M,update:C,preRender:z,render:L,postRender:et}=v,mt=()=>{const it=Zu.useManualTiming?y.timestamp:performance.now();d=!1,Zu.useManualTiming||(y.delta=m?1e3/60:Math.max(Math.min(it-y.timestamp,fD),1)),y.timestamp=it,y.isProcessing=!0,x.process(y),A.process(y),R.process(y),M.process(y),C.process(y),z.process(y),L.process(y),et.process(y),y.isProcessing=!1,d&&s&&(m=!1,o(mt))},rt=()=>{d=!0,m=!0,y.isProcessing||o(mt)};return{schedule:bg.reduce((it,St)=>{const vt=v[St];return it[St]=(ot,lt=!1,tt=!1)=>(d||rt(),vt.schedule(ot,lt,tt)),it},{}),cancel:it=>{for(let St=0;St<bg.length;St++)v[bg[St]].cancel(it)},state:y,steps:v}}const{schedule:Ve,cancel:ls,state:jn,steps:Kv}=WS(typeof requestAnimationFrame<"u"?requestAnimationFrame:vl,!0);let Sg;function dD(){Sg=void 0}const za={now:()=>(Sg===void 0&&za.set(jn.isProcessing||Zu.useManualTiming?jn.timestamp:performance.now()),Sg),set:o=>{Sg=o,queueMicrotask(dD)}},FS=o=>s=>typeof s=="string"&&s.startsWith(o),$v=FS("--"),hD=FS("var(--"),Jv=o=>hD(o)?mD.test(o.split("/*")[0].trim()):!1,mD=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Tf={test:o=>typeof o=="number",parse:parseFloat,transform:o=>o},cm={...Tf,transform:o=>Xu(0,1,o)},Tg={...Tf,default:1},rm=o=>Math.round(o*1e5)/1e5,Wv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function pD(o){return o==null}const yD=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fv=(o,s)=>d=>!!(typeof d=="string"&&yD.test(d)&&d.startsWith(o)||s&&!pD(d)&&Object.prototype.hasOwnProperty.call(d,s)),PS=(o,s,d)=>m=>{if(typeof m!="string")return m;const[y,b,v,x]=m.match(Wv);return{[o]:parseFloat(y),[s]:parseFloat(b),[d]:parseFloat(v),alpha:x!==void 0?parseFloat(x):1}},gD=o=>Xu(0,255,o),Pv={...Tf,transform:o=>Math.round(gD(o))},Mc={test:Fv("rgb","red"),parse:PS("red","green","blue"),transform:({red:o,green:s,blue:d,alpha:m=1})=>"rgba("+Pv.transform(o)+", "+Pv.transform(s)+", "+Pv.transform(d)+", "+rm(cm.transform(m))+")"};function vD(o){let s="",d="",m="",y="";return o.length>5?(s=o.substring(1,3),d=o.substring(3,5),m=o.substring(5,7),y=o.substring(7,9)):(s=o.substring(1,2),d=o.substring(2,3),m=o.substring(3,4),y=o.substring(4,5),s+=s,d+=d,m+=m,y+=y),{red:parseInt(s,16),green:parseInt(d,16),blue:parseInt(m,16),alpha:y?parseInt(y,16)/255:1}}const Iv={test:Fv("#"),parse:vD,transform:Mc.transform},fm=o=>({test:s=>typeof s=="string"&&s.endsWith(o)&&s.split(" ").length===1,parse:parseFloat,transform:s=>`${s}${o}`}),is=fm("deg"),$i=fm("%"),jt=fm("px"),bD=fm("vh"),SD=fm("vw"),IS={...$i,parse:o=>$i.parse(o)/100,transform:o=>$i.transform(o*100)},xf={test:Fv("hsl","hue"),parse:PS("hue","saturation","lightness"),transform:({hue:o,saturation:s,lightness:d,alpha:m=1})=>"hsla("+Math.round(o)+", "+$i.transform(rm(s))+", "+$i.transform(rm(d))+", "+rm(cm.transform(m))+")"},un={test:o=>Mc.test(o)||Iv.test(o)||xf.test(o),parse:o=>Mc.test(o)?Mc.parse(o):xf.test(o)?xf.parse(o):Iv.parse(o),transform:o=>typeof o=="string"?o:o.hasOwnProperty("red")?Mc.transform(o):xf.transform(o),getAnimatableNone:o=>{const s=un.parse(o);return s.alpha=0,un.transform(s)}},TD=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function xD(o){return isNaN(o)&&typeof o=="string"&&(o.match(Wv)?.length||0)+(o.match(TD)?.length||0)>0}const tT="number",eT="color",AD="var",ED="var(",nT="${}",DD=/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 dm(o){const s=o.toString(),d=[],m={color:[],number:[],var:[]},y=[];let b=0;const x=s.replace(DD,A=>(un.test(A)?(m.color.push(b),y.push(eT),d.push(un.parse(A))):A.startsWith(ED)?(m.var.push(b),y.push(AD),d.push(A)):(m.number.push(b),y.push(tT),d.push(parseFloat(A))),++b,nT)).split(nT);return{values:d,split:x,indexes:m,types:y}}function aT(o){return dm(o).values}function lT(o){const{split:s,types:d}=dm(o),m=s.length;return y=>{let b="";for(let v=0;v<m;v++)if(b+=s[v],y[v]!==void 0){const x=d[v];x===tT?b+=rm(y[v]):x===eT?b+=un.transform(y[v]):b+=y[v]}return b}}const MD=o=>typeof o=="number"?0:un.test(o)?un.getAnimatableNone(o):o;function RD(o){const s=aT(o);return lT(o)(s.map(MD))}const us={test:xD,parse:aT,createTransformer:lT,getAnimatableNone:RD};function tb(o,s,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?o+(s-o)*6*d:d<1/2?s:d<2/3?o+(s-o)*(2/3-d)*6:o}function OD({hue:o,saturation:s,lightness:d,alpha:m}){o/=360,s/=100,d/=100;let y=0,b=0,v=0;if(!s)y=b=v=d;else{const x=d<.5?d*(1+s):d+s-d*s,A=2*d-x;y=tb(A,x,o+1/3),b=tb(A,x,o),v=tb(A,x,o-1/3)}return{red:Math.round(y*255),green:Math.round(b*255),blue:Math.round(v*255),alpha:m}}function xg(o,s){return d=>d>0?s:o}const Qe=(o,s,d)=>o+(s-o)*d,eb=(o,s,d)=>{const m=o*o,y=d*(s*s-m)+m;return y<0?0:Math.sqrt(y)},CD=[Iv,Mc,xf],zD=o=>CD.find(s=>s.test(o));function iT(o){const s=zD(o);if(Sf(!!s,`'${o}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!s)return!1;let d=s.parse(o);return s===xf&&(d=OD(d)),d}const uT=(o,s)=>{const d=iT(o),m=iT(s);if(!d||!m)return xg(o,s);const y={...d};return b=>(y.red=eb(d.red,m.red,b),y.green=eb(d.green,m.green,b),y.blue=eb(d.blue,m.blue,b),y.alpha=Qe(d.alpha,m.alpha,b),Mc.transform(y))},nb=new Set(["none","hidden"]);function wD(o,s){return nb.has(o)?d=>d<=0?o:s:d=>d>=1?s:o}function UD(o,s){return d=>Qe(o,s,d)}function ab(o){return typeof o=="number"?UD:typeof o=="string"?Jv(o)?xg:un.test(o)?uT:BD:Array.isArray(o)?oT:typeof o=="object"?un.test(o)?uT:HD:xg}function oT(o,s){const d=[...o],m=d.length,y=o.map((b,v)=>ab(b)(b,s[v]));return b=>{for(let v=0;v<m;v++)d[v]=y[v](b);return d}}function HD(o,s){const d={...o,...s},m={};for(const y in d)o[y]!==void 0&&s[y]!==void 0&&(m[y]=ab(o[y])(o[y],s[y]));return y=>{for(const b in m)d[b]=m[b](y);return d}}function VD(o,s){const d=[],m={color:0,var:0,number:0};for(let y=0;y<s.values.length;y++){const b=s.types[y],v=o.indexes[b][m[b]],x=o.values[v]??0;d[y]=x,m[b]++}return d}const BD=(o,s)=>{const d=us.createTransformer(s),m=dm(o),y=dm(s);return m.indexes.var.length===y.indexes.var.length&&m.indexes.color.length===y.indexes.color.length&&m.indexes.number.length>=y.indexes.number.length?nb.has(o)&&!y.values.length||nb.has(s)&&!m.values.length?wD(o,s):um(oT(VD(m,y),y.values),d):(Sf(!0,`Complex values '${o}' and '${s}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),xg(o,s))};function sT(o,s,d){return typeof o=="number"&&typeof s=="number"&&typeof d=="number"?Qe(o,s,d):ab(o)(o,s)}const ND=o=>{const s=({timestamp:d})=>o(d);return{start:(d=!0)=>Ve.update(s,d),stop:()=>ls(s),now:()=>jn.isProcessing?jn.timestamp:za.now()}},cT=(o,s,d=10)=>{let m="";const y=Math.max(Math.round(s/d),2);for(let b=0;b<y;b++)m+=Math.round(o(b/(y-1))*1e4)/1e4+", ";return`linear(${m.substring(0,m.length-2)})`},Ag=2e4;function lb(o){let s=0;const d=50;let m=o.next(s);for(;!m.done&&s<Ag;)s+=d,m=o.next(s);return s>=Ag?1/0:s}function jD(o,s=100,d){const m=d({...o,keyframes:[0,s]}),y=Math.min(lb(m),Ag);return{type:"keyframes",ease:b=>m.next(y*b).value/s,duration:Ki(y)}}const LD=5;function rT(o,s,d){const m=Math.max(s-LD,0);return NS(d-o(m),s-m)}const Ze={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},ib=.001;function _D({duration:o=Ze.duration,bounce:s=Ze.bounce,velocity:d=Ze.velocity,mass:m=Ze.mass}){let y,b;Sf(o<=fi(Ze.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let v=1-s;v=Xu(Ze.minDamping,Ze.maxDamping,v),o=Xu(Ze.minDuration,Ze.maxDuration,Ki(o)),v<1?(y=R=>{const M=R*v,C=M*o,z=M-d,L=ub(R,v),et=Math.exp(-C);return ib-z/L*et},b=R=>{const C=R*v*o,z=C*d+d,L=Math.pow(v,2)*Math.pow(R,2)*o,et=Math.exp(-C),mt=ub(Math.pow(R,2),v);return(-y(R)+ib>0?-1:1)*((z-L)*et)/mt}):(y=R=>{const M=Math.exp(-R*o),C=(R-d)*o+1;return-ib+M*C},b=R=>{const M=Math.exp(-R*o),C=(d-R)*(o*o);return M*C});const x=5/o,A=YD(y,b,x);if(o=fi(o),isNaN(A))return{stiffness:Ze.stiffness,damping:Ze.damping,duration:o};{const R=Math.pow(A,2)*m;return{stiffness:R,damping:v*2*Math.sqrt(m*R),duration:o}}}const qD=12;function YD(o,s,d){let m=d;for(let y=1;y<qD;y++)m=m-o(m)/s(m);return m}function ub(o,s){return o*Math.sqrt(1-s*s)}const GD=["duration","bounce"],XD=["stiffness","damping","mass"];function fT(o,s){return s.some(d=>o[d]!==void 0)}function QD(o){let s={velocity:Ze.velocity,stiffness:Ze.stiffness,damping:Ze.damping,mass:Ze.mass,isResolvedFromDuration:!1,...o};if(!fT(o,XD)&&fT(o,GD))if(o.visualDuration){const d=o.visualDuration,m=2*Math.PI/(d*1.2),y=m*m,b=2*Xu(.05,1,1-(o.bounce||0))*Math.sqrt(y);s={...s,mass:Ze.mass,stiffness:y,damping:b}}else{const d=_D(o);s={...s,...d,mass:Ze.mass},s.isResolvedFromDuration=!0}return s}function Eg(o=Ze.visualDuration,s=Ze.bounce){const d=typeof o!="object"?{visualDuration:o,keyframes:[0,1],bounce:s}:o;let{restSpeed:m,restDelta:y}=d;const b=d.keyframes[0],v=d.keyframes[d.keyframes.length-1],x={done:!1,value:b},{stiffness:A,damping:R,mass:M,duration:C,velocity:z,isResolvedFromDuration:L}=QD({...d,velocity:-Ki(d.velocity||0)}),et=z||0,mt=R/(2*Math.sqrt(A*M)),rt=v-b,st=Ki(Math.sqrt(A/M)),ut=Math.abs(rt)<5;m||(m=ut?Ze.restSpeed.granular:Ze.restSpeed.default),y||(y=ut?Ze.restDelta.granular:Ze.restDelta.default);let it;if(mt<1){const vt=ub(st,mt);it=ot=>{const lt=Math.exp(-mt*st*ot);return v-lt*((et+mt*st*rt)/vt*Math.sin(vt*ot)+rt*Math.cos(vt*ot))}}else if(mt===1)it=vt=>v-Math.exp(-st*vt)*(rt+(et+st*rt)*vt);else{const vt=st*Math.sqrt(mt*mt-1);it=ot=>{const lt=Math.exp(-mt*st*ot),tt=Math.min(vt*ot,300);return v-lt*((et+mt*st*rt)*Math.sinh(tt)+vt*rt*Math.cosh(tt))/vt}}const St={calculatedDuration:L&&C||null,next:vt=>{const ot=it(vt);if(L)x.done=vt>=C;else{let lt=vt===0?et:0;mt<1&&(lt=vt===0?fi(et):rT(it,vt,ot));const tt=Math.abs(lt)<=m,ft=Math.abs(v-ot)<=y;x.done=tt&&ft}return x.value=x.done?v:ot,x},toString:()=>{const vt=Math.min(lb(St),Ag),ot=cT(lt=>St.next(vt*lt).value,vt,30);return vt+"ms "+ot},toTransition:()=>{}};return St}Eg.applyToOptions=o=>{const s=jD(o,100,Eg);return o.ease=s.ease,o.duration=fi(s.duration),o.type="keyframes",o};function ob({keyframes:o,velocity:s=0,power:d=.8,timeConstant:m=325,bounceDamping:y=10,bounceStiffness:b=500,modifyTarget:v,min:x,max:A,restDelta:R=.5,restSpeed:M}){const C=o[0],z={done:!1,value:C},L=tt=>x!==void 0&&tt<x||A!==void 0&&tt>A,et=tt=>x===void 0?A:A===void 0||Math.abs(x-tt)<Math.abs(A-tt)?x:A;let mt=d*s;const rt=C+mt,st=v===void 0?rt:v(rt);st!==rt&&(mt=st-C);const ut=tt=>-mt*Math.exp(-tt/m),it=tt=>st+ut(tt),St=tt=>{const ft=ut(tt),xt=it(tt);z.done=Math.abs(ft)<=R,z.value=z.done?st:xt};let vt,ot;const lt=tt=>{L(z.value)&&(vt=tt,ot=Eg({keyframes:[z.value,et(z.value)],velocity:rT(it,tt,z.value),damping:y,stiffness:b,restDelta:R,restSpeed:M}))};return lt(0),{calculatedDuration:null,next:tt=>{let ft=!1;return!ot&&vt===void 0&&(ft=!0,St(tt),lt(tt)),vt!==void 0&&tt>=vt?ot.next(tt-vt):(!ft&&St(tt),z)}}}function ZD(o,s,d){const m=[],y=d||Zu.mix||sT,b=o.length-1;for(let v=0;v<b;v++){let x=y(o[v],o[v+1]);if(s){const A=Array.isArray(s)?s[v]||vl:s;x=um(A,x)}m.push(x)}return m}function kD(o,s,{clamp:d=!0,ease:m,mixer:y}={}){const b=o.length;if(Qu(b===s.length,"Both input and output ranges must be the same length","range-length"),b===1)return()=>s[0];if(b===2&&s[0]===s[1])return()=>s[1];const v=o[0]===o[1];o[0]>o[b-1]&&(o=[...o].reverse(),s=[...s].reverse());const x=ZD(s,m,y),A=x.length,R=M=>{if(v&&M<o[0])return s[0];let C=0;if(A>1)for(;C<o.length-2&&!(M<o[C+1]);C++);const z=om(o[C],o[C+1],M);return x[C](z)};return d?M=>R(Xu(o[0],o[b-1],M)):R}function KD(o,s){const d=o[o.length-1];for(let m=1;m<=s;m++){const y=om(0,s,m);o.push(Qe(d,1,y))}}function $D(o){const s=[0];return KD(s,o.length-1),s}function JD(o,s){return o.map(d=>d*s)}function WD(o,s){return o.map(()=>s||kS).splice(0,o.length-1)}function Af({duration:o=300,keyframes:s,times:d,ease:m="easeInOut"}){const y=sD(m)?m.map(JS):JS(m),b={done:!1,value:s[0]},v=JD(d&&d.length===s.length?d:$D(s),o),x=kD(v,s,{ease:Array.isArray(y)?y:WD(s,y)});return{calculatedDuration:o,next:A=>(b.value=x(A),b.done=A>=o,b)}}const FD=o=>o!==null;function sb(o,{repeat:s,repeatType:d="loop"},m,y=1){const b=o.filter(FD),x=y<0||s&&d!=="loop"&&s%2===1?0:b.length-1;return!x||m===void 0?b[x]:m}const PD={decay:ob,inertia:ob,tween:Af,keyframes:Af,spring:Eg};function dT(o){typeof o.type=="string"&&(o.type=PD[o.type])}class cb{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(s=>{this.resolve=s})}notifyFinished(){this.resolve()}then(s,d){return this.finished.then(s,d)}}const ID=o=>o/100;class rb extends cb{constructor(s){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:d}=this.options;d&&d.updatedAt!==za.now()&&this.tick(za.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=s,this.initAnimation(),this.play(),s.autoplay===!1&&this.pause()}initAnimation(){const{options:s}=this;dT(s);const{type:d=Af,repeat:m=0,repeatDelay:y=0,repeatType:b,velocity:v=0}=s;let{keyframes:x}=s;const A=d||Af;process.env.NODE_ENV!=="production"&&A!==Af&&Qu(x.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${x}`,"spring-two-frames"),A!==Af&&typeof x[0]!="number"&&(this.mixKeyframes=um(ID,sT(x[0],x[1])),x=[0,100]);const R=A({...s,keyframes:x});b==="mirror"&&(this.mirroredGenerator=A({...s,keyframes:[...x].reverse(),velocity:-v})),R.calculatedDuration===null&&(R.calculatedDuration=lb(R));const{calculatedDuration:M}=R;this.calculatedDuration=M,this.resolvedDuration=M+y,this.totalDuration=this.resolvedDuration*(m+1)-y,this.generator=R}updateTime(s){const d=Math.round(s-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=d}tick(s,d=!1){const{generator:m,totalDuration:y,mixKeyframes:b,mirroredGenerator:v,resolvedDuration:x,calculatedDuration:A}=this;if(this.startTime===null)return m.next(0);const{delay:R=0,keyframes:M,repeat:C,repeatType:z,repeatDelay:L,type:et,onUpdate:mt,finalKeyframe:rt}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,s):this.speed<0&&(this.startTime=Math.min(s-y/this.speed,this.startTime)),d?this.currentTime=s:this.updateTime(s);const st=this.currentTime-R*(this.playbackSpeed>=0?1:-1),ut=this.playbackSpeed>=0?st<0:st>y;this.currentTime=Math.max(st,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=y);let it=this.currentTime,St=m;if(C){const tt=Math.min(this.currentTime,y)/x;let ft=Math.floor(tt),xt=tt%1;!xt&&tt>=1&&(xt=1),xt===1&&ft--,ft=Math.min(ft,C+1),!!(ft%2)&&(z==="reverse"?(xt=1-xt,L&&(xt-=L/x)):z==="mirror"&&(St=v)),it=Xu(0,1,xt)*x}const vt=ut?{done:!1,value:M[0]}:St.next(it);b&&(vt.value=b(vt.value));let{done:ot}=vt;!ut&&A!==null&&(ot=this.playbackSpeed>=0?this.currentTime>=y:this.currentTime<=0);const lt=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ot);return lt&&et!==ob&&(vt.value=sb(M,this.options,rt,this.speed)),mt&&mt(vt.value),lt&&this.finish(),vt}then(s,d){return this.finished.then(s,d)}get duration(){return Ki(this.calculatedDuration)}get time(){return Ki(this.currentTime)}set time(s){s=fi(s),this.currentTime=s,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=s:this.driver&&(this.startTime=this.driver.now()-s/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(s){this.updateTime(za.now());const d=this.playbackSpeed!==s;this.playbackSpeed=s,d&&(this.time=Ki(this.currentTime))}play(){if(this.isStopped)return;const{driver:s=ND,startTime:d}=this.options;this.driver||(this.driver=s(y=>this.tick(y))),this.options.onPlay?.();const m=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=m):this.holdTime!==null?this.startTime=m-this.holdTime:this.startTime||(this.startTime=d??m),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(za.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(s){return this.startTime=0,this.tick(s,!0)}attachTimeline(s){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),s.observe(this)}}function tM(o){for(let s=1;s<o.length;s++)o[s]??(o[s]=o[s-1])}const Rc=o=>o*180/Math.PI,fb=o=>{const s=Rc(Math.atan2(o[1],o[0]));return db(s)},eM={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:o=>(Math.abs(o[0])+Math.abs(o[3]))/2,rotate:fb,rotateZ:fb,skewX:o=>Rc(Math.atan(o[1])),skewY:o=>Rc(Math.atan(o[2])),skew:o=>(Math.abs(o[1])+Math.abs(o[2]))/2},db=o=>(o=o%360,o<0&&(o+=360),o),hT=fb,mT=o=>Math.sqrt(o[0]*o[0]+o[1]*o[1]),pT=o=>Math.sqrt(o[4]*o[4]+o[5]*o[5]),nM={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:mT,scaleY:pT,scale:o=>(mT(o)+pT(o))/2,rotateX:o=>db(Rc(Math.atan2(o[6],o[5]))),rotateY:o=>db(Rc(Math.atan2(-o[2],o[0]))),rotateZ:hT,rotate:hT,skewX:o=>Rc(Math.atan(o[4])),skewY:o=>Rc(Math.atan(o[1])),skew:o=>(Math.abs(o[1])+Math.abs(o[4]))/2};function hb(o){return o.includes("scale")?1:0}function mb(o,s){if(!o||o==="none")return hb(s);const d=o.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let m,y;if(d)m=nM,y=d;else{const x=o.match(/^matrix\(([-\d.e\s,]+)\)$/u);m=eM,y=x}if(!y)return hb(s);const b=m[s],v=y[1].split(",").map(lM);return typeof b=="function"?b(v):v[b]}const aM=(o,s)=>{const{transform:d="none"}=getComputedStyle(o);return mb(d,s)};function lM(o){return parseFloat(o.trim())}const Ef=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Df=new Set(Ef),yT=o=>o===Tf||o===jt,iM=new Set(["x","y","z"]),uM=Ef.filter(o=>!iM.has(o));function oM(o){const s=[];return uM.forEach(d=>{const m=o.getValue(d);m!==void 0&&(s.push([d,m.get()]),m.set(d.startsWith("scale")?1:0))}),s}const Oc={width:({x:o},{paddingLeft:s="0",paddingRight:d="0"})=>o.max-o.min-parseFloat(s)-parseFloat(d),height:({y:o},{paddingTop:s="0",paddingBottom:d="0"})=>o.max-o.min-parseFloat(s)-parseFloat(d),top:(o,{top:s})=>parseFloat(s),left:(o,{left:s})=>parseFloat(s),bottom:({y:o},{top:s})=>parseFloat(s)+(o.max-o.min),right:({x:o},{left:s})=>parseFloat(s)+(o.max-o.min),x:(o,{transform:s})=>mb(s,"x"),y:(o,{transform:s})=>mb(s,"y")};Oc.translateX=Oc.x,Oc.translateY=Oc.y;const Cc=new Set;let pb=!1,yb=!1,gb=!1;function gT(){if(yb){const o=Array.from(Cc).filter(m=>m.needsMeasurement),s=new Set(o.map(m=>m.element)),d=new Map;s.forEach(m=>{const y=oM(m);y.length&&(d.set(m,y),m.render())}),o.forEach(m=>m.measureInitialState()),s.forEach(m=>{m.render();const y=d.get(m);y&&y.forEach(([b,v])=>{m.getValue(b)?.set(v)})}),o.forEach(m=>m.measureEndState()),o.forEach(m=>{m.suspendedScrollY!==void 0&&window.scrollTo(0,m.suspendedScrollY)})}yb=!1,pb=!1,Cc.forEach(o=>o.complete(gb)),Cc.clear()}function vT(){Cc.forEach(o=>{o.readKeyframes(),o.needsMeasurement&&(yb=!0)})}function sM(){gb=!0,vT(),gT(),gb=!1}class vb{constructor(s,d,m,y,b,v=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...s],this.onComplete=d,this.name=m,this.motionValue=y,this.element=b,this.isAsync=v}scheduleResolve(){this.state="scheduled",this.isAsync?(Cc.add(this),pb||(pb=!0,Ve.read(vT),Ve.resolveKeyframes(gT))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:s,name:d,element:m,motionValue:y}=this;if(s[0]===null){const b=y?.get(),v=s[s.length-1];if(b!==void 0)s[0]=b;else if(m&&d){const x=m.readValue(d,v);x!=null&&(s[0]=x)}s[0]===void 0&&(s[0]=v),y&&b===void 0&&y.set(s[0])}tM(s)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(s=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,s),Cc.delete(this)}cancel(){this.state==="scheduled"&&(Cc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const cM=o=>o.startsWith("--");function rM(o,s,d){cM(s)?o.style.setProperty(s,d):o.style[s]=d}const fM=Gv(()=>window.ScrollTimeline!==void 0),dM={};function hM(o,s){const d=Gv(o);return()=>dM[s]??d()}const bT=hM(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),hm=([o,s,d,m])=>`cubic-bezier(${o}, ${s}, ${d}, ${m})`,ST={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hm([0,.65,.55,1]),circOut:hm([.55,0,1,.45]),backIn:hm([.31,.01,.66,-.59]),backOut:hm([.33,1.53,.69,.99])};function TT(o,s){if(o)return typeof o=="function"?bT()?cT(o,s):"ease-out":KS(o)?hm(o):Array.isArray(o)?o.map(d=>TT(d,s)||ST.easeOut):ST[o]}function mM(o,s,d,{delay:m=0,duration:y=300,repeat:b=0,repeatType:v="loop",ease:x="easeOut",times:A}={},R=void 0){const M={[s]:d};A&&(M.offset=A);const C=TT(x,y);Array.isArray(C)&&(M.easing=C);const z={delay:m,duration:y,easing:Array.isArray(C)?"linear":C,fill:"both",iterations:b+1,direction:v==="reverse"?"alternate":"normal"};return R&&(z.pseudoElement=R),o.animate(M,z)}function xT(o){return typeof o=="function"&&"applyToOptions"in o}function pM({type:o,...s}){return xT(o)&&bT()?o.applyToOptions(s):(s.duration??(s.duration=300),s.ease??(s.ease="easeOut"),s)}class yM extends cb{constructor(s){if(super(),this.finishedTime=null,this.isStopped=!1,!s)return;const{element:d,name:m,keyframes:y,pseudoElement:b,allowFlatten:v=!1,finalKeyframe:x,onComplete:A}=s;this.isPseudoElement=!!b,this.allowFlatten=v,this.options=s,Qu(typeof s.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const R=pM(s);this.animation=mM(d,m,y,R,b),R.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!b){const M=sb(y,this.options,x,this.speed);this.updateMotionValue?this.updateMotionValue(M):rM(d,m,M),this.animation.cancel()}A?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:s}=this;s==="idle"||s==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const s=this.animation.effect?.getComputedTiming?.().duration||0;return Ki(Number(s))}get time(){return Ki(Number(this.animation.currentTime)||0)}set time(s){this.finishedTime=null,this.animation.currentTime=fi(s)}get speed(){return this.animation.playbackRate}set speed(s){s<0&&(this.finishedTime=null),this.animation.playbackRate=s}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(s){this.animation.startTime=s}attachTimeline({timeline:s,observe:d}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,s&&fM()?(this.animation.timeline=s,vl):d(this)}}const AT={anticipate:XS,backInOut:GS,circInOut:ZS};function gM(o){return o in AT}function vM(o){typeof o.ease=="string"&&gM(o.ease)&&(o.ease=AT[o.ease])}const ET=10;class bM extends yM{constructor(s){vM(s),dT(s),super(s),s.startTime&&(this.startTime=s.startTime),this.options=s}updateMotionValue(s){const{motionValue:d,onUpdate:m,onComplete:y,element:b,...v}=this.options;if(!d)return;if(s!==void 0){d.set(s);return}const x=new rb({...v,autoplay:!1}),A=fi(this.finishedTime??this.time);d.setWithVelocity(x.sample(A-ET).value,x.sample(A).value,ET),x.stop()}}const DT=(o,s)=>s==="zIndex"?!1:!!(typeof o=="number"||Array.isArray(o)||typeof o=="string"&&(us.test(o)||o==="0")&&!o.startsWith("url("));function SM(o){const s=o[0];if(o.length===1)return!0;for(let d=0;d<o.length;d++)if(o[d]!==s)return!0}function TM(o,s,d,m){const y=o[0];if(y===null)return!1;if(s==="display"||s==="visibility")return!0;const b=o[o.length-1],v=DT(y,s),x=DT(b,s);return Sf(v===x,`You are trying to animate ${s} from "${y}" to "${b}". "${v?b:y}" is not an animatable value.`,"value-not-animatable"),!v||!x?!1:SM(o)||(d==="spring"||xT(d))&&m}const xM=new Set(["opacity","clipPath","filter","transform"]),AM=Gv(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function EM(o){const{motionValue:s,name:d,repeatDelay:m,repeatType:y,damping:b,type:v}=o;if(!(s?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:A,transformTemplate:R}=s.owner.getProps();return AM()&&d&&xM.has(d)&&(d!=="transform"||!R)&&!A&&!m&&y!=="mirror"&&b!==0&&v!=="inertia"}const DM=40;class MM extends cb{constructor({autoplay:s=!0,delay:d=0,type:m="keyframes",repeat:y=0,repeatDelay:b=0,repeatType:v="loop",keyframes:x,name:A,motionValue:R,element:M,...C}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=za.now();const z={autoplay:s,delay:d,type:m,repeat:y,repeatDelay:b,repeatType:v,name:A,motionValue:R,element:M,...C},L=M?.KeyframeResolver||vb;this.keyframeResolver=new L(x,(et,mt,rt)=>this.onKeyframesResolved(et,mt,z,!rt),A,R,M),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(s,d,m,y){this.keyframeResolver=void 0;const{name:b,type:v,velocity:x,delay:A,isHandoff:R,onUpdate:M}=m;this.resolvedAt=za.now(),TM(s,b,v,x)||((Zu.instantAnimations||!A)&&M?.(sb(s,m,d)),s[0]=s[s.length-1],m.duration=0,m.repeat=0);const z={startTime:y?this.resolvedAt?this.resolvedAt-this.createdAt>DM?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:d,...m,keyframes:s},L=!R&&EM(z)?new bM({...z,element:z.motionValue.owner.current}):new rb(z);L.finished.then(()=>this.notifyFinished()).catch(vl),this.pendingTimeline&&(this.stopTimeline=L.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=L}get finished(){return this._animation?this.animation.finished:this._finished}then(s,d){return this.finished.finally(s).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),sM()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(s){this.animation.time=s}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(s){this.animation.speed=s}get startTime(){return this.animation.startTime}attachTimeline(s){return this._animation?this.stopTimeline=this.animation.attachTimeline(s):this.pendingTimeline=s,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const RM=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function OM(o){const s=RM.exec(o);if(!s)return[,];const[,d,m,y]=s;return[`--${d??m}`,y]}const CM=4;function MT(o,s,d=1){Qu(d<=CM,`Max CSS variable fallback depth detected in property "${o}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[m,y]=OM(o);if(!m)return;const b=window.getComputedStyle(s).getPropertyValue(m);if(b){const v=b.trim();return HS(v)?parseFloat(v):v}return Jv(y)?MT(y,s,d+1):y}function bb(o,s){return o?.[s]??o?.default??o}const RT=new Set(["width","height","top","left","right","bottom",...Ef]),zM={test:o=>o==="auto",parse:o=>o},OT=o=>s=>s.test(o),CT=[Tf,jt,$i,is,SD,bD,zM],zT=o=>CT.find(OT(o));function wM(o){return typeof o=="number"?o===0:o!==null?o==="none"||o==="0"||BS(o):!0}const UM=new Set(["brightness","contrast","saturate","opacity"]);function HM(o){const[s,d]=o.slice(0,-1).split("(");if(s==="drop-shadow")return o;const[m]=d.match(Wv)||[];if(!m)return o;const y=d.replace(m,"");let b=UM.has(s)?1:0;return m!==d&&(b*=100),s+"("+b+y+")"}const VM=/\b([a-z-]*)\(.*?\)/gu,Sb={...us,getAnimatableNone:o=>{const s=o.match(VM);return s?s.map(HM).join(" "):o}},wT={...Tf,transform:Math.round},Tb={borderWidth:jt,borderTopWidth:jt,borderRightWidth:jt,borderBottomWidth:jt,borderLeftWidth:jt,borderRadius:jt,radius:jt,borderTopLeftRadius:jt,borderTopRightRadius:jt,borderBottomRightRadius:jt,borderBottomLeftRadius:jt,width:jt,maxWidth:jt,height:jt,maxHeight:jt,top:jt,right:jt,bottom:jt,left:jt,padding:jt,paddingTop:jt,paddingRight:jt,paddingBottom:jt,paddingLeft:jt,margin:jt,marginTop:jt,marginRight:jt,marginBottom:jt,marginLeft:jt,backgroundPositionX:jt,backgroundPositionY:jt,...{rotate:is,rotateX:is,rotateY:is,rotateZ:is,scale:Tg,scaleX:Tg,scaleY:Tg,scaleZ:Tg,skew:is,skewX:is,skewY:is,distance:jt,translateX:jt,translateY:jt,translateZ:jt,x:jt,y:jt,z:jt,perspective:jt,transformPerspective:jt,opacity:cm,originX:IS,originY:IS,originZ:jt},zIndex:wT,fillOpacity:cm,strokeOpacity:cm,numOctaves:wT},BM={...Tb,color:un,backgroundColor:un,outlineColor:un,fill:un,stroke:un,borderColor:un,borderTopColor:un,borderRightColor:un,borderBottomColor:un,borderLeftColor:un,filter:Sb,WebkitFilter:Sb},UT=o=>BM[o];function HT(o,s){let d=UT(o);return d!==Sb&&(d=us),d.getAnimatableNone?d.getAnimatableNone(s):void 0}const NM=new Set(["auto","none","0"]);function jM(o,s,d){let m=0,y;for(;m<o.length&&!y;){const b=o[m];typeof b=="string"&&!NM.has(b)&&dm(b).values.length&&(y=o[m]),m++}if(y&&d)for(const b of s)o[b]=HT(d,y)}class LM extends vb{constructor(s,d,m,y,b){super(s,d,m,y,b,!0)}readKeyframes(){const{unresolvedKeyframes:s,element:d,name:m}=this;if(!d||!d.current)return;super.readKeyframes();for(let A=0;A<s.length;A++){let R=s[A];if(typeof R=="string"&&(R=R.trim(),Jv(R))){const M=MT(R,d.current);M!==void 0&&(s[A]=M),A===s.length-1&&(this.finalKeyframe=R)}}if(this.resolveNoneKeyframes(),!RT.has(m)||s.length!==2)return;const[y,b]=s,v=zT(y),x=zT(b);if(v!==x)if(yT(v)&&yT(x))for(let A=0;A<s.length;A++){const R=s[A];typeof R=="string"&&(s[A]=parseFloat(R))}else Oc[m]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:s,name:d}=this,m=[];for(let y=0;y<s.length;y++)(s[y]===null||wM(s[y]))&&m.push(y);m.length&&jM(s,m,d)}measureInitialState(){const{element:s,unresolvedKeyframes:d,name:m}=this;if(!s||!s.current)return;m==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Oc[m](s.measureViewportBox(),window.getComputedStyle(s.current)),d[0]=this.measuredOrigin;const y=d[d.length-1];y!==void 0&&s.getValue(m,y).jump(y,!1)}measureEndState(){const{element:s,name:d,unresolvedKeyframes:m}=this;if(!s||!s.current)return;const y=s.getValue(d);y&&y.jump(this.measuredOrigin,!1);const b=m.length-1,v=m[b];m[b]=Oc[d](s.measureViewportBox(),window.getComputedStyle(s.current)),v!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=v),this.removedTransforms?.length&&this.removedTransforms.forEach(([x,A])=>{s.getValue(x).set(A)}),this.resolveNoneKeyframes()}}function _M(o,s,d){if(o instanceof EventTarget)return[o];if(typeof o=="string"){let m=document;const y=d?.[o]??m.querySelectorAll(o);return y?Array.from(y):[]}return Array.from(o)}const VT=(o,s)=>s&&typeof o=="number"?s.transform(o):o;function BT(o){return VS(o)&&"offsetHeight"in o}const NT=30,qM=o=>!isNaN(parseFloat(o));class YM{constructor(s,d={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(m,y=!0)=>{const b=za.now();if(this.updatedAt!==b&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(m),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const v of this.dependents)v.dirty();y&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(s),this.owner=d.owner}setCurrent(s){this.current=s,this.updatedAt=za.now(),this.canTrackVelocity===null&&s!==void 0&&(this.canTrackVelocity=qM(this.current))}setPrevFrameValue(s=this.current){this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt}onChange(s){return process.env.NODE_ENV!=="production"&&Qv(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",s)}on(s,d){this.events[s]||(this.events[s]=new Xv);const m=this.events[s].add(d);return s==="change"?()=>{m(),Ve.read(()=>{this.events.change.getSize()||this.stop()})}:m}clearListeners(){for(const s in this.events)this.events[s].clear()}attach(s,d){this.passiveEffect=s,this.stopPassiveEffect=d}set(s,d=!0){!d||!this.passiveEffect?this.updateAndNotify(s,d):this.passiveEffect(s,this.updateAndNotify)}setWithVelocity(s,d,m){this.set(d),this.prev=void 0,this.prevFrameValue=s,this.prevUpdatedAt=this.updatedAt-m}jump(s,d=!0){this.updateAndNotify(s),this.prev=s,this.prevUpdatedAt=this.prevFrameValue=void 0,d&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(s){this.dependents||(this.dependents=new Set),this.dependents.add(s)}removeDependent(s){this.dependents&&this.dependents.delete(s)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const s=za.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||s-this.updatedAt>NT)return 0;const d=Math.min(this.updatedAt-this.prevUpdatedAt,NT);return NS(parseFloat(this.current)-parseFloat(this.prevFrameValue),d)}start(s){return this.stop(),new Promise(d=>{this.hasAnimated=!0,this.animation=s(d),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 Mf(o,s){return new YM(o,s)}const{schedule:xb}=WS(queueMicrotask,!1),di={x:!1,y:!1};function jT(){return di.x||di.y}function GM(o){return o==="x"||o==="y"?di[o]?null:(di[o]=!0,()=>{di[o]=!1}):di.x||di.y?null:(di.x=di.y=!0,()=>{di.x=di.y=!1})}function LT(o,s){const d=_M(o),m=new AbortController,y={passive:!0,...s,signal:m.signal};return[d,y,()=>m.abort()]}function _T(o){return!(o.pointerType==="touch"||jT())}function XM(o,s,d={}){const[m,y,b]=LT(o,d),v=x=>{if(!_T(x))return;const{target:A}=x,R=s(A,x);if(typeof R!="function"||!A)return;const M=C=>{_T(C)&&(R(C),A.removeEventListener("pointerleave",M))};A.addEventListener("pointerleave",M,y)};return m.forEach(x=>{x.addEventListener("pointerenter",v,y)}),b}const qT=(o,s)=>s?o===s?!0:qT(o,s.parentElement):!1,Ab=o=>o.pointerType==="mouse"?typeof o.button!="number"||o.button<=0:o.isPrimary!==!1,QM=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ZM(o){return QM.has(o.tagName)||o.tabIndex!==-1}const Dg=new WeakSet;function YT(o){return s=>{s.key==="Enter"&&o(s)}}function Eb(o,s){o.dispatchEvent(new PointerEvent("pointer"+s,{isPrimary:!0,bubbles:!0}))}const kM=(o,s)=>{const d=o.currentTarget;if(!d)return;const m=YT(()=>{if(Dg.has(d))return;Eb(d,"down");const y=YT(()=>{Eb(d,"up")}),b=()=>Eb(d,"cancel");d.addEventListener("keyup",y,s),d.addEventListener("blur",b,s)});d.addEventListener("keydown",m,s),d.addEventListener("blur",()=>d.removeEventListener("keydown",m),s)};function GT(o){return Ab(o)&&!jT()}function KM(o,s,d={}){const[m,y,b]=LT(o,d),v=x=>{const A=x.currentTarget;if(!GT(x))return;Dg.add(A);const R=s(A,x),M=(L,et)=>{window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",z),Dg.has(A)&&Dg.delete(A),GT(L)&&typeof R=="function"&&R(L,{success:et})},C=L=>{M(L,A===window||A===document||d.useGlobalTarget||qT(A,L.target))},z=L=>{M(L,!1)};window.addEventListener("pointerup",C,y),window.addEventListener("pointercancel",z,y)};return m.forEach(x=>{(d.useGlobalTarget?window:x).addEventListener("pointerdown",v,y),BT(x)&&(x.addEventListener("focus",R=>kM(R,y)),!ZM(x)&&!x.hasAttribute("tabindex")&&(x.tabIndex=0))}),b}function XT(o){return VS(o)&&"ownerSVGElement"in o}function $M(o){return XT(o)&&o.tagName==="svg"}const Jn=o=>!!(o&&o.getVelocity),JM=[...CT,un,us],WM=o=>JM.find(OT(o)),Db=ht.createContext({transformPagePoint:o=>o,isStatic:!1,reducedMotion:"never"});class FM extends Bv.Component{getSnapshotBeforeUpdate(s){const d=this.props.childRef.current;if(d&&s.isPresent&&!this.props.isPresent){const m=d.offsetParent,y=BT(m)&&m.offsetWidth||0,b=this.props.sizeRef.current;b.height=d.offsetHeight||0,b.width=d.offsetWidth||0,b.top=d.offsetTop,b.left=d.offsetLeft,b.right=y-b.width-b.left}return null}componentDidUpdate(){}render(){return this.props.children}}function PM({children:o,isPresent:s,anchorX:d,root:m}){const y=ht.useId(),b=ht.useRef(null),v=ht.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:x}=ht.useContext(Db);return ht.useInsertionEffect(()=>{const{width:A,height:R,top:M,left:C,right:z}=v.current;if(s||!b.current||!A||!R)return;const L=d==="left"?`left: ${C}`:`right: ${z}`;b.current.dataset.motionPopId=y;const et=document.createElement("style");x&&(et.nonce=x);const mt=m??document.head;return mt.appendChild(et),et.sheet&&et.sheet.insertRule(` [data-motion-pop-id="${y}"] { position: absolute !important; width: ${A}px !important; height: ${R}px !important; ${L}px !important; top: ${M}px !important; } `),()=>{mt.removeChild(et),mt.contains(et)&&mt.removeChild(et)}},[s]),J.jsx(FM,{isPresent:s,childRef:b,sizeRef:v,children:Bv.cloneElement(o,{ref:b})})}const IM=({children:o,initial:s,isPresent:d,onExitComplete:m,custom:y,presenceAffectsLayout:b,mode:v,anchorX:x,root:A})=>{const R=jv(tR),M=ht.useId();let C=!0,z=ht.useMemo(()=>(C=!1,{id:M,initial:s,isPresent:d,custom:y,onExitComplete:L=>{R.set(L,!0);for(const et of R.values())if(!et)return;m&&m()},register:L=>(R.set(L,!1),()=>R.delete(L))}),[d,R,m]);return b&&C&&(z={...z}),ht.useMemo(()=>{R.forEach((L,et)=>R.set(et,!1))},[d]),Bv.useEffect(()=>{!d&&!R.size&&m&&m()},[d]),v==="popLayout"&&(o=J.jsx(PM,{isPresent:d,anchorX:x,root:A,children:o})),J.jsx(vg.Provider,{value:z,children:o})};function tR(){return new Map}function QT(o=!0){const s=ht.useContext(vg);if(s===null)return[!0,null];const{isPresent:d,onExitComplete:m,register:y}=s,b=ht.useId();ht.useEffect(()=>{if(o)return y(b)},[o]);const v=ht.useCallback(()=>o&&m&&m(b),[b,m,o]);return!d&&m?[!1,v]:[!0]}const Mg=o=>o.key||"";function ZT(o){const s=[];return ht.Children.forEach(o,d=>{ht.isValidElement(d)&&s.push(d)}),s}const Mb=({children:o,custom:s,initial:d=!0,onExitComplete:m,presenceAffectsLayout:y=!0,mode:b="sync",propagate:v=!1,anchorX:x="left",root:A})=>{const[R,M]=QT(v),C=ht.useMemo(()=>ZT(o),[o]),z=v&&!R?[]:C.map(Mg),L=ht.useRef(!0),et=ht.useRef(C),mt=jv(()=>new Map),[rt,st]=ht.useState(C),[ut,it]=ht.useState(C);US(()=>{L.current=!1,et.current=C;for(let ot=0;ot<ut.length;ot++){const lt=Mg(ut[ot]);z.includes(lt)?mt.delete(lt):mt.get(lt)!==!0&&mt.set(lt,!1)}},[ut,z.length,z.