@telegraph/combobox 0.1.26 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +808 -779
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/Combobox/Combobox.d.ts +9 -2
- package/dist/types/Combobox/Combobox.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @telegraph/combobox
|
|
2
2
|
|
|
3
|
+
## 0.1.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#679](https://github.com/knocklabs/telegraph/pull/679) [`7111048`](https://github.com/knocklabs/telegraph/commit/71110486996cf8e447f503bf1aef63aeee1a6d4e) Thanks [@kylemcd](https://github.com/kylemcd)! - feat: add defaultValue and defaultScrollToValue, automatically scroll to value on open
|
|
8
|
+
|
|
3
9
|
## 0.1.26
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),Xs=require("@radix-ui/react-dismissable-layer"),Qs=require("@radix-ui/react-portal"),Zs=require("@radix-ui/react-use-controllable-state"),Js=require("@radix-ui/react-visually-hidden"),ce=require("@telegraph/button"),Sn=require("@telegraph/compose-refs"),Cn=require("@telegraph/icon"),er=require("@telegraph/input"),W=require("@telegraph/layout"),ke=require("@telegraph/menu"),mt=require("@telegraph/typography"),Q=require("lucide-react"),p=require("react"),tr=require("@telegraph/helpers"),gt=require("@telegraph/tag"),nr=require("@telegraph/tooltip"),Vn=require("@telegraph/truncate");function An(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const sr=An(Qs),rr=An(Js),ir={0:"5",1:"6",2:"8",3:"10"},N=e=>Array.isArray(e),Z=e=>typeof e=="object"&&!Array.isArray(e)||typeof e=="string"||!e,or=e=>{const t=(r,i=[])=>(p.Children.toArray(r).forEach(a=>{if(p.isValidElement(a)){const c=a.props;c.value?i.push(a):c.children&&t(c.children,i)}}),i);return t(e).map(r=>{var o;const i=r;return{value:i.props.value,label:((o=i.props)==null?void 0:o.label)||i.props.children||i.props.value}})},H=(e,t)=>{if(e)return t===!0?e==null?void 0:e.value:e},ze=(e,t,n)=>{if(!e||!t||t.length===0)return;const s=t.find(r=>r.value===H(e,n));if(s)return s},ar=({children:e,value:t,searchQuery:n})=>{const s=Mn(e);return(t==null?void 0:t.toLowerCase().includes(n.toLowerCase()))||s.some(r=>r.toLowerCase().includes(n.toLowerCase()))},Mn=e=>{const t=p.Children.toArray(e),n=[];return t.forEach(s=>{if(typeof s=="string"&&n.push(s),p.isValidElement(s)){const r=s.props;r.children&&n.push(...Mn(r.children))}}),n},cr=p.createContext({});function ur(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const yt=typeof window<"u",lr=yt?p.useLayoutEffect:p.useEffect,Pn=p.createContext(null);function fr(e,t){e.indexOf(t)===-1&&e.push(t)}function dr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const J=(e,t,n)=>n>t?t:n<e?e:n;function Ye(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let we=()=>{},ee=()=>{};process.env.NODE_ENV!=="production"&&(we=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Ye(t,n))},ee=(e,t,n)=>{if(!e)throw new Error(Ye(t,n))});const _={},Rn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function hr(e){return typeof e=="object"&&e!==null}const Fn=e=>/^0[^.\s]+$/u.test(e);function bt(e){let t;return()=>(t===void 0&&(t=e()),t)}const ue=e=>e,pr=(e,t)=>n=>t(e(n)),je=(...e)=>e.reduce(pr),Dn=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class On{constructor(){this.subscriptions=[]}add(t){return fr(this.subscriptions,t),()=>dr(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const L=e=>e*1e3,K=e=>e/1e3;function In(e,t){return t?e*(1e3/t):0}const Gt=new Set;function En(e,t,n){e||Gt.has(t)||(console.warn(Ye(t,n)),Gt.add(t))}const kn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mr=1e-7,gr=12;function yr(e,t,n,s,r){let i,o,a=0;do o=t+(n-t)/2,i=kn(o,s,r)-e,i>0?n=o:t=o;while(Math.abs(i)>mr&&++a<gr);return o}function Se(e,t,n,s){if(e===t&&n===s)return ue;const r=i=>yr(i,0,1,e,n);return i=>i===0||i===1?i:kn(r(i),t,s)}const jn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Bn=e=>t=>1-e(1-t),Ln=Se(.33,1.53,.69,.99),vt=Bn(Ln),Nn=jn(vt),Kn=e=>(e*=2)<1?.5*vt(e):.5*(2-Math.pow(2,-10*(e-1))),xt=e=>1-Math.sin(Math.acos(e)),br=Bn(xt),_n=jn(xt),vr=Se(.42,0,1,1),xr=Se(0,0,.58,1),$n=Se(.42,0,.58,1),Tr=e=>Array.isArray(e)&&typeof e[0]!="number",Wn=e=>Array.isArray(e)&&typeof e[0]=="number",qt={linear:ue,easeIn:vr,easeInOut:$n,easeOut:xr,circIn:xt,circInOut:_n,circOut:br,backIn:vt,backInOut:Nn,backOut:Ln,anticipate:Kn},wr=e=>typeof e=="string",Ut=e=>{if(Wn(e)){ee(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,r]=e;return Se(t,n,s,r)}else if(wr(e))return ee(qt[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),qt[e];return e},Ve=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Sr(e,t){let n=new Set,s=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){o.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,d=!1,f=!1)=>{const g=f&&r?n:s;return d&&o.add(u),g.has(u)||g.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,r){i=!0;return}r=!0,[n,s]=[s,n],n.forEach(c),n.clear(),r=!1,i&&(i=!1,l.process(u))}};return l}const Cr=40;function Hn(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Ve.reduce((x,A)=>(x[A]=Sr(i),x),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:h,postRender:g}=o,b=()=>{const x=_.useManualTiming?r.timestamp:performance.now();n=!1,_.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(x-r.timestamp,Cr),1)),r.timestamp=x,r.isProcessing=!0,a.process(r),c.process(r),l.process(r),u.process(r),d.process(r),f.process(r),h.process(r),g.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(b))},v=()=>{n=!0,s=!0,r.isProcessing||e(b)};return{schedule:Ve.reduce((x,A)=>{const S=o[A];return x[A]=(V,M=!1,C=!1)=>(n||v(),S.schedule(V,M,C)),x},{}),cancel:x=>{for(let A=0;A<Ve.length;A++)o[Ve[A]].cancel(x)},state:r,steps:o}}const{schedule:B,cancel:Xe,state:Re}=Hn(typeof requestAnimationFrame<"u"?requestAnimationFrame:ue,!0);let Me;function Vr(){Me=void 0}const j={now:()=>(Me===void 0&&j.set(Re.isProcessing||_.useManualTiming?Re.timestamp:performance.now()),Me),set:e=>{Me=e,queueMicrotask(Vr)}},Gn=e=>t=>typeof t=="string"&&t.startsWith(e),qn=Gn("--"),Ar=Gn("var(--"),Tt=e=>Ar(e)?Mr.test(e.split("/*")[0].trim()):!1,Mr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,le={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ve={...le,transform:e=>J(0,1,e)},Ae={...le,default:1},ye=e=>Math.round(e*1e5)/1e5,wt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pr(e){return e==null}const Rr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,St=(e,t)=>n=>!!(typeof n=="string"&&Rr.test(n)&&n.startsWith(e)||t&&!Pr(n)&&Object.prototype.hasOwnProperty.call(n,t)),Un=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,i,o,a]=s.match(wt);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Fr=e=>J(0,255,e),_e={...le,transform:e=>Math.round(Fr(e))},U={test:St("rgb","red"),parse:Un("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+_e.transform(e)+", "+_e.transform(t)+", "+_e.transform(n)+", "+ye(ve.transform(s))+")"};function Dr(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Qe={test:St("#"),parse:Dr,transform:U.transform},Ce=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$=Ce("deg"),ie=Ce("%"),T=Ce("px"),Or=Ce("vh"),Ir=Ce("vw"),zt={...ie,parse:e=>ie.parse(e)/100,transform:e=>ie.transform(e*100)},se={test:St("hsl","hue"),parse:Un("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+ie.transform(ye(t))+", "+ie.transform(ye(n))+", "+ye(ve.transform(s))+")"},R={test:e=>U.test(e)||Qe.test(e)||se.test(e),parse:e=>U.test(e)?U.parse(e):se.test(e)?se.parse(e):Qe.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?U.transform(e):se.transform(e),getAnimatableNone:e=>{const t=R.parse(e);return t.alpha=0,R.transform(t)}},Er=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kr(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(wt))==null?void 0:t.length)||0)+(((n=e.match(Er))==null?void 0:n.length)||0)>0}const zn="number",Yn="color",jr="var",Br="var(",Yt="${}",Lr=/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 xe(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const a=t.replace(Lr,c=>(R.test(c)?(s.color.push(i),r.push(Yn),n.push(R.parse(c))):c.startsWith(Br)?(s.var.push(i),r.push(jr),n.push(c)):(s.number.push(i),r.push(zn),n.push(parseFloat(c))),++i,Yt)).split(Yt);return{values:n,split:a,indexes:s,types:r}}function Xn(e){return xe(e).values}function Qn(e){const{split:t,types:n}=xe(e),s=t.length;return r=>{let i="";for(let o=0;o<s;o++)if(i+=t[o],r[o]!==void 0){const a=n[o];a===zn?i+=ye(r[o]):a===Yn?i+=R.transform(r[o]):i+=r[o]}return i}}const Nr=e=>typeof e=="number"?0:R.test(e)?R.getAnimatableNone(e):e;function Kr(e){const t=Xn(e);return Qn(e)(t.map(Nr))}const fe={test:kr,parse:Xn,createTransformer:Qn,getAnimatableNone:Kr};function $e(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _r({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,i=0,o=0;if(!t)r=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=$e(c,a,e+1/3),i=$e(c,a,e),o=$e(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}function Fe(e,t){return n=>n>0?t:e}const Be=(e,t,n)=>e+(t-e)*n,We=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},$r=[Qe,U,se],Wr=e=>$r.find(t=>t.test(e));function Xt(e){const t=Wr(e);if(we(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===se&&(n=_r(n)),n}const Qt=(e,t)=>{const n=Xt(e),s=Xt(t);if(!n||!s)return Fe(e,t);const r={...n};return i=>(r.red=We(n.red,s.red,i),r.green=We(n.green,s.green,i),r.blue=We(n.blue,s.blue,i),r.alpha=Be(n.alpha,s.alpha,i),U.transform(r))},Ze=new Set(["none","hidden"]);function Hr(e,t){return Ze.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Gr(e,t){return n=>Be(e,t,n)}function Ct(e){return typeof e=="number"?Gr:typeof e=="string"?Tt(e)?Fe:R.test(e)?Qt:zr:Array.isArray(e)?Zn:typeof e=="object"?R.test(e)?Qt:qr:Fe}function Zn(e,t){const n=[...e],s=n.length,r=e.map((i,o)=>Ct(i)(i,t[o]));return i=>{for(let o=0;o<s;o++)n[o]=r[o](i);return n}}function qr(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Ct(e[r])(e[r],t[r]));return r=>{for(const i in s)n[i]=s[i](r);return n}}function Ur(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],o=e.indexes[i][s[i]],a=e.values[o]??0;n[r]=a,s[i]++}return n}const zr=(e,t)=>{const n=fe.createTransformer(t),s=xe(e),r=xe(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?Ze.has(e)&&!r.values.length||Ze.has(t)&&!s.values.length?Hr(e,t):je(Zn(Ur(s,r),r.values),n):(we(!0,`Complex values '${e}' and '${t}' 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"),Fe(e,t))};function Jn(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Be(e,t,n):Ct(e)(e,t)}const Yr=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>B.update(t,n),stop:()=>Xe(t),now:()=>Re.isProcessing?Re.timestamp:j.now()}},es=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)s+=Math.round(e(i/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},De=2e4;function Vt(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<De;)t+=n,s=e.next(t);return t>=De?1/0:t}function Xr(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(Vt(s),De);return{type:"keyframes",ease:i=>s.next(r*i).value/t,duration:K(r)}}const Qr=5;function ts(e,t,n){const s=Math.max(t-Qr,0);return In(n-e(s),t-s)}const P={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},He=.001;function Zr({duration:e=P.duration,bounce:t=P.bounce,velocity:n=P.velocity,mass:s=P.mass}){let r,i;we(e<=L(P.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=J(P.minDamping,P.maxDamping,o),e=J(P.minDuration,P.maxDuration,K(e)),o<1?(r=l=>{const u=l*o,d=u*e,f=u-n,h=Je(l,o),g=Math.exp(-d);return He-f/h*g},i=l=>{const d=l*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(l,2)*e,g=Math.exp(-d),b=Je(Math.pow(l,2),o);return(-r(l)+He>0?-1:1)*((f-h)*g)/b}):(r=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-He+u*d},i=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=ei(r,i,a);if(e=L(e),isNaN(c))return{stiffness:P.stiffness,damping:P.damping,duration:e};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:e}}}const Jr=12;function ei(e,t,n){let s=n;for(let r=1;r<Jr;r++)s=s-e(s)/t(s);return s}function Je(e,t){return e*Math.sqrt(1-t*t)}const ti=["duration","bounce"],ni=["stiffness","damping","mass"];function Zt(e,t){return t.some(n=>e[n]!==void 0)}function si(e){let t={velocity:P.velocity,stiffness:P.stiffness,damping:P.damping,mass:P.mass,isResolvedFromDuration:!1,...e};if(!Zt(e,ni)&&Zt(e,ti))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,i=2*J(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:P.mass,stiffness:r,damping:i}}else{const n=Zr(e);t={...t,...n,mass:P.mass},t.isResolvedFromDuration=!0}return t}function Oe(e=P.visualDuration,t=P.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=si({...n,velocity:-K(n.velocity||0)}),g=f||0,b=l/(2*Math.sqrt(c*u)),v=o-i,m=K(Math.sqrt(c/u)),w=Math.abs(v)<5;s||(s=w?P.restSpeed.granular:P.restSpeed.default),r||(r=w?P.restDelta.granular:P.restDelta.default);let x;if(b<1){const S=Je(m,b);x=V=>{const M=Math.exp(-b*m*V);return o-M*((g+b*m*v)/S*Math.sin(S*V)+v*Math.cos(S*V))}}else if(b===1)x=S=>o-Math.exp(-m*S)*(v+(g+m*v)*S);else{const S=m*Math.sqrt(b*b-1);x=V=>{const M=Math.exp(-b*m*V),C=Math.min(S*V,300);return o-M*((g+b*m*v)*Math.sinh(C)+S*v*Math.cosh(C))/S}}const A={calculatedDuration:h&&d||null,next:S=>{const V=x(S);if(h)a.done=S>=d;else{let M=S===0?g:0;b<1&&(M=S===0?L(g):ts(x,S,V));const C=Math.abs(M)<=s,D=Math.abs(o-V)<=r;a.done=C&&D}return a.value=a.done?o:V,a},toString:()=>{const S=Math.min(Vt(A),De),V=es(M=>A.next(S*M).value,S,30);return S+"ms "+V},toTransition:()=>{}};return A}Oe.applyToOptions=e=>{const t=Xr(e,100,Oe);return e.ease=t.ease,e.duration=L(t.duration),e.type="keyframes",e};function et({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=C=>a!==void 0&&C<a||c!==void 0&&C>c,g=C=>a===void 0?c:c===void 0||Math.abs(a-C)<Math.abs(c-C)?a:c;let b=n*t;const v=d+b,m=o===void 0?v:o(v);m!==v&&(b=m-d);const w=C=>-b*Math.exp(-C/s),x=C=>m+w(C),A=C=>{const D=w(C),E=x(C);f.done=Math.abs(D)<=l,f.value=f.done?m:E};let S,V;const M=C=>{h(f.value)&&(S=C,V=Oe({keyframes:[f.value,g(f.value)],velocity:ts(x,C,f.value),damping:r,stiffness:i,restDelta:l,restSpeed:u}))};return M(0),{calculatedDuration:null,next:C=>{let D=!1;return!V&&S===void 0&&(D=!0,A(C),M(C)),S!==void 0&&C>=S?V.next(C-S):(!D&&A(C),f)}}}function ri(e,t,n){const s=[],r=n||_.mix||Jn,i=e.length-1;for(let o=0;o<i;o++){let a=r(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||ue:t;a=je(c,a)}s.push(a)}return s}function ii(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const i=e.length;if(ee(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=ri(t,s,r),c=a.length,l=u=>{if(o&&u<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=Dn(e[d],e[d+1],u);return a[d](f)};return n?u=>l(J(e[0],e[i-1],u)):l}function oi(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=Dn(0,t,s);e.push(Be(n,1,r))}}function ai(e){const t=[0];return oi(t,e.length-1),t}function ci(e,t){return e.map(n=>n*t)}function ui(e,t){return e.map(()=>t||$n).splice(0,e.length-1)}function re({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=Tr(s)?s.map(Ut):Ut(s),i={done:!1,value:t[0]},o=ci(n&&n.length===t.length?n:ai(t),e),a=ii(o,t,{ease:Array.isArray(r)?r:ui(t,r)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const li=e=>e!==null;function At(e,{repeat:t,repeatType:n="loop"},s,r=1){const i=e.filter(li),a=r<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const fi={decay:et,inertia:et,tween:re,keyframes:re,spring:Oe};function ns(e){typeof e.type=="string"&&(e.type=fi[e.type])}class Mt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const di=e=>e/100;class Pt extends Mt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==j.now()&&this.tick(j.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;ns(t);const{type:n=re,repeat:s=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const c=n||re;process.env.NODE_ENV!=="production"&&c!==re&&ee(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==re&&typeof a[0]!="number"&&(this.mixKeyframes=je(di,Jn(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Vt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:h,type:g,onUpdate:b,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const m=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?m<0:m>r;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let x=this.currentTime,A=s;if(d){const C=Math.min(this.currentTime,r)/a;let D=Math.floor(C),E=C%1;!E&&C>=1&&(E=1),E===1&&D--,D=Math.min(D,d+1),!!(D%2)&&(f==="reverse"?(E=1-E,h&&(E-=h/a)):f==="mirror"&&(A=o)),x=J(0,1,E)*a}const S=w?{done:!1,value:u[0]}:A.next(x);i&&(S.value=i(S.value));let{done:V}=S;!w&&c!==null&&(V=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return M&&g!==et&&(S.value=At(u,this.options,v,this.speed)),b&&b(S.value),M&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return K(this.calculatedDuration)}get time(){return K(this.currentTime)}set time(t){var n;t=L(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(j.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=K(this.currentTime))}play(){var r,i;if(this.isStopped)return;const{driver:t=Yr,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(r=this.options).onPlay)==null||i.call(r);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(j.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function hi(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const z=e=>e*180/Math.PI,tt=e=>{const t=z(Math.atan2(e[1],e[0]));return nt(t)},pi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:tt,rotateZ:tt,skewX:e=>z(Math.atan(e[1])),skewY:e=>z(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},nt=e=>(e=e%360,e<0&&(e+=360),e),Jt=tt,en=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),mi={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:en,scaleY:tn,scale:e=>(en(e)+tn(e))/2,rotateX:e=>nt(z(Math.atan2(e[6],e[5]))),rotateY:e=>nt(z(Math.atan2(-e[2],e[0]))),rotateZ:Jt,rotate:Jt,skewX:e=>z(Math.atan(e[4])),skewY:e=>z(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function st(e){return e.includes("scale")?1:0}function rt(e,t){if(!e||e==="none")return st(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=mi,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=pi,r=a}if(!r)return st(t);const i=s[t],o=r[1].split(",").map(yi);return typeof i=="function"?i(o):o[i]}const gi=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return rt(n,t)};function yi(e){return parseFloat(e.trim())}const de=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],he=new Set(de),nn=e=>e===le||e===T,bi=new Set(["x","y","z"]),vi=de.filter(e=>!bi.has(e));function xi(e){const t=[];return vi.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Y={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>rt(t,"x"),y:(e,{transform:t})=>rt(t,"y")};Y.translateX=Y.x;Y.translateY=Y.y;const X=new Set;let it=!1,ot=!1,at=!1;function ss(){if(ot){const e=Array.from(X).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=xi(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([i,o])=>{var a;(a=s.getValue(i))==null||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ot=!1,it=!1,X.forEach(e=>e.complete(at)),X.clear()}function rs(){X.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ot=!0)})}function Ti(){at=!0,rs(),ss(),at=!1}class Rt{constructor(t,n,s,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(X.add(this),it||(it=!0,B.read(rs),B.resolveKeyframes(ss))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const i=r==null?void 0:r.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),r&&i===void 0&&r.set(t[0])}hi(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),X.delete(this)}cancel(){this.state==="scheduled"&&(X.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const wi=e=>e.startsWith("--");function Si(e,t,n){wi(t)?e.style.setProperty(t,n):e.style[t]=n}const Ci=bt(()=>window.ScrollTimeline!==void 0),Vi={};function Ai(e,t){const n=bt(e);return()=>Vi[t]??n()}const is=Ai(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),me=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,sn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:me([0,.65,.55,1]),circOut:me([.55,0,1,.45]),backIn:me([.31,.01,.66,-.59]),backOut:me([.33,1.53,.69,.99])};function os(e,t){if(e)return typeof e=="function"?is()?es(e,t):"ease-out":Wn(e)?me(e):Array.isArray(e)?e.map(n=>os(n,t)||sn.easeOut):sn[e]}function Mi(e,t,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const d=os(a,r);Array.isArray(d)&&(u.easing=d);const f={delay:s,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),e.animate(u,f)}function as(e){return typeof e=="function"&&"applyToOptions"in e}function Pi({type:e,...t}){return as(e)&&is()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Ri extends Mt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,ee(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=Pi(t);this.animation=Mi(n,s,r,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=At(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Si(n,s,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return K(Number(t))}get time(){return K(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=L(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Ci()?(this.animation.timeline=t,ue):n(this)}}const cs={anticipate:Kn,backInOut:Nn,circInOut:_n};function Fi(e){return e in cs}function Di(e){typeof e.ease=="string"&&Fi(e.ease)&&(e.ease=cs[e.ease])}const rn=10;class Oi extends Ri{constructor(t){Di(t),ns(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Pt({...o,autoplay:!1}),c=L(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-rn).value,a.sample(c).value,rn),a.stop()}}const on=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(fe.test(e)||e==="0")&&!e.startsWith("url("));function Ii(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ei(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=on(r,t),a=on(i,t);return we(o===a,`You are trying to animate ${t} from "${r}" to "${i}". "${o?i:r}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Ii(e)||(n==="spring"||as(n))&&s}function ct(e){e.duration=0,e.type}const ki=new Set(["opacity","clipPath","filter","transform"]),ji=bt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Bi(e){var u;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=t.owner.getProps();return ji()&&n&&ki.has(n)&&(n!=="transform"||!l)&&!c&&!s&&r!=="mirror"&&i!==0&&o!=="inertia"}const Li=40;class Ni extends Mt{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var g;super(),this.stop=()=>{var b,v;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=j.now();const f={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:i,repeatType:o,name:c,motionValue:l,element:u,...d},h=(u==null?void 0:u.KeyframeResolver)||Rt;this.keyframeResolver=new h(a,(b,v,m)=>this.onKeyframesResolved(b,v,f,!m),c,l,u),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,s,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:c,isHandoff:l,onUpdate:u}=s;this.resolvedAt=j.now(),Ei(t,i,o,a)||((_.instantAnimations||!c)&&(u==null||u(At(t,s,n))),t[0]=t[t.length-1],ct(s),s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Li?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},h=!l&&Bi(f)?new Oi({...f,element:f.motionValue.owner.current}):new Pt(f);h.finished.then(()=>this.notifyFinished()).catch(ue),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Ti()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Ki=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _i(e){const t=Ki.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const $i=4;function us(e,t,n=1){ee(n<=$i,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=_i(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);if(i){const o=i.trim();return Rn(o)?parseFloat(o):o}return Tt(r)?us(r,t,n+1):r}function ls(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const fs=new Set(["width","height","top","left","right","bottom",...de]),Wi={test:e=>e==="auto",parse:e=>e},ds=e=>t=>t.test(e),hs=[le,T,ie,$,Ir,Or,Wi],an=e=>hs.find(ds(e));function Hi(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fn(e):!0}const Gi=new Set(["brightness","contrast","saturate","opacity"]);function qi(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(wt)||[];if(!s)return e;const r=n.replace(s,"");let i=Gi.has(t)?1:0;return s!==n&&(i*=100),t+"("+i+r+")"}const Ui=/\b([a-z-]*)\(.*?\)/gu,ut={...fe,getAnimatableNone:e=>{const t=e.match(Ui);return t?t.map(qi).join(" "):e}},cn={...le,transform:Math.round},zi={rotate:$,rotateX:$,rotateY:$,rotateZ:$,scale:Ae,scaleX:Ae,scaleY:Ae,scaleZ:Ae,skew:$,skewX:$,skewY:$,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:ve,originX:zt,originY:zt,originZ:T},Ft={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,backgroundPositionX:T,backgroundPositionY:T,...zi,zIndex:cn,fillOpacity:ve,strokeOpacity:ve,numOctaves:cn},Yi={...Ft,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:ut,WebkitFilter:ut},ps=e=>Yi[e];function ms(e,t){let n=ps(e);return n!==ut&&(n=fe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Xi=new Set(["auto","none","0"]);function Qi(e,t,n){let s=0,r;for(;s<e.length&&!r;){const i=e[s];typeof i=="string"&&!Xi.has(i)&&xe(i).values.length&&(r=e[s]),s++}if(r&&n)for(const i of t)e[i]=ms(n,r)}class Zi extends Rt{constructor(t,n,s,r,i){super(t,n,s,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),Tt(l))){const u=us(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!fs.has(s)||t.length!==2)return;const[r,i]=t,o=an(r),a=an(i);if(o!==a)if(nn(o)&&nn(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else Y[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||Hi(t[r]))&&s.push(r);s.length&&Qi(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Y[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=Y[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function Ji(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const gs=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function eo(e){return hr(e)&&"offsetHeight"in e}const un=30,to=e=>!isNaN(parseFloat(e));class no{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var i;const r=j.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=j.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=to(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&En(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new On);const s=this.events[t].add(n);return t==="change"?()=>{s(),B.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=j.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>un)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,un);return In(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ie(e,t){return new no(e,t)}const{schedule:so}=Hn(queueMicrotask,!1),ro={y:!1};function io(){return ro.y}function ys(e,t){const n=Ji(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function ln(e){return!(e.pointerType==="touch"||io())}function oo(e,t,n={}){const[s,r,i]=ys(e,n),o=a=>{if(!ln(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=d=>{ln(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,r)};return s.forEach(a=>{a.addEventListener("pointerenter",o,r)}),i}const bs=(e,t)=>t?e===t?!0:bs(e,t.parentElement):!1,ao=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,co=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function uo(e){return co.has(e.tagName)||e.tabIndex!==-1}const Pe=new WeakSet;function fn(e){return t=>{t.key==="Enter"&&e(t)}}function Ge(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const lo=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=fn(()=>{if(Pe.has(n))return;Ge(n,"down");const r=fn(()=>{Ge(n,"up")}),i=()=>Ge(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function dn(e){return ao(e)&&!0}function fo(e,t,n={}){const[s,r,i]=ys(e,n),o=a=>{const c=a.currentTarget;if(!dn(a))return;Pe.add(c);const l=t(c,a),u=(h,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Pe.has(c)&&Pe.delete(c),dn(h)&&typeof l=="function"&&l(h,{success:g})},d=h=>{u(h,c===window||c===document||n.useGlobalTarget||bs(c,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",f,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),eo(a)&&(a.addEventListener("focus",l=>lo(l,r)),!uo(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}const I=e=>!!(e&&e.getVelocity),ho=[...hs,R,fe],po=e=>ho.find(ds(e)),vs=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Dt=p.createContext({strict:!1}),hn={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"]},ae={};for(const e in hn)ae[e]={isEnabled:t=>hn[e].some(n=>!!t[n])};function pn(e){for(const t in e)ae[t]={...ae[t],...e[t]}}function mo({children:e,features:t,strict:n=!1}){const[,s]=p.useState(!qe(t)),r=p.useRef(void 0);if(!qe(t)){const{renderer:i,...o}=t;r.current=i,pn(o)}return p.useEffect(()=>{qe(t)&&t().then(({renderer:i,...o})=>{pn(o),r.current=i,s(!0)})},[]),y.jsx(Dt.Provider,{value:{renderer:r.current,strict:n},children:e})}function qe(e){return typeof e=="function"}const go=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","ignoreStrict","viewport"]);function Ee(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||go.has(e)}let xs=e=>!Ee(e);function yo(e){typeof e=="function"&&(xs=t=>t.startsWith("on")?!Ee(t):e(t))}try{yo(require("@emotion/is-prop-valid").default)}catch{}function bo(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(xs(r)||n===!0&&Ee(r)||!t&&!Ee(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const Le=p.createContext({});function Ne(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Te(e){return typeof e=="string"||Array.isArray(e)}const Ot=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],It=["initial",...Ot];function Ke(e){return Ne(e.animate)||It.some(t=>Te(e[t]))}function Ts(e){return!!(Ke(e)||e.variants)}function vo(e,t){if(Ke(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Te(n)?n:void 0,animate:Te(s)?s:void 0}}return e.inherit!==!1?t:{}}function xo(e){const{initial:t,animate:n}=vo(e,p.useContext(Le));return p.useMemo(()=>({initial:t,animate:n}),[mn(t),mn(n)])}function mn(e){return Array.isArray(e)?e.join(" "):e}const To={};function ws(e,{layout:t,layoutId:n}){return he.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!To[e]||e==="opacity")}const wo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},So=de.length;function Co(e,t,n){let s="",r=!0;for(let i=0;i<So;i++){const o=de[i],a=e[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=gs(a,Ft[o]);if(!c){r=!1;const u=wo[o]||o;s+=`${u}(${l}) `}n&&(t[o]=l)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function Et(e,t,n){const{style:s,vars:r,transformOrigin:i}=e;let o=!1,a=!1;for(const c in t){const l=t[c];if(he.has(c)){o=!0;continue}else if(qn(c)){r[c]=l;continue}else{const u=gs(l,Ft[c]);c.startsWith("origin")?(a=!0,i[c]=u):s[c]=u}}if(t.transform||(o||n?s.transform=Co(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=i;s.transformOrigin=`${c} ${l} ${u}`}}const kt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ss(e,t,n){for(const s in t)!I(t[s])&&!ws(s,n)&&(e[s]=t[s])}function Vo({transformTemplate:e},t){return p.useMemo(()=>{const n=kt();return Et(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ao(e,t){const n=e.style||{},s={};return Ss(s,n,e),Object.assign(s,Vo(e,t)),s}function Mo(e,t){const n={},s=Ao(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const Po={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ro={offset:"strokeDashoffset",array:"strokeDasharray"};function Fo(e,t,n=1,s=0,r=!0){e.pathLength=1;const i=r?Po:Ro;e[i.offset]=T.transform(-s);const o=T.transform(t),a=T.transform(n);e[i.array]=`${o} ${a}`}function Cs(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...a},c,l,u){if(Et(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&Fo(d,r,i,o,!1)}const Vs=()=>({...kt(),attrs:{}}),As=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Do(e,t,n,s){const r=p.useMemo(()=>{const i=Vs();return Cs(i,t,As(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Ss(i,e.style,e),r.style={...i,...r.style}}return r}const Oo=["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 jt(e){return typeof e!="string"||e.includes("-")?!1:!!(Oo.indexOf(e)>-1||/[A-Z]/u.test(e))}function Io(e,t,n,{latestValues:s},r,i=!1){const a=(jt(e)?Do:Mo)(t,s,r,e),c=bo(t,typeof e=="string",i),l=e!==p.Fragment?{...c,...a,ref:n}:{},{children:u}=t,d=p.useMemo(()=>I(u)?u.get():u,[u]);return p.createElement(e,{...l,children:d})}function gn(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Bt(e,t,n,s){if(typeof t=="function"){const[r,i]=gn(s);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=gn(s);t=t(n!==void 0?n:e.custom,r,i)}return t}function Eo(e){return I(e)?e.get():e}function ko({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:jo(n,s,r,e),renderState:t()}}function jo(e,t,n,s){const r={},i=s(e,{});for(const f in i)r[f]=Eo(i[f]);let{initial:o,animate:a}=e;const c=Ke(e),l=Ts(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!Ne(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const g=Bt(e,f[h]);if(g){const{transitionEnd:b,transition:v,...m}=g;for(const w in m){let x=m[w];if(Array.isArray(x)){const A=u?x.length-1:0;x=x[A]}x!==null&&(r[w]=x)}for(const w in b)r[w]=b[w]}}}return r}const Ms=e=>(t,n)=>{const s=p.useContext(Le),r=p.useContext(Pn),i=()=>ko(e,t,s,r);return n?i():ur(i)};function Lt(e,t,n){var i;const{style:s}=e,r={};for(const o in s)(I(s[o])||t.style&&I(t.style[o])||ws(o,e)||((i=n==null?void 0:n.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(r[o]=s[o]);return r}const Bo=Ms({scrapeMotionValuesFromProps:Lt,createRenderState:kt});function Ps(e,t,n){const s=Lt(e,t,n);for(const r in e)if(I(e[r])||I(t[r])){const i=de.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[i]=e[r]}return s}const Lo=Ms({scrapeMotionValuesFromProps:Ps,createRenderState:Vs}),No=Symbol.for("motionComponentSymbol");function Rs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ko(e,t,n){return p.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):Rs(n)&&(n.current=s))},[t])}const Nt=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_o="framerAppearId",Fs="data-"+Nt(_o),$o=p.createContext({});function Wo(e,t,n,s,r){var b,v;const{visualElement:i}=p.useContext(Le),o=p.useContext(Dt),a=p.useContext(Pn),c=p.useContext(vs).reducedMotion,l=p.useRef(null);s=s||o.renderer,!l.current&&s&&(l.current=s(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,d=p.useContext($o);u&&!u.projection&&r&&(u.type==="html"||u.type==="svg")&&Ho(l.current,n,r,d);const f=p.useRef(!1);p.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const h=n[Fs],g=p.useRef(!!h&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,h))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,h)));return lr(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),p.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,h)}),g.current=!1),u.enteringChildren=void 0)}),u}function Ho(e,t,n,s){const{layoutId:r,layout:i,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ds(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||a&&Rs(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:c,layoutRoot:l})}function Ds(e){if(e)return e.options.allowProjection!==!1?e.projection:Ds(e.parent)}function Go(e,{forwardMotionProps:t=!1}={},n,s){const r=jt(e)?Lo:Bo;function i(a,c){let l;const u={...p.useContext(vs),...a,layoutId:qo(a)},{isStatic:d}=u,f=xo(a),h=r(a,d);if(!d&&yt){Uo(u,n);const g=zo(u);l=g.MeasureLayout,f.visualElement=Wo(e,h,u,s,g.ProjectionNode)}return y.jsxs(Le.Provider,{value:f,children:[l&&f.visualElement?y.jsx(l,{visualElement:f.visualElement,...u}):null,Io(e,a,Ko(h,f.visualElement,c),h,d,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=p.forwardRef(i);return o[No]=e,o}function qo({layoutId:e}){const t=p.useContext(cr).id;return t&&e!==void 0?t+"-"+e:e}function Uo(e,t){p.useContext(Dt).strict,process.env.NODE_ENV}function zo(e){const{drag:t,layout:n}=ae;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Yo({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Xo(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Qo(e,t){return Yo(Xo(e.getBoundingClientRect(),t))}const yn=()=>({min:0,max:0}),Os=()=>({x:yn(),y:yn()}),lt={current:null},Is={current:!1};function Zo(){if(Is.current=!0,!!yt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>lt.current=e.matches;e.addEventListener("change",t),t()}else lt.current=!1}const Jo=new WeakMap;function ea(e,t,n){for(const s in t){const r=t[s],i=n[s];if(I(r))e.addValue(s,r);else if(I(i))e.addValue(s,Ie(r,{owner:e}));else if(i!==r)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(s);e.addValue(s,Ie(o!==void 0?o:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const bn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ta{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Rt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=j.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,B.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Ke(n),this.isVariantNode=Ts(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];c[f]!==void 0&&I(h)&&h.set(c[f])}}mount(t){var n;this.current=t,Jo.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,r)=>this.bindToMotionValue(r,s)),Is.current||Zo(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:lt.current,process.env.NODE_ENV!=="production"&&En(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Xe(this.notifyUpdate),Xe(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=he.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&B.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ae){const n=ae[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Os()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<bn.length;s++){const r=bn[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,o=t[i];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=ea(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Ie(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Rn(s)||Fn(s))?s=parseFloat(s):!po(s)&&fe.test(n)&&(s=ms(t,n)),this.setBaseTarget(t,I(s)?s.get():s)),I(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Bt(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!I(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new On),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){so.render(this.render)}}class Es extends ta{constructor(){super(...arguments),this.KeyframeResolver=Zi}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ks(e,{style:t,vars:n},s,r){const i=e.style;let o;for(o in t)i[o]=t[o];r==null||r.applyProjectionStyles(i,s);for(o in n)i.setProperty(o,n[o])}function na(e){return window.getComputedStyle(e)}class sa extends Es{constructor(){super(...arguments),this.type="html",this.renderInstance=ks}readValueFromInstance(t,n){var s;if(he.has(n))return(s=this.projection)!=null&&s.isProjecting?st(n):gi(t,n);{const r=na(t),i=(qn(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Qo(t,n)}build(t,n,s){Et(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Lt(t,n,s)}}const js=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ra(e,t,n,s){ks(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(js.has(r)?r:Nt(r),t.attrs[r])}class ia extends Es{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Os}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(he.has(n)){const s=ps(n);return s&&s.default||0}return n=js.has(n)?n:Nt(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Ps(t,n,s)}build(t,n,s){Cs(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){ra(t,n,s,r)}mount(t){this.isSVGTag=As(t.tagName),super.mount(t)}}const oa=(e,t)=>jt(e)?new ia(t):new sa(t,{allowProjection:e!==p.Fragment});function oe(e,t,n){const s=e.getProps();return Bt(s,t,n!==void 0?n:s.custom,e)}const ft=e=>Array.isArray(e);function aa(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ie(n))}function ca(e){return ft(e)?e[e.length-1]||0:e}function ua(e,t){const n=oe(e,t);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const o in i){const a=ca(i[o]);aa(e,o,a)}}function la(e){return!!(I(e)&&e.add)}function fa(e,t){const n=e.getValue("willChange");if(la(n))return n.add(t);if(!n&&_.WillChange){const s=new _.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function da(e){return e.props[Fs]}const ha=e=>e!==null;function pa(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(ha),i=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[i]}const ma={type:"spring",stiffness:500,damping:25,restSpeed:10},ga=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ya={type:"keyframes",duration:.8},ba={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},va=(e,{keyframes:t})=>t.length>2?ya:he.has(e)?e.startsWith("scale")?ga(t[1]):ma:ba;function xa({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Ta=(e,t,n,s={},r,i)=>o=>{const a=ls(s,e)||{},c=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-L(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:r};xa(a)||Object.assign(u,va(e,u)),u.duration&&(u.duration=L(u.duration)),u.repeatDelay&&(u.repeatDelay=L(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ct(u),u.delay===0&&(d=!0)),(_.instantAnimations||_.skipAnimations)&&(d=!0,ct(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const f=pa(u.keyframes,a);if(f!==void 0){B.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new Pt(u):new Ni(u)};function wa({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Bs(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:o,...a}=t;s&&(i=s);const c=[],l=r&&e.animationState&&e.animationState.getState()[r];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||l&&wa(l,u))continue;const h={delay:n,...ls(i||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===g&&!h.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const m=da(e);if(m){const w=window.MotionHandoffAnimation(m,u,B);w!==null&&(h.startTime=w,b=!0)}}fa(e,u),d.start(Ta(u,d,f,e.shouldReduceMotion&&fs.has(u)?{type:!1}:h,e,b));const v=d.animation;v&&c.push(v)}return o&&Promise.all(c).then(()=>{B.update(()=>{o&&ua(e,o)})}),c}function Ls(e,t,n,s=0,r=1){const i=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*s;return typeof n=="function"?n(i,o):r===1?i*s:a-i*s}function dt(e,t,n={}){var c;const s=oe(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Promise.all(Bs(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=r;return Sa(e,t,l,u,d,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,u]=a==="beforeChildren"?[i,o]:[o,i];return l().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function Sa(e,t,n=0,s=0,r=0,i=1,o){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(dt(c,t,{...o,delay:n+(typeof s=="function"?0:s)+Ls(e.variantChildren,c,s,r,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Ca(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(i=>dt(e,i,n));s=Promise.all(r)}else if(typeof t=="string")s=dt(e,t,n);else{const r=typeof t=="function"?oe(e,t,n.custom):t;s=Promise.all(Bs(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}function Ns(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const Va=It.length;function Ks(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ks(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Va;n++){const s=It[n],r=e.props[s];(Te(r)||r===!1)&&(t[s]=r)}return t}const Aa=[...Ot].reverse(),Ma=Ot.length;function Pa(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Ca(e,n,s)))}function Ra(e){let t=Pa(e),n=vn(),s=!0;const r=c=>(l,u)=>{var f;const d=oe(e,u,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:g,...b}=d;l={...l,...b,...g}}return l};function i(c){t=c(e)}function o(c){const{props:l}=e,u=Ks(e.parent)||{},d=[],f=new Set;let h={},g=1/0;for(let v=0;v<Ma;v++){const m=Aa[v],w=n[m],x=l[m]!==void 0?l[m]:u[m],A=Te(x),S=m===c?w.isActive:null;S===!1&&(g=v);let V=x===u[m]&&x!==l[m]&&A;if(V&&s&&e.manuallyAnimateOnMount&&(V=!1),w.protectedKeys={...h},!w.isActive&&S===null||!x&&!w.prevProp||Ne(x)||typeof x=="boolean")continue;const M=Fa(w.prevProp,x);let C=M||m===c&&w.isActive&&!V&&A||v>g&&A,D=!1;const E=Array.isArray(x)?x:[x];let te=E.reduce(r(m),{});S===!1&&(te={});const{prevResolvedValues:$t={}}=w,zs={...$t,...te},Wt=F=>{C=!0,f.has(F)&&(D=!0,f.delete(F)),w.needsAnimating[F]=!0;const k=e.getValue(F);k&&(k.liveStyle=!1)};for(const F in zs){const k=te[F],G=$t[F];if(h.hasOwnProperty(F))continue;let ne=!1;ft(k)&&ft(G)?ne=!Ns(k,G):ne=k!==G,ne?k!=null?Wt(F):f.add(F):k!==void 0&&f.has(F)?Wt(F):w.protectedKeys[F]=!0}w.prevProp=x,w.prevResolvedValues=te,w.isActive&&(h={...h,...te}),s&&e.blockInitialAnimation&&(C=!1);const Ht=V&&M;C&&(!Ht||D)&&d.push(...E.map(F=>{const k={type:m};if(typeof F=="string"&&s&&!Ht&&e.manuallyAnimateOnMount&&e.parent){const{parent:G}=e,ne=oe(G,F);if(G.enteringChildren&&ne){const{delayChildren:Ys}=ne.transition||{};k.delay=Ls(G.enteringChildren,e,Ys)}}return{animation:F,options:k}}))}if(f.size){const v={};if(typeof l.initial!="boolean"){const m=oe(e,Array.isArray(l.initial)?l.initial[0]:l.initial);m&&m.transition&&(v.transition=m.transition)}f.forEach(m=>{const w=e.getBaseTarget(m),x=e.getValue(m);x&&(x.liveStyle=!0),v[m]=w??null}),d.push({animation:v})}let b=!!d.length;return s&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,b?t(d):Promise.resolve()}function a(c,l){var d;if(n[c].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(c,l)}),n[c].isActive=l;const u=o(c);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=vn(),s=!0}}}function Fa(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ns(t,e):!1}function q(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vn(){return{animate:q(!0),whileInView:q(),whileHover:q(),whileTap:q(),whileDrag:q(),whileFocus:q(),exit:q()}}class pe{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Da extends pe{constructor(t){super(t),t.animationState||(t.animationState=Ra(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Ne(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Oa=0;class Ia extends pe{constructor(){super(...arguments),this.id=Oa++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Ea={animation:{Feature:Da},exit:{Feature:Ia}};function xn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function _s(e){return{point:{x:e.pageX,y:e.pageY}}}function Tn(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=s[r];i&&B.postRender(()=>i(t,_s(t)))}class ka extends pe{mount(){const{current:t}=this.node;t&&(this.unmount=oo(t,(n,s)=>(Tn(this.node,s,"Start"),r=>Tn(this.node,r,"End"))))}unmount(){}}class ja extends pe{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=je(xn(this.node.current,"focus",()=>this.onFocus()),xn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function wn(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=s[r];i&&B.postRender(()=>i(t,_s(t)))}class Ba extends pe{mount(){const{current:t}=this.node;t&&(this.unmount=fo(t,(n,s)=>(wn(this.node,s,"Start"),(r,{success:i})=>wn(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ht=new WeakMap,Ue=new WeakMap,La=e=>{const t=ht.get(e.target);t&&t(e)},Na=e=>{e.forEach(La)};function Ka({root:e,...t}){const n=e||document;Ue.has(n)||Ue.set(n,{});const s=Ue.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(Na,{root:e,...t})),s[r]}function _a(e,t,n){const s=Ka(t);return ht.set(e,n),s.observe(e),()=>{ht.delete(e),s.unobserve(e)}}const $a={some:0,all:1};class Wa extends pe{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:$a[r]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return _a(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Ha(t,n))&&this.startObserver()}unmount(){}}function Ha({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Ga={inView:{Feature:Wa},tap:{Feature:Ba},focus:{Feature:ja},hover:{Feature:ka}},qa={renderer:oa,...Ea,...Ga};function $s(e,t){return Go(e,t)}const Ua=$s("div"),Kt=$s("span"),za=({icon:e=Q.ChevronsUpDown,"aria-hidden":t=!0,...n})=>{const s=p.useContext(O);return y.jsx(ce.Button.Icon,{as:Kt,animate:{rotate:s.open?180:0},transition:{duration:.15,type:"spring",bounce:0},icon:e,"aria-hidden":t,...n})},Ya=({tooltipProps:e,...t})=>{const n=p.useContext(O),s=()=>{var i,o;if(N(n.value)){const a=n.onValueChange;a==null||a([])}if(Z(n.value)){const a=n.onValueChange;a==null||a(void 0)}(o=(i=n.triggerRef)==null?void 0:i.current)==null||o.focus()};return p.useMemo(()=>{var i;if(Z(n.value))return n.clearable&&n.value;if(N(n.value))return n.clearable&&((i=n.value)==null?void 0:i.length)>0},[n.clearable,n.value])?y.jsx(nr.Tooltip,{label:"Clear field",...e,children:y.jsx(ce.Button,{type:"button",icon:{icon:Q.X,alt:"Clear field"},size:"0",variant:"ghost",onClick:i=>{n.value&&(i.stopPropagation(),s())},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),i.preventDefault(),s())},"data-tgph-combobox-clear":!0,style:{marginTop:"calc(-1 * var(--tgph-spacing-1)",marginBottom:"calc(-1 * var(--tgph-spacing-1)"},...t})}):null},Ws=({children:e,...t})=>{const n=p.useContext(O),s=p.useMemo(()=>{var a;if(!Z(n.value))return;const r=ze(n.value,n.options,n.legacyBehavior),i=(r==null?void 0:r.label)||(r==null?void 0:r.value)||n.placeholder,o=n.legacyBehavior&&((a=n==null?void 0:n.value)==null?void 0:a.label);return o||i},[n.value,n.options,n.legacyBehavior,n.placeholder]);return y.jsx(Vn.TooltipIfTruncated,{children:y.jsx(ce.Button.Text,{color:n.value?"default":"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||s})})},pt=({children:e,...t})=>{const n=p.useContext(O);return y.jsx(Vn.TooltipIfTruncated,{children:y.jsx(ce.Button.Text,{color:"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||n.placeholder})})},Hs=({children:e})=>{const t=p.useContext(O);if(!N(t.value))return null;const n=t.layout||"truncate",r=(t.value.length-2).toString().split("");return y.jsxs(W.Stack,{gap:"0_5",w:"full",wrap:n==="wrap"?"wrap":"nowrap",align:"center",style:{position:"relative",flexGrow:1},children:[e,n==="truncate"&&t.value.length>2&&y.jsx(W.Stack,{as:Ua,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},h:"full",pr:"1",pl:"8",align:"center","aria-label":`${t.value.length-2} more selected`,position:"absolute",right:"0",style:{backgroundImage:"linear-gradient(to left, var(--tgph-surface-1) 0 60%, transparent 90% 100%)"},children:y.jsxs(mt.Text,{as:"span",size:"1",style:{whiteSpace:"nowrap"},children:["+",r.map(i=>y.jsx(W.Box,{as:Kt,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},w:"2",display:"inline-block",children:i},i))," ","more"]})})]})},_t=p.createContext({value:""}),Xa=({value:e,children:t,...n})=>y.jsx(_t.Provider,{value:{value:e},children:y.jsx(gt.Tag.Root,{as:Kt,initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.1,type:"spring",bounce:0},size:"1",maxH:"5",rounded:"1",layout:"position",...n,children:t})}),Qa=({children:e,...t})=>{const n=p.useContext(O),s=p.useContext(_t),r=p.useMemo(()=>{const i=n.options.find(c=>c.value===s.value);if(i)return i.label||i.value;if(!n.value)return;const a=n.value.find(c=>H(c,n.legacyBehavior)===s.value);if(a)return a},[n.options,n.value,s.value,n.legacyBehavior]);return y.jsx(gt.Tag.Text,{...t,children:e||r})},Za=({children:e,...t})=>{const n=p.useContext(O),s=p.useContext(_t);return y.jsx(gt.Tag.Button,{icon:{icon:Q.X,alt:`Remove ${s.value}`},height:"full",onClick:r=>{if(!n.onValueChange)return;const i=n.onValueChange,a=n.value.filter(c=>H(c,n.legacyBehavior)!==s.value);i==null||i(a),r.stopPropagation(),r.preventDefault()},"data-tgph-combobox-tag-button":!0,...t,children:e})},Ja=({value:e,children:t,...n})=>y.jsxs(be.Root,{value:e,...n,children:[y.jsx(be.Text,{children:t}),y.jsx(be.Button,{})]}),ec=e=>y.jsx(W.Stack,{align:"center",gap:"1",...e}),tc=()=>{const e=p.useContext(O);if(e.value&&N(e.value)){const t=e.layout||"truncate";return e.value.length===0?y.jsx(pt,{}):y.jsx(mo,{features:qa,children:y.jsx(Hs,{children:e.value.map((n,s)=>{const r=H(n,e.legacyBehavior);if(r&&(t==="truncate"&&s<=1||t==="wrap"))return y.jsx(tr.RefToTgphRef,{children:y.jsx(be.Default,{value:r})},r)})})})}if(e&&Z(e.value))return e.value?y.jsx(Ws,{}):y.jsx(pt,{})},be={Root:Xa,Text:Qa,Button:Za,Default:Ja},ge={TriggerIndicator:za,TriggerClear:Ya,TriggerText:Ws,TriggerPlaceholder:pt,TriggerTagsContainer:Hs,TriggerActionsContainer:ec,TriggerTag:be,TriggerValue:tc},nc=["ArrowDown","PageUp","Home"],sc=["ArrowUp","PageDown","End"],Gs=["Enter"," "],O=p.createContext({value:void 0,onValueChange:()=>{},contentId:"",triggerId:"",open:!1,setOpen:()=>{},onOpenToggle:()=>{},clearable:!1,disabled:!1,options:[],legacyBehavior:!1}),rc=({modal:e=!0,closeOnSelect:t=!0,clearable:n=!1,disabled:s=!1,legacyBehavior:r=!1,open:i,onOpenChange:o,defaultOpen:a,value:c,onValueChange:l,errored:u,placeholder:d,layout:f,children:h,...g})=>{const b=p.useId(),v=p.useId(),m=p.useRef(null),w=p.useRef(null),x=p.useRef(null),A=p.useMemo(()=>or(h),[h]),[S,V]=p.useState(""),[M=!1,C]=Zs.useControllableState({prop:i,defaultProp:a??!1,onChange:o}),D=p.useCallback(()=>{C(E=>!E)},[C]);return p.useEffect(()=>{M||V("")},[M]),y.jsx(O.Provider,{value:{contentId:b,triggerId:v,value:c,onValueChange:l,placeholder:d,open:M,setOpen:C,onOpenToggle:D,closeOnSelect:t,clearable:n,disabled:s,searchQuery:S,setSearchQuery:V,triggerRef:m,searchRef:w,contentRef:x,errored:u,layout:f,options:A,legacyBehavior:r},children:y.jsx(ke.Menu.Root,{open:M,onOpenChange:C,modal:e,...g,children:h})})},ic=({size:e="1",children:t,...n})=>{const s=p.useContext(O),r=N(s.value)&&s.value.length>0,i=p.useMemo(()=>{if(s.value){if(Z(s.value))return ze(s.value,s.options,s.legacyBehavior);if(N(s.value))return s.value.map(a=>ze(a,s.options,s.legacyBehavior))}},[s.value,s.options,s.legacyBehavior]),o=p.useCallback(()=>i?Z(i)?(i==null?void 0:i.label)||(i==null?void 0:i.value)||s.placeholder:N(i)&&i.map(a=>(a==null?void 0:a.label)||(a==null?void 0:a.value)).join(", ")||s.placeholder:s.placeholder,[i,s.placeholder]);return y.jsx(ke.Menu.Trigger,{...n,asChild:!0,onClick:a=>{var c,l;a.preventDefault(),s.onOpenToggle(),(l=(c=s.triggerRef)==null?void 0:c.current)==null||l.focus()},onKeyDown:a=>{var c;if(a.target===((c=s.triggerRef)==null?void 0:c.current)){if(a.key==="Tab"){a.stopPropagation();return}if(a.key==="ArrowDown"||Gs.includes(a.key)){a.stopPropagation(),a.preventDefault(),s.onOpenToggle();return}}},tgphRef:s.triggerRef,children:y.jsx(ce.Button.Root,{id:s.triggerId,type:"button",bg:"surface-1",variant:"outline",align:"center",minH:ir[e],h:"full",w:"full",py:"0_5",pr:"1_5",pl:r?"0_5":"1_5",size:e,color:s.errored?"red":"gray",justify:"space-between",role:"combobox","aria-label":o(),"aria-controls":s.contentId,"aria-expanded":s.open,"aria-haspopup":"listbox","data-tgph-combobox-trigger":!0,"data-tgph-combobox-trigger-open":s.open,disabled:s.disabled,...n,children:t?typeof t=="function"?t({value:i}):t:y.jsxs(y.Fragment,{children:[y.jsx(ge.TriggerValue,{}),y.jsxs(ge.TriggerActionsContainer,{children:[y.jsx(ge.TriggerClear,{}),y.jsx(ge.TriggerIndicator,{})]})]})})})},oc=({style:e,children:t,tgphRef:n,...s})=>{const r=p.useContext(O),i=p.useRef(!1),o=Sn.useComposedRefs(n,r.contentRef),a=p.useRef(null),[c,l]=p.useState(0),[u,d]=p.useState(!1),f=p.useCallback(h=>{const g=h==null?void 0:h.getBoundingClientRect();g&&l(g.height),u||d(!0)},[u]);return p.useEffect(()=>{const h=new ResizeObserver(g=>{for(const b of g){const v=b.target;f(v)}});return a.current&&u&&h.observe(a.current),()=>h.disconnect()},[u,f]),p.useEffect(()=>{u===!0&&r.open===!1&&d(!1)},[r.open,u]),p.useEffect(()=>{let h;return r.open&&(h=setTimeout(()=>{f(a.current)},10)),()=>h&&clearTimeout(h)},[r.open,f]),y.jsx(sr.Root,{asChild:!0,children:y.jsx(Xs.DismissableLayer,{onEscapeKeyDown:h=>{r.open&&(h.stopPropagation(),h.preventDefault(),r.setOpen(!1))},children:y.jsx(ke.Menu.Content,{className:"tgph",mt:"1",onCloseAutoFocus:h=>{var g,b;i.current||(b=(g=r.triggerRef)==null?void 0:g.current)==null||b.focus(),i.current=!1,h.preventDefault()},bg:"surface-1",style:{width:"var(--tgph-combobox-trigger-width)",transition:"min-height 200ms ease-in-out",minHeight:c?`${c}px`:"0",...e,"--tgph-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--tgph-combobox-content-available-width":"var(--radix-popper-available-width)","--tgph-combobox-content-available-height":"calc(var(--radix-popper-available-height) - var(--tgph-spacing-8))","--tgph-combobox-trigger-width":"var(--radix-popper-anchor-width)","--tgph-combobox-trigger-height":"var(--radix-popper-anchor-height)"},...s,tgphRef:o,"data-tgph-combobox-content":!0,"data-tgph-combobox-content-open":r.open,role:void 0,"aria-orientation":void 0,onKeyDown:h=>{var b,v,m,w;h.stopPropagation();const g=(v=(b=r.contentRef)==null?void 0:b.current)==null?void 0:v.querySelectorAll("[data-tgph-combobox-option]");document.activeElement===(g==null?void 0:g[0])&&sc.includes(h.key)&&((w=(m=r.searchRef)==null?void 0:m.current)==null||w.focus())},children:y.jsx(W.Stack,{direction:"column",gap:"1",tgphRef:a,children:t})})})})},ac=({...e})=>{const t=p.useContext(O);return y.jsx(W.Stack,{id:t.contentId,direction:"column",gap:"1",style:{overflowY:"auto","--max-height":e.maxHeight?void 0:"calc(var(--tgph-combobox-content-available-height) - var(--tgph-spacing-12))"},role:"listbox",...e})},qs=({value:e,label:t,selected:n,onSelect:s,children:r,...i})=>{const o=p.useContext(O),[a,c]=p.useState(!1),l=o.value,u=!o.searchQuery||ar({children:t||r,value:e,searchQuery:o.searchQuery}),d=N(l)?l.some(h=>H(h,o.legacyBehavior)===e):H(l,o.legacyBehavior)===e,f=h=>{var b,v;h.stopPropagation();const g=h;if(!(g.key&&!Gs.includes(g.key))){if(h.preventDefault(),o.closeOnSelect===!0&&o.setOpen(!1),s)return s(h);if(Z(l)){const m=o.onValueChange;o.legacyBehavior===!0?m==null||m({value:e,label:t}):m==null||m(e)}else if(N(l)){const m=o.onValueChange,w=o.value,x=d?w.filter(A=>H(A,o.legacyBehavior)!==e):[...w,o.legacyBehavior===!0?{value:e,label:t}:e];m==null||m(x)}(v=(b=o.triggerRef)==null?void 0:b.current)==null||v.focus()}};if(u)return y.jsx(ke.Menu.Button,{type:"button",onSelect:f,onKeyDown:f,selected:n===null?null:n??d,onFocus:()=>c(!0),onBlur:()=>c(!1),role:"option","aria-selected":d?"true":"false","data-tgph-combobox-option":!0,"data-tgph-combobox-option-focused":a,"data-tgph-combobox-option-value":e,"data-tgph-combobox-option-label":t,...i,children:t||r||e})},cc=({label:e="Search",placeholder:t="Search",tgphRef:n,value:s,onValueChange:r,...i})=>{var d;const o=p.useId(),a=p.useContext(O),c=Sn.useComposedRefs(n,a.searchRef),l=s??a.searchQuery,u=r??a.setSearchQuery;return p.useEffect(()=>{var g;const f=b=>{var v,m;nc.includes(b.key)&&((m=(v=a.contentRef)==null?void 0:v.current)==null||m.focus({preventScroll:!0})),b.key==="Escape"&&a.setOpen(!1),b.stopPropagation()},h=(g=a.searchRef)==null?void 0:g.current;if(h)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f)}},[a]),y.jsxs(W.Box,{borderBottom:"px",px:"1",pb:"1",children:[y.jsx(rr.Root,{children:y.jsx(mt.Text,{as:"label",htmlFor:o,children:e})}),y.jsx(er.Input,{id:o,variant:"ghost",placeholder:t,value:l,onChange:f=>{u(f.target.value)},LeadingComponent:y.jsx(Cn.Icon,{icon:Q.Search,alt:"Search Icon"}),TrailingComponent:a!=null&&a.searchQuery&&((d=a==null?void 0:a.searchQuery)==null?void 0:d.length)>0?y.jsx(ce.Button,{variant:"ghost",color:"gray",icon:{icon:Q.X,alt:"Clear Search Query"},onClick:()=>{var f;return(f=a.setSearchQuery)==null?void 0:f.call(a,"")}}):null,autoFocus:!0,"data-tgph-combobox-search":!0,"aria-controls":a.contentId,...i,tgphRef:c})]})},uc=({icon:e={icon:Q.Search,alt:"Search Icon"},message:t="No results found",children:n,...s})=>{const r=p.useContext(O),[i,o]=p.useState(!1);if(p.useEffect(()=>{var c,l;const a=(l=(c=r.contentRef)==null?void 0:c.current)==null?void 0:l.querySelectorAll("[data-tgph-combobox-option]");(a==null?void 0:a.length)===0?o(!0):o(!1)},[r.searchQuery,r.contentRef,n]),i)return y.jsxs(W.Stack,{gap:"1",align:"center",justify:"center",w:"full",my:"8","data-tgph-combobox-empty":!0,...s,children:[e===null?y.jsx(y.Fragment,{}):y.jsx(Cn.Icon,{...e}),t===null?y.jsx(y.Fragment,{}):y.jsx(mt.Text,{as:"span",children:t})]})},lc=({leadingText:e="Create",values:t,onCreate:n,selected:s=null,legacyBehavior:r=!1,...i})=>{const o=p.useContext(O),a=p.useCallback(c=>!t||(t==null?void 0:t.length)===0?!1:t.some(l=>H(l,r)===c),[t,r]);if(o.searchQuery&&!a(o.searchQuery))return y.jsx(qs,{leadingIcon:{icon:Q.Plus,"aria-hidden":!0},mx:"1",value:o.searchQuery,label:`${e} "${o.searchQuery}"`,selected:s,onSelect:()=>{var c;if(n&&o.searchQuery){const l=r===!0?{value:o.searchQuery}:o.searchQuery;n(l),(c=o.setSearchQuery)==null||c.call(o,"")}},...i})},Us={};Object.assign(Us,{Root:rc,Trigger:ic,Content:oc,Options:ac,Option:qs,Search:cc,Empty:uc,Create:lc,Primitives:ge});exports.Combobox=Us;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),Qs=require("@radix-ui/react-dismissable-layer"),Zs=require("@radix-ui/react-portal"),Ut=require("@radix-ui/react-use-controllable-state"),Js=require("@radix-ui/react-visually-hidden"),ce=require("@telegraph/button"),bt=require("@telegraph/compose-refs"),An=require("@telegraph/icon"),er=require("@telegraph/input"),q=require("@telegraph/layout"),Be=require("@telegraph/menu"),vt=require("@telegraph/typography"),J=require("lucide-react"),p=require("react"),tr=require("@telegraph/helpers"),xt=require("@telegraph/tag"),nr=require("@telegraph/tooltip"),Mn=require("@telegraph/truncate");function Pn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const sr=Pn(Zs),rr=Pn(Js),ir={0:"5",1:"6",2:"8",3:"10"},L=e=>Array.isArray(e),G=e=>typeof e=="object"&&!Array.isArray(e)||typeof e=="string"||!e,or=e=>{const t=(r,i=[])=>(p.Children.toArray(r).forEach(a=>{if(p.isValidElement(a)){const c=a.props;c.value?i.push(a):c.children&&t(c.children,i)}}),i);return t(e).map(r=>{var o;const i=r;return{value:i.props.value,label:((o=i.props)==null?void 0:o.label)||i.props.children||i.props.value}})},N=(e,t)=>{if(e)return t===!0?e==null?void 0:e.value:e},Qe=(e,t,n)=>{if(!e||!t||t.length===0)return;const s=t.find(r=>r.value===N(e,n));if(s)return s},ar=({children:e,value:t,searchQuery:n})=>{const s=Rn(e);return(t==null?void 0:t.toLowerCase().includes(n.toLowerCase()))||s.some(r=>r.toLowerCase().includes(n.toLowerCase()))},Rn=e=>{const t=p.Children.toArray(e),n=[];return t.forEach(s=>{if(typeof s=="string"&&n.push(s),p.isValidElement(s)){const r=s.props;r.children&&n.push(...Rn(r.children))}}),n},cr=p.createContext({});function ur(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const Tt=typeof window<"u",lr=Tt?p.useLayoutEffect:p.useEffect,Fn=p.createContext(null);function fr(e,t){e.indexOf(t)===-1&&e.push(t)}function dr(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ee=(e,t,n)=>n>t?t:n<e?e:n;function Ze(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let we=()=>{},te=()=>{};process.env.NODE_ENV!=="production"&&(we=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Ze(t,n))},te=(e,t,n)=>{if(!e)throw new Error(Ze(t,n))});const $={},Dn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function hr(e){return typeof e=="object"&&e!==null}const On=e=>/^0[^.\s]+$/u.test(e);function wt(e){let t;return()=>(t===void 0&&(t=e()),t)}const ue=e=>e,pr=(e,t)=>n=>t(e(n)),Le=(...e)=>e.reduce(pr),In=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class En{constructor(){this.subscriptions=[]}add(t){return fr(this.subscriptions,t),()=>dr(this.subscriptions,t)}notify(t,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,s);else for(let i=0;i<r;i++){const o=this.subscriptions[i];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const K=e=>e*1e3,_=e=>e/1e3;function kn(e,t){return t?e*(1e3/t):0}const zt=new Set;function jn(e,t,n){e||zt.has(t)||(console.warn(Ze(t,n)),zt.add(t))}const Bn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,mr=1e-7,gr=12;function yr(e,t,n,s,r){let i,o,a=0;do o=t+(n-t)/2,i=Bn(o,s,r)-e,i>0?n=o:t=o;while(Math.abs(i)>mr&&++a<gr);return o}function Se(e,t,n,s){if(e===t&&n===s)return ue;const r=i=>yr(i,0,1,e,n);return i=>i===0||i===1?i:Bn(r(i),t,s)}const Ln=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Nn=e=>t=>1-e(1-t),Kn=Se(.33,1.53,.69,.99),St=Nn(Kn),_n=Ln(St),$n=e=>(e*=2)<1?.5*St(e):.5*(2-Math.pow(2,-10*(e-1))),Vt=e=>1-Math.sin(Math.acos(e)),br=Nn(Vt),Wn=Ln(Vt),vr=Se(.42,0,1,1),xr=Se(0,0,.58,1),Hn=Se(.42,0,.58,1),Tr=e=>Array.isArray(e)&&typeof e[0]!="number",qn=e=>Array.isArray(e)&&typeof e[0]=="number",Yt={linear:ue,easeIn:vr,easeInOut:Hn,easeOut:xr,circIn:Vt,circInOut:Wn,circOut:br,backIn:St,backInOut:_n,backOut:Kn,anticipate:$n},wr=e=>typeof e=="string",Xt=e=>{if(qn(e)){te(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,r]=e;return Se(t,n,s,r)}else if(wr(e))return te(Yt[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Yt[e];return e},Me=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Sr(e,t){let n=new Set,s=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){o.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,d=!1,f=!1)=>{const g=f&&r?n:s;return d&&o.add(u),g.has(u)||g.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,r){i=!0;return}r=!0,[n,s]=[s,n],n.forEach(c),n.clear(),r=!1,i&&(i=!1,l.process(u))}};return l}const Vr=40;function Gn(e,t){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Me.reduce((x,C)=>(x[C]=Sr(i),x),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:h,postRender:g}=o,y=()=>{const x=$.useManualTiming?r.timestamp:performance.now();n=!1,$.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(x-r.timestamp,Vr),1)),r.timestamp=x,r.isProcessing=!0,a.process(r),c.process(r),l.process(r),u.process(r),d.process(r),f.process(r),h.process(r),g.process(r),r.isProcessing=!1,n&&t&&(s=!1,e(y))},v=()=>{n=!0,s=!0,r.isProcessing||e(y)};return{schedule:Me.reduce((x,C)=>{const S=o[C];return x[C]=(A,P=!1,V=!1)=>(n||v(),S.schedule(A,P,V)),x},{}),cancel:x=>{for(let C=0;C<Me.length;C++)o[Me[C]].cancel(x)},state:r,steps:o}}const{schedule:B,cancel:Je,state:De}=Gn(typeof requestAnimationFrame<"u"?requestAnimationFrame:ue,!0);let Re;function Cr(){Re=void 0}const j={now:()=>(Re===void 0&&j.set(De.isProcessing||$.useManualTiming?De.timestamp:performance.now()),Re),set:e=>{Re=e,queueMicrotask(Cr)}},Un=e=>t=>typeof t=="string"&&t.startsWith(e),zn=Un("--"),Ar=Un("var(--"),Ct=e=>Ar(e)?Mr.test(e.split("/*")[0].trim()):!1,Mr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,le={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ve={...le,transform:e=>ee(0,1,e)},Pe={...le,default:1},ye=e=>Math.round(e*1e5)/1e5,At=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pr(e){return e==null}const Rr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Mt=(e,t)=>n=>!!(typeof n=="string"&&Rr.test(n)&&n.startsWith(e)||t&&!Pr(n)&&Object.prototype.hasOwnProperty.call(n,t)),Yn=(e,t,n)=>s=>{if(typeof s!="string")return s;const[r,i,o,a]=s.match(At);return{[e]:parseFloat(r),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Fr=e=>ee(0,255,e),He={...le,transform:e=>Math.round(Fr(e))},Y={test:Mt("rgb","red"),parse:Yn("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+He.transform(e)+", "+He.transform(t)+", "+He.transform(n)+", "+ye(ve.transform(s))+")"};function Dr(e){let t="",n="",s="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,s+=s,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const et={test:Mt("#"),parse:Dr,transform:Y.transform},Ve=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),H=Ve("deg"),ie=Ve("%"),T=Ve("px"),Or=Ve("vh"),Ir=Ve("vw"),Qt={...ie,parse:e=>ie.parse(e)/100,transform:e=>ie.transform(e*100)},se={test:Mt("hsl","hue"),parse:Yn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+ie.transform(ye(t))+", "+ie.transform(ye(n))+", "+ye(ve.transform(s))+")"},R={test:e=>Y.test(e)||et.test(e)||se.test(e),parse:e=>Y.test(e)?Y.parse(e):se.test(e)?se.parse(e):et.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Y.transform(e):se.transform(e),getAnimatableNone:e=>{const t=R.parse(e);return t.alpha=0,R.transform(t)}},Er=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function kr(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(At))==null?void 0:t.length)||0)+(((n=e.match(Er))==null?void 0:n.length)||0)>0}const Xn="number",Qn="color",jr="var",Br="var(",Zt="${}",Lr=/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 xe(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const a=t.replace(Lr,c=>(R.test(c)?(s.color.push(i),r.push(Qn),n.push(R.parse(c))):c.startsWith(Br)?(s.var.push(i),r.push(jr),n.push(c)):(s.number.push(i),r.push(Xn),n.push(parseFloat(c))),++i,Zt)).split(Zt);return{values:n,split:a,indexes:s,types:r}}function Zn(e){return xe(e).values}function Jn(e){const{split:t,types:n}=xe(e),s=t.length;return r=>{let i="";for(let o=0;o<s;o++)if(i+=t[o],r[o]!==void 0){const a=n[o];a===Xn?i+=ye(r[o]):a===Qn?i+=R.transform(r[o]):i+=r[o]}return i}}const Nr=e=>typeof e=="number"?0:R.test(e)?R.getAnimatableNone(e):e;function Kr(e){const t=Zn(e);return Jn(e)(t.map(Nr))}const fe={test:kr,parse:Zn,createTransformer:Jn,getAnimatableNone:Kr};function qe(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _r({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let r=0,i=0,o=0;if(!t)r=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=qe(c,a,e+1/3),i=qe(c,a,e),o=qe(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:s}}function Oe(e,t){return n=>n>0?t:e}const Ne=(e,t,n)=>e+(t-e)*n,Ge=(e,t,n)=>{const s=e*e,r=n*(t*t-s)+s;return r<0?0:Math.sqrt(r)},$r=[et,Y,se],Wr=e=>$r.find(t=>t.test(e));function Jt(e){const t=Wr(e);if(we(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===se&&(n=_r(n)),n}const en=(e,t)=>{const n=Jt(e),s=Jt(t);if(!n||!s)return Oe(e,t);const r={...n};return i=>(r.red=Ge(n.red,s.red,i),r.green=Ge(n.green,s.green,i),r.blue=Ge(n.blue,s.blue,i),r.alpha=Ne(n.alpha,s.alpha,i),Y.transform(r))},tt=new Set(["none","hidden"]);function Hr(e,t){return tt.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qr(e,t){return n=>Ne(e,t,n)}function Pt(e){return typeof e=="number"?qr:typeof e=="string"?Ct(e)?Oe:R.test(e)?en:zr:Array.isArray(e)?es:typeof e=="object"?R.test(e)?en:Gr:Oe}function es(e,t){const n=[...e],s=n.length,r=e.map((i,o)=>Pt(i)(i,t[o]));return i=>{for(let o=0;o<s;o++)n[o]=r[o](i);return n}}function Gr(e,t){const n={...e,...t},s={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(s[r]=Pt(e[r])(e[r],t[r]));return r=>{for(const i in s)n[i]=s[i](r);return n}}function Ur(e,t){const n=[],s={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const i=t.types[r],o=e.indexes[i][s[i]],a=e.values[o]??0;n[r]=a,s[i]++}return n}const zr=(e,t)=>{const n=fe.createTransformer(t),s=xe(e),r=xe(t);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?tt.has(e)&&!r.values.length||tt.has(t)&&!s.values.length?Hr(e,t):Le(es(Ur(s,r),r.values),n):(we(!0,`Complex values '${e}' and '${t}' 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"),Oe(e,t))};function ts(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ne(e,t,n):Pt(e)(e,t)}const Yr=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>B.update(t,n),stop:()=>Je(t),now:()=>De.isProcessing?De.timestamp:j.now()}},ns=(e,t,n=10)=>{let s="";const r=Math.max(Math.round(t/n),2);for(let i=0;i<r;i++)s+=Math.round(e(i/(r-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Ie=2e4;function Rt(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Ie;)t+=n,s=e.next(t);return t>=Ie?1/0:t}function Xr(e,t=100,n){const s=n({...e,keyframes:[0,t]}),r=Math.min(Rt(s),Ie);return{type:"keyframes",ease:i=>s.next(r*i).value/t,duration:_(r)}}const Qr=5;function ss(e,t,n){const s=Math.max(t-Qr,0);return kn(n-e(s),t-s)}const M={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},Ue=.001;function Zr({duration:e=M.duration,bounce:t=M.bounce,velocity:n=M.velocity,mass:s=M.mass}){let r,i;we(e<=K(M.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=ee(M.minDamping,M.maxDamping,o),e=ee(M.minDuration,M.maxDuration,_(e)),o<1?(r=l=>{const u=l*o,d=u*e,f=u-n,h=nt(l,o),g=Math.exp(-d);return Ue-f/h*g},i=l=>{const d=l*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(l,2)*e,g=Math.exp(-d),y=nt(Math.pow(l,2),o);return(-r(l)+Ue>0?-1:1)*((f-h)*g)/y}):(r=l=>{const u=Math.exp(-l*e),d=(l-n)*e+1;return-Ue+u*d},i=l=>{const u=Math.exp(-l*e),d=(n-l)*(e*e);return u*d});const a=5/e,c=ei(r,i,a);if(e=K(e),isNaN(c))return{stiffness:M.stiffness,damping:M.damping,duration:e};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:o*2*Math.sqrt(s*l),duration:e}}}const Jr=12;function ei(e,t,n){let s=n;for(let r=1;r<Jr;r++)s=s-e(s)/t(s);return s}function nt(e,t){return e*Math.sqrt(1-t*t)}const ti=["duration","bounce"],ni=["stiffness","damping","mass"];function tn(e,t){return t.some(n=>e[n]!==void 0)}function si(e){let t={velocity:M.velocity,stiffness:M.stiffness,damping:M.damping,mass:M.mass,isResolvedFromDuration:!1,...e};if(!tn(e,ni)&&tn(e,ti))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,i=2*ee(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:M.mass,stiffness:r,damping:i}}else{const n=Zr(e);t={...t,...n,mass:M.mass},t.isResolvedFromDuration=!0}return t}function Ee(e=M.visualDuration,t=M.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:h}=si({...n,velocity:-_(n.velocity||0)}),g=f||0,y=l/(2*Math.sqrt(c*u)),v=o-i,m=_(Math.sqrt(c/u)),w=Math.abs(v)<5;s||(s=w?M.restSpeed.granular:M.restSpeed.default),r||(r=w?M.restDelta.granular:M.restDelta.default);let x;if(y<1){const S=nt(m,y);x=A=>{const P=Math.exp(-y*m*A);return o-P*((g+y*m*v)/S*Math.sin(S*A)+v*Math.cos(S*A))}}else if(y===1)x=S=>o-Math.exp(-m*S)*(v+(g+m*v)*S);else{const S=m*Math.sqrt(y*y-1);x=A=>{const P=Math.exp(-y*m*A),V=Math.min(S*A,300);return o-P*((g+y*m*v)*Math.sinh(V)+S*v*Math.cosh(V))/S}}const C={calculatedDuration:h&&d||null,next:S=>{const A=x(S);if(h)a.done=S>=d;else{let P=S===0?g:0;y<1&&(P=S===0?K(g):ss(x,S,A));const V=Math.abs(P)<=s,F=Math.abs(o-A)<=r;a.done=V&&F}return a.value=a.done?o:A,a},toString:()=>{const S=Math.min(Rt(C),Ie),A=ns(P=>C.next(S*P).value,S,30);return S+"ms "+A},toTransition:()=>{}};return C}Ee.applyToOptions=e=>{const t=Xr(e,100,Ee);return e.ease=t.ease,e.duration=K(t.duration),e.type="keyframes",e};function st({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:c,restDelta:l=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},h=V=>a!==void 0&&V<a||c!==void 0&&V>c,g=V=>a===void 0?c:c===void 0||Math.abs(a-V)<Math.abs(c-V)?a:c;let y=n*t;const v=d+y,m=o===void 0?v:o(v);m!==v&&(y=m-d);const w=V=>-y*Math.exp(-V/s),x=V=>m+w(V),C=V=>{const F=w(V),D=x(V);f.done=Math.abs(F)<=l,f.value=f.done?m:D};let S,A;const P=V=>{h(f.value)&&(S=V,A=Ee({keyframes:[f.value,g(f.value)],velocity:ss(x,V,f.value),damping:r,stiffness:i,restDelta:l,restSpeed:u}))};return P(0),{calculatedDuration:null,next:V=>{let F=!1;return!A&&S===void 0&&(F=!0,C(V),P(V)),S!==void 0&&V>=S?A.next(V-S):(!F&&C(V),f)}}}function ri(e,t,n){const s=[],r=n||$.mix||ts,i=e.length-1;for(let o=0;o<i;o++){let a=r(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||ue:t;a=Le(c,a)}s.push(a)}return s}function ii(e,t,{clamp:n=!0,ease:s,mixer:r}={}){const i=e.length;if(te(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=ri(t,s,r),c=a.length,l=u=>{if(o&&u<e[0])return t[0];let d=0;if(c>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=In(e[d],e[d+1],u);return a[d](f)};return n?u=>l(ee(e[0],e[i-1],u)):l}function oi(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const r=In(0,t,s);e.push(Ne(n,1,r))}}function ai(e){const t=[0];return oi(t,e.length-1),t}function ci(e,t){return e.map(n=>n*t)}function ui(e,t){return e.map(()=>t||Hn).splice(0,e.length-1)}function re({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const r=Tr(s)?s.map(Xt):Xt(s),i={done:!1,value:t[0]},o=ci(n&&n.length===t.length?n:ai(t),e),a=ii(o,t,{ease:Array.isArray(r)?r:ui(t,r)});return{calculatedDuration:e,next:c=>(i.value=a(c),i.done=c>=e,i)}}const li=e=>e!==null;function Ft(e,{repeat:t,repeatType:n="loop"},s,r=1){const i=e.filter(li),a=r<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||s===void 0?i[a]:s}const fi={decay:st,inertia:st,tween:re,keyframes:re,spring:Ee};function rs(e){typeof e.type=="string"&&(e.type=fi[e.type])}class Dt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const di=e=>e/100;class Ot extends Dt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,r;const{motionValue:n}=this.options;n&&n.updatedAt!==j.now()&&this.tick(j.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(r=(s=this.options).onStop)==null||r.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;rs(t);const{type:n=re,repeat:s=0,repeatDelay:r=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const c=n||re;process.env.NODE_ENV!=="production"&&c!==re&&te(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==re&&typeof a[0]!="number"&&(this.mixKeyframes=Le(di,ts(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=Rt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(s+1)-r,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:r,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:u,repeat:d,repeatType:f,repeatDelay:h,type:g,onUpdate:y,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const m=this.currentTime-l*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?m<0:m>r;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let x=this.currentTime,C=s;if(d){const V=Math.min(this.currentTime,r)/a;let F=Math.floor(V),D=V%1;!D&&V>=1&&(D=1),D===1&&F--,F=Math.min(F,d+1),!!(F%2)&&(f==="reverse"?(D=1-D,h&&(D-=h/a)):f==="mirror"&&(C=o)),x=ee(0,1,D)*a}const S=w?{done:!1,value:u[0]}:C.next(x);i&&(S.value=i(S.value));let{done:A}=S;!w&&c!==null&&(A=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const P=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return P&&g!==st&&(S.value=Ft(u,this.options,v,this.speed)),y&&y(S.value),P&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return _(this.calculatedDuration)}get time(){return _(this.currentTime)}set time(t){var n;t=K(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(j.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=_(this.currentTime))}play(){var r,i;if(this.isStopped)return;const{driver:t=Yr,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(r=this.options).onPlay)==null||i.call(r);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(j.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function hi(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const X=e=>e*180/Math.PI,rt=e=>{const t=X(Math.atan2(e[1],e[0]));return it(t)},pi={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:rt,rotateZ:rt,skewX:e=>X(Math.atan(e[1])),skewY:e=>X(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},it=e=>(e=e%360,e<0&&(e+=360),e),nn=rt,sn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),rn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),mi={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:sn,scaleY:rn,scale:e=>(sn(e)+rn(e))/2,rotateX:e=>it(X(Math.atan2(e[6],e[5]))),rotateY:e=>it(X(Math.atan2(-e[2],e[0]))),rotateZ:nn,rotate:nn,skewX:e=>X(Math.atan(e[4])),skewY:e=>X(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ot(e){return e.includes("scale")?1:0}function at(e,t){if(!e||e==="none")return ot(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=mi,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=pi,r=a}if(!r)return ot(t);const i=s[t],o=r[1].split(",").map(yi);return typeof i=="function"?i(o):o[i]}const gi=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return at(n,t)};function yi(e){return parseFloat(e.trim())}const de=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],he=new Set(de),on=e=>e===le||e===T,bi=new Set(["x","y","z"]),vi=de.filter(e=>!bi.has(e));function xi(e){const t=[];return vi.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Q={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>at(t,"x"),y:(e,{transform:t})=>at(t,"y")};Q.translateX=Q.x;Q.translateY=Q.y;const Z=new Set;let ct=!1,ut=!1,lt=!1;function is(){if(ut){const e=Array.from(Z).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const r=xi(s);r.length&&(n.set(s,r),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([i,o])=>{var a;(a=s.getValue(i))==null||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ut=!1,ct=!1,Z.forEach(e=>e.complete(lt)),Z.clear()}function os(){Z.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ut=!0)})}function Ti(){lt=!0,os(),is(),lt=!1}class It{constructor(t,n,s,r,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=r,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Z.add(this),ct||(ct=!0,B.read(os),B.resolveKeyframes(is))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:r}=this;if(t[0]===null){const i=r==null?void 0:r.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),r&&i===void 0&&r.set(t[0])}hi(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Z.delete(this)}cancel(){this.state==="scheduled"&&(Z.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const wi=e=>e.startsWith("--");function Si(e,t,n){wi(t)?e.style.setProperty(t,n):e.style[t]=n}const Vi=wt(()=>window.ScrollTimeline!==void 0),Ci={};function Ai(e,t){const n=wt(e);return()=>Ci[t]??n()}const as=Ai(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),me=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,an={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:me([0,.65,.55,1]),circOut:me([.55,0,1,.45]),backIn:me([.31,.01,.66,-.59]),backOut:me([.33,1.53,.69,.99])};function cs(e,t){if(e)return typeof e=="function"?as()?ns(e,t):"ease-out":qn(e)?me(e):Array.isArray(e)?e.map(n=>cs(n,t)||an.easeOut):an[e]}function Mi(e,t,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const d=cs(a,r);Array.isArray(d)&&(u.easing=d);const f={delay:s,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),e.animate(u,f)}function us(e){return typeof e=="function"&&"applyToOptions"in e}function Pi({type:e,...t}){return us(e)&&as()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Ri extends Dt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:r,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,te(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=Pi(t);this.animation=Mi(n,s,r,l,i),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Ft(r,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):Si(n,s,u),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return _(Number(t))}get time(){return _(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=K(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Vi()?(this.animation.timeline=t,ue):n(this)}}const ls={anticipate:$n,backInOut:_n,circInOut:Wn};function Fi(e){return e in ls}function Di(e){typeof e.ease=="string"&&Fi(e.ease)&&(e.ease=ls[e.ease])}const cn=10;class Oi extends Ri{constructor(t){Di(t),rs(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:r,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Ot({...o,autoplay:!1}),c=K(this.finishedTime??this.time);n.setWithVelocity(a.sample(c-cn).value,a.sample(c).value,cn),a.stop()}}const un=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(fe.test(e)||e==="0")&&!e.startsWith("url("));function Ii(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ei(e,t,n,s){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=un(r,t),a=un(i,t);return we(o===a,`You are trying to animate ${t} from "${r}" to "${i}". "${o?i:r}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Ii(e)||(n==="spring"||us(n))&&s}function ft(e){e.duration=0,e.type}const ki=new Set(["opacity","clipPath","filter","transform"]),ji=wt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Bi(e){var u;const{motionValue:t,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=e;if(!(((u=t==null?void 0:t.owner)==null?void 0:u.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=t.owner.getProps();return ji()&&n&&ki.has(n)&&(n!=="transform"||!l)&&!c&&!s&&r!=="mirror"&&i!==0&&o!=="inertia"}const Li=40;class Ni extends Dt{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:c,motionValue:l,element:u,...d}){var g;super(),this.stop=()=>{var y,v;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=j.now();const f={autoplay:t,delay:n,type:s,repeat:r,repeatDelay:i,repeatType:o,name:c,motionValue:l,element:u,...d},h=(u==null?void 0:u.KeyframeResolver)||It;this.keyframeResolver=new h(a,(y,v,m)=>this.onKeyframesResolved(y,v,f,!m),c,l,u),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,s,r){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:c,isHandoff:l,onUpdate:u}=s;this.resolvedAt=j.now(),Ei(t,i,o,a)||(($.instantAnimations||!c)&&(u==null||u(Ft(t,s,n))),t[0]=t[t.length-1],ft(s),s.repeat=0);const f={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>Li?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},h=!l&&Bi(f)?new Oi({...f,element:f.motionValue.owner.current}):new Ot(f);h.finished.then(()=>this.notifyFinished()).catch(ue),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Ti()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const Ki=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _i(e){const t=Ki.exec(e);if(!t)return[,];const[,n,s,r]=t;return[`--${n??s}`,r]}const $i=4;function fs(e,t,n=1){te(n<=$i,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,r]=_i(e);if(!s)return;const i=window.getComputedStyle(t).getPropertyValue(s);if(i){const o=i.trim();return Dn(o)?parseFloat(o):o}return Ct(r)?fs(r,t,n+1):r}function ds(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const hs=new Set(["width","height","top","left","right","bottom",...de]),Wi={test:e=>e==="auto",parse:e=>e},ps=e=>t=>t.test(e),ms=[le,T,ie,H,Ir,Or,Wi],ln=e=>ms.find(ps(e));function Hi(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||On(e):!0}const qi=new Set(["brightness","contrast","saturate","opacity"]);function Gi(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(At)||[];if(!s)return e;const r=n.replace(s,"");let i=qi.has(t)?1:0;return s!==n&&(i*=100),t+"("+i+r+")"}const Ui=/\b([a-z-]*)\(.*?\)/gu,dt={...fe,getAnimatableNone:e=>{const t=e.match(Ui);return t?t.map(Gi).join(" "):e}},fn={...le,transform:Math.round},zi={rotate:H,rotateX:H,rotateY:H,rotateZ:H,scale:Pe,scaleX:Pe,scaleY:Pe,scaleZ:Pe,skew:H,skewX:H,skewY:H,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:ve,originX:Qt,originY:Qt,originZ:T},Et={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,backgroundPositionX:T,backgroundPositionY:T,...zi,zIndex:fn,fillOpacity:ve,strokeOpacity:ve,numOctaves:fn},Yi={...Et,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:dt,WebkitFilter:dt},gs=e=>Yi[e];function ys(e,t){let n=gs(e);return n!==dt&&(n=fe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Xi=new Set(["auto","none","0"]);function Qi(e,t,n){let s=0,r;for(;s<e.length&&!r;){const i=e[s];typeof i=="string"&&!Xi.has(i)&&xe(i).values.length&&(r=e[s]),s++}if(r&&n)for(const i of t)e[i]=ys(n,r)}class Zi extends It{constructor(t,n,s,r,i){super(t,n,s,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let l=t[c];if(typeof l=="string"&&(l=l.trim(),Ct(l))){const u=fs(l,n.current);u!==void 0&&(t[c]=u),c===t.length-1&&(this.finalKeyframe=l)}}if(this.resolveNoneKeyframes(),!hs.has(s)||t.length!==2)return;const[r,i]=t,o=ln(r),a=ln(i);if(o!==a)if(on(o)&&on(a))for(let c=0;c<t.length;c++){const l=t[c];typeof l=="string"&&(t[c]=parseFloat(l))}else Q[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let r=0;r<t.length;r++)(t[r]===null||Hi(t[r]))&&s.push(r);s.length&&Qi(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Q[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(s,r).jump(r,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,o=s[i];s[i]=Q[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,l])=>{t.getValue(c).set(l)}),this.resolveNoneKeyframes()}}function Ji(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const r=(n==null?void 0:n[e])??s.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}const bs=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function eo(e){return hr(e)&&"offsetHeight"in e}const dn=30,to=e=>!isNaN(parseFloat(e));class no{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var i;const r=j.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=j.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=to(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&jn(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new En);const s=this.events[t].add(n);return t==="change"?()=>{s(),B.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=j.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>dn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,dn);return kn(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ke(e,t){return new no(e,t)}const{schedule:so}=Gn(queueMicrotask,!1),ro={y:!1};function io(){return ro.y}function vs(e,t){const n=Ji(e),s=new AbortController,r={passive:!0,...t,signal:s.signal};return[n,r,()=>s.abort()]}function hn(e){return!(e.pointerType==="touch"||io())}function oo(e,t,n={}){const[s,r,i]=vs(e,n),o=a=>{if(!hn(a))return;const{target:c}=a,l=t(c,a);if(typeof l!="function"||!c)return;const u=d=>{hn(d)&&(l(d),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,r)};return s.forEach(a=>{a.addEventListener("pointerenter",o,r)}),i}const xs=(e,t)=>t?e===t?!0:xs(e,t.parentElement):!1,ao=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,co=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function uo(e){return co.has(e.tagName)||e.tabIndex!==-1}const Fe=new WeakSet;function pn(e){return t=>{t.key==="Enter"&&e(t)}}function ze(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const lo=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=pn(()=>{if(Fe.has(n))return;ze(n,"down");const r=pn(()=>{ze(n,"up")}),i=()=>ze(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function mn(e){return ao(e)&&!0}function fo(e,t,n={}){const[s,r,i]=vs(e,n),o=a=>{const c=a.currentTarget;if(!mn(a))return;Fe.add(c);const l=t(c,a),u=(h,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Fe.has(c)&&Fe.delete(c),mn(h)&&typeof l=="function"&&l(h,{success:g})},d=h=>{u(h,c===window||c===document||n.useGlobalTarget||xs(c,h.target))},f=h=>{u(h,!1)};window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",f,r)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,r),eo(a)&&(a.addEventListener("focus",l=>lo(l,r)),!uo(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}const E=e=>!!(e&&e.getVelocity),ho=[...ms,R,fe],po=e=>ho.find(ps(e)),Ts=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),kt=p.createContext({strict:!1}),gn={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"]},ae={};for(const e in gn)ae[e]={isEnabled:t=>gn[e].some(n=>!!t[n])};function yn(e){for(const t in e)ae[t]={...ae[t],...e[t]}}function mo({children:e,features:t,strict:n=!1}){const[,s]=p.useState(!Ye(t)),r=p.useRef(void 0);if(!Ye(t)){const{renderer:i,...o}=t;r.current=i,yn(o)}return p.useEffect(()=>{Ye(t)&&t().then(({renderer:i,...o})=>{yn(o),r.current=i,s(!0)})},[]),b.jsx(kt.Provider,{value:{renderer:r.current,strict:n},children:e})}function Ye(e){return typeof e=="function"}const go=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","ignoreStrict","viewport"]);function je(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||go.has(e)}let ws=e=>!je(e);function yo(e){typeof e=="function"&&(ws=t=>t.startsWith("on")?!je(t):e(t))}try{yo(require("@emotion/is-prop-valid").default)}catch{}function bo(e,t,n){const s={};for(const r in e)r==="values"&&typeof e.values=="object"||(ws(r)||n===!0&&je(r)||!t&&!je(r)||e.draggable&&r.startsWith("onDrag"))&&(s[r]=e[r]);return s}const Ke=p.createContext({});function _e(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Te(e){return typeof e=="string"||Array.isArray(e)}const jt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Bt=["initial",...jt];function $e(e){return _e(e.animate)||Bt.some(t=>Te(e[t]))}function Ss(e){return!!($e(e)||e.variants)}function vo(e,t){if($e(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Te(n)?n:void 0,animate:Te(s)?s:void 0}}return e.inherit!==!1?t:{}}function xo(e){const{initial:t,animate:n}=vo(e,p.useContext(Ke));return p.useMemo(()=>({initial:t,animate:n}),[bn(t),bn(n)])}function bn(e){return Array.isArray(e)?e.join(" "):e}const To={};function Vs(e,{layout:t,layoutId:n}){return he.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!To[e]||e==="opacity")}const wo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},So=de.length;function Vo(e,t,n){let s="",r=!0;for(let i=0;i<So;i++){const o=de[i],a=e[o];if(a===void 0)continue;let c=!0;if(typeof a=="number"?c=a===(o.startsWith("scale")?1:0):c=parseFloat(a)===0,!c||n){const l=bs(a,Et[o]);if(!c){r=!1;const u=wo[o]||o;s+=`${u}(${l}) `}n&&(t[o]=l)}}return s=s.trim(),n?s=n(t,r?"":s):r&&(s="none"),s}function Lt(e,t,n){const{style:s,vars:r,transformOrigin:i}=e;let o=!1,a=!1;for(const c in t){const l=t[c];if(he.has(c)){o=!0;continue}else if(zn(c)){r[c]=l;continue}else{const u=bs(l,Et[c]);c.startsWith("origin")?(a=!0,i[c]=u):s[c]=u}}if(t.transform||(o||n?s.transform=Vo(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=i;s.transformOrigin=`${c} ${l} ${u}`}}const Nt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Cs(e,t,n){for(const s in t)!E(t[s])&&!Vs(s,n)&&(e[s]=t[s])}function Co({transformTemplate:e},t){return p.useMemo(()=>{const n=Nt();return Lt(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ao(e,t){const n=e.style||{},s={};return Cs(s,n,e),Object.assign(s,Co(e,t)),s}function Mo(e,t){const n={},s=Ao(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const Po={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ro={offset:"strokeDashoffset",array:"strokeDasharray"};function Fo(e,t,n=1,s=0,r=!0){e.pathLength=1;const i=r?Po:Ro;e[i.offset]=T.transform(-s);const o=T.transform(t),a=T.transform(n);e[i.array]=`${o} ${a}`}function As(e,{attrX:t,attrY:n,attrScale:s,pathLength:r,pathSpacing:i=1,pathOffset:o=0,...a},c,l,u){if(Lt(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(u==null?void 0:u.transformBox)??"fill-box",delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&Fo(d,r,i,o,!1)}const Ms=()=>({...Nt(),attrs:{}}),Ps=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Do(e,t,n,s){const r=p.useMemo(()=>{const i=Ms();return As(i,t,Ps(s),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Cs(i,e.style,e),r.style={...i,...r.style}}return r}const Oo=["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 Kt(e){return typeof e!="string"||e.includes("-")?!1:!!(Oo.indexOf(e)>-1||/[A-Z]/u.test(e))}function Io(e,t,n,{latestValues:s},r,i=!1){const a=(Kt(e)?Do:Mo)(t,s,r,e),c=bo(t,typeof e=="string",i),l=e!==p.Fragment?{...c,...a,ref:n}:{},{children:u}=t,d=p.useMemo(()=>E(u)?u.get():u,[u]);return p.createElement(e,{...l,children:d})}function vn(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function _t(e,t,n,s){if(typeof t=="function"){const[r,i]=vn(s);t=t(n!==void 0?n:e.custom,r,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,i]=vn(s);t=t(n!==void 0?n:e.custom,r,i)}return t}function Eo(e){return E(e)?e.get():e}function ko({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,r){return{latestValues:jo(n,s,r,e),renderState:t()}}function jo(e,t,n,s){const r={},i=s(e,{});for(const f in i)r[f]=Eo(i[f]);let{initial:o,animate:a}=e;const c=$e(e),l=Ss(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!_e(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const g=_t(e,f[h]);if(g){const{transitionEnd:y,transition:v,...m}=g;for(const w in m){let x=m[w];if(Array.isArray(x)){const C=u?x.length-1:0;x=x[C]}x!==null&&(r[w]=x)}for(const w in y)r[w]=y[w]}}}return r}const Rs=e=>(t,n)=>{const s=p.useContext(Ke),r=p.useContext(Fn),i=()=>ko(e,t,s,r);return n?i():ur(i)};function $t(e,t,n){var i;const{style:s}=e,r={};for(const o in s)(E(s[o])||t.style&&E(t.style[o])||Vs(o,e)||((i=n==null?void 0:n.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(r[o]=s[o]);return r}const Bo=Rs({scrapeMotionValuesFromProps:$t,createRenderState:Nt});function Fs(e,t,n){const s=$t(e,t,n);for(const r in e)if(E(e[r])||E(t[r])){const i=de.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[i]=e[r]}return s}const Lo=Rs({scrapeMotionValuesFromProps:Fs,createRenderState:Ms}),No=Symbol.for("motionComponentSymbol");function Ds(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ko(e,t,n){return p.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):Ds(n)&&(n.current=s))},[t])}const Wt=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),_o="framerAppearId",Os="data-"+Wt(_o),$o=p.createContext({});function Wo(e,t,n,s,r){var y,v;const{visualElement:i}=p.useContext(Ke),o=p.useContext(kt),a=p.useContext(Fn),c=p.useContext(Ts).reducedMotion,l=p.useRef(null);s=s||o.renderer,!l.current&&s&&(l.current=s(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:c}));const u=l.current,d=p.useContext($o);u&&!u.projection&&r&&(u.type==="html"||u.type==="svg")&&Ho(l.current,n,r,d);const f=p.useRef(!1);p.useInsertionEffect(()=>{u&&f.current&&u.update(n,a)});const h=n[Os],g=p.useRef(!!h&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,h))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,h)));return lr(()=>{u&&(f.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),p.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,h)}),g.current=!1),u.enteringChildren=void 0)}),u}function Ho(e,t,n,s){const{layoutId:r,layout:i,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Is(e.parent)),e.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!o||a&&Ds(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:c,layoutRoot:l})}function Is(e){if(e)return e.options.allowProjection!==!1?e.projection:Is(e.parent)}function qo(e,{forwardMotionProps:t=!1}={},n,s){const r=Kt(e)?Lo:Bo;function i(a,c){let l;const u={...p.useContext(Ts),...a,layoutId:Go(a)},{isStatic:d}=u,f=xo(a),h=r(a,d);if(!d&&Tt){Uo(u,n);const g=zo(u);l=g.MeasureLayout,f.visualElement=Wo(e,h,u,s,g.ProjectionNode)}return b.jsxs(Ke.Provider,{value:f,children:[l&&f.visualElement?b.jsx(l,{visualElement:f.visualElement,...u}):null,Io(e,a,Ko(h,f.visualElement,c),h,d,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=p.forwardRef(i);return o[No]=e,o}function Go({layoutId:e}){const t=p.useContext(cr).id;return t&&e!==void 0?t+"-"+e:e}function Uo(e,t){p.useContext(kt).strict,process.env.NODE_ENV}function zo(e){const{drag:t,layout:n}=ae;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Yo({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Xo(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Qo(e,t){return Yo(Xo(e.getBoundingClientRect(),t))}const xn=()=>({min:0,max:0}),Es=()=>({x:xn(),y:xn()}),ht={current:null},ks={current:!1};function Zo(){if(ks.current=!0,!!Tt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ht.current=e.matches;e.addEventListener("change",t),t()}else ht.current=!1}const Jo=new WeakMap;function ea(e,t,n){for(const s in t){const r=t[s],i=n[s];if(E(r))e.addValue(s,r);else if(E(i))e.addValue(s,ke(r,{owner:e}));else if(i!==r)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=e.getStaticValue(s);e.addValue(s,ke(o!==void 0?o:r,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const Tn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ta{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:r,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=It,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=j.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,B.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=$e(n),this.isVariantNode=Ss(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const h=d[f];c[f]!==void 0&&E(h)&&h.set(c[f])}}mount(t){var n;this.current=t,Jo.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,r)=>this.bindToMotionValue(r,s)),ks.current||Zo(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:ht.current,process.env.NODE_ENV!=="production"&&jn(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Je(this.notifyUpdate),Je(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=he.has(t);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&B.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ae){const n=ae[t];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[t]&&r&&s(this.props)&&(this.features[t]=new r(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Es()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Tn.length;s++){const r=Tn[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,o=t[i];o&&(this.propEventSubscriptions[r]=this.on(r,o))}this.prevMotionValues=ea(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=ke(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Dn(s)||On(s))?s=parseFloat(s):!po(s)&&fe.test(n)&&(s=ys(t,n)),this.setBaseTarget(t,E(s)?s.get():s)),E(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=_t(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!E(r)?r:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new En),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){so.render(this.render)}}class js extends ta{constructor(){super(...arguments),this.KeyframeResolver=Zi}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;E(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Bs(e,{style:t,vars:n},s,r){const i=e.style;let o;for(o in t)i[o]=t[o];r==null||r.applyProjectionStyles(i,s);for(o in n)i.setProperty(o,n[o])}function na(e){return window.getComputedStyle(e)}class sa extends js{constructor(){super(...arguments),this.type="html",this.renderInstance=Bs}readValueFromInstance(t,n){var s;if(he.has(n))return(s=this.projection)!=null&&s.isProjecting?ot(n):gi(t,n);{const r=na(t),i=(zn(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Qo(t,n)}build(t,n,s){Lt(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return $t(t,n,s)}}const Ls=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ra(e,t,n,s){Bs(e,t,void 0,s);for(const r in t.attrs)e.setAttribute(Ls.has(r)?r:Wt(r),t.attrs[r])}class ia extends js{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Es}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(he.has(n)){const s=gs(n);return s&&s.default||0}return n=Ls.has(n)?n:Wt(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Fs(t,n,s)}build(t,n,s){As(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,r){ra(t,n,s,r)}mount(t){this.isSVGTag=Ps(t.tagName),super.mount(t)}}const oa=(e,t)=>Kt(e)?new ia(t):new sa(t,{allowProjection:e!==p.Fragment});function oe(e,t,n){const s=e.getProps();return _t(s,t,n!==void 0?n:s.custom,e)}const pt=e=>Array.isArray(e);function aa(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ke(n))}function ca(e){return pt(e)?e[e.length-1]||0:e}function ua(e,t){const n=oe(e,t);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const o in i){const a=ca(i[o]);aa(e,o,a)}}function la(e){return!!(E(e)&&e.add)}function fa(e,t){const n=e.getValue("willChange");if(la(n))return n.add(t);if(!n&&$.WillChange){const s=new $.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function da(e){return e.props[Os]}const ha=e=>e!==null;function pa(e,{repeat:t,repeatType:n="loop"},s){const r=e.filter(ha),i=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[i]}const ma={type:"spring",stiffness:500,damping:25,restSpeed:10},ga=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ya={type:"keyframes",duration:.8},ba={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},va=(e,{keyframes:t})=>t.length>2?ya:he.has(e)?e.startsWith("scale")?ga(t[1]):ma:ba;function xa({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Ta=(e,t,n,s={},r,i)=>o=>{const a=ds(s,e)||{},c=a.delay||s.delay||0;let{elapsed:l=0}=s;l=l-K(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:r};xa(a)||Object.assign(u,va(e,u)),u.duration&&(u.duration=K(u.duration)),u.repeatDelay&&(u.repeatDelay=K(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(ft(u),u.delay===0&&(d=!0)),($.instantAnimations||$.skipAnimations)&&(d=!0,ft(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,d&&!i&&t.get()!==void 0){const f=pa(u.keyframes,a);if(f!==void 0){B.update(()=>{u.onUpdate(f),u.onComplete()});return}}return a.isSync?new Ot(u):new Ni(u)};function wa({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function Ns(e,t,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:o,...a}=t;s&&(i=s);const c=[],l=r&&e.animationState&&e.animationState.getState()[r];for(const u in a){const d=e.getValue(u,e.latestValues[u]??null),f=a[u];if(f===void 0||l&&wa(l,u))continue;const h={delay:n,...ds(i||{},u)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(f)&&f===g&&!h.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const m=da(e);if(m){const w=window.MotionHandoffAnimation(m,u,B);w!==null&&(h.startTime=w,y=!0)}}fa(e,u),d.start(Ta(u,d,f,e.shouldReduceMotion&&hs.has(u)?{type:!1}:h,e,y));const v=d.animation;v&&c.push(v)}return o&&Promise.all(c).then(()=>{B.update(()=>{o&&ua(e,o)})}),c}function Ks(e,t,n,s=0,r=1){const i=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),o=e.size,a=(o-1)*s;return typeof n=="function"?n(i,o):r===1?i*s:a-i*s}function mt(e,t,n={}){var c;const s=oe(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Promise.all(Ns(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=r;return Sa(e,t,l,u,d,f,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[l,u]=a==="beforeChildren"?[i,o]:[o,i];return l().then(()=>u())}else return Promise.all([i(),o(n.delay)])}function Sa(e,t,n=0,s=0,r=0,i=1,o){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(mt(c,t,{...o,delay:n+(typeof s=="function"?0:s)+Ks(e.variantChildren,c,s,r,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Va(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const r=t.map(i=>mt(e,i,n));s=Promise.all(r)}else if(typeof t=="string")s=mt(e,t,n);else{const r=typeof t=="function"?oe(e,t,n.custom):t;s=Promise.all(Ns(e,r,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}function _s(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const Ca=Bt.length;function $s(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?$s(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ca;n++){const s=Bt[n],r=e.props[s];(Te(r)||r===!1)&&(t[s]=r)}return t}const Aa=[...jt].reverse(),Ma=jt.length;function Pa(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Va(e,n,s)))}function Ra(e){let t=Pa(e),n=wn(),s=!0;const r=c=>(l,u)=>{var f;const d=oe(e,u,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:g,...y}=d;l={...l,...y,...g}}return l};function i(c){t=c(e)}function o(c){const{props:l}=e,u=$s(e.parent)||{},d=[],f=new Set;let h={},g=1/0;for(let v=0;v<Ma;v++){const m=Aa[v],w=n[m],x=l[m]!==void 0?l[m]:u[m],C=Te(x),S=m===c?w.isActive:null;S===!1&&(g=v);let A=x===u[m]&&x!==l[m]&&C;if(A&&s&&e.manuallyAnimateOnMount&&(A=!1),w.protectedKeys={...h},!w.isActive&&S===null||!x&&!w.prevProp||_e(x)||typeof x=="boolean")continue;const P=Fa(w.prevProp,x);let V=P||m===c&&w.isActive&&!A&&C||v>g&&C,F=!1;const D=Array.isArray(x)?x:[x];let W=D.reduce(r(m),{});S===!1&&(W={});const{prevResolvedValues:Ce={}}=w,We={...Ce,...W},Ae=O=>{V=!0,f.has(O)&&(F=!0,f.delete(O)),w.needsAnimating[O]=!0;const k=e.getValue(O);k&&(k.liveStyle=!1)};for(const O in We){const k=W[O],U=Ce[O];if(h.hasOwnProperty(O))continue;let ne=!1;pt(k)&&pt(U)?ne=!_s(k,U):ne=k!==U,ne?k!=null?Ae(O):f.add(O):k!==void 0&&f.has(O)?Ae(O):w.protectedKeys[O]=!0}w.prevProp=x,w.prevResolvedValues=W,w.isActive&&(h={...h,...W}),s&&e.blockInitialAnimation&&(V=!1);const Gt=A&&P;V&&(!Gt||F)&&d.push(...D.map(O=>{const k={type:m};if(typeof O=="string"&&s&&!Gt&&e.manuallyAnimateOnMount&&e.parent){const{parent:U}=e,ne=oe(U,O);if(U.enteringChildren&&ne){const{delayChildren:Xs}=ne.transition||{};k.delay=Ks(U.enteringChildren,e,Xs)}}return{animation:O,options:k}}))}if(f.size){const v={};if(typeof l.initial!="boolean"){const m=oe(e,Array.isArray(l.initial)?l.initial[0]:l.initial);m&&m.transition&&(v.transition=m.transition)}f.forEach(m=>{const w=e.getBaseTarget(m),x=e.getValue(m);x&&(x.liveStyle=!0),v[m]=w??null}),d.push({animation:v})}let y=!!d.length;return s&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(y=!1),s=!1,y?t(d):Promise.resolve()}function a(c,l){var d;if(n[c].isActive===l)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(c,l)}),n[c].isActive=l;const u=o(c);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=wn(),s=!0}}}function Fa(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!_s(t,e):!1}function z(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wn(){return{animate:z(!0),whileInView:z(),whileHover:z(),whileTap:z(),whileDrag:z(),whileFocus:z(),exit:z()}}class pe{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Da extends pe{constructor(t){super(t),t.animationState||(t.animationState=Ra(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_e(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Oa=0;class Ia extends pe{constructor(){super(...arguments),this.id=Oa++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Ea={animation:{Feature:Da},exit:{Feature:Ia}};function Sn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function Ws(e){return{point:{x:e.pageX,y:e.pageY}}}function Vn(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=s[r];i&&B.postRender(()=>i(t,Ws(t)))}class ka extends pe{mount(){const{current:t}=this.node;t&&(this.unmount=oo(t,(n,s)=>(Vn(this.node,s,"Start"),r=>Vn(this.node,r,"End"))))}unmount(){}}class ja extends pe{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Le(Sn(this.node.current,"focus",()=>this.onFocus()),Sn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Cn(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=s[r];i&&B.postRender(()=>i(t,Ws(t)))}class Ba extends pe{mount(){const{current:t}=this.node;t&&(this.unmount=fo(t,(n,s)=>(Cn(this.node,s,"Start"),(r,{success:i})=>Cn(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const gt=new WeakMap,Xe=new WeakMap,La=e=>{const t=gt.get(e.target);t&&t(e)},Na=e=>{e.forEach(La)};function Ka({root:e,...t}){const n=e||document;Xe.has(n)||Xe.set(n,{});const s=Xe.get(n),r=JSON.stringify(t);return s[r]||(s[r]=new IntersectionObserver(Na,{root:e,...t})),s[r]}function _a(e,t,n){const s=Ka(t);return gt.set(e,n),s.observe(e),()=>{gt.delete(e),s.unobserve(e)}}const $a={some:0,all:1};class Wa extends pe{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:$a[r]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,i&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=l?u:d;f&&f(c)};return _a(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Ha(t,n))&&this.startObserver()}unmount(){}}function Ha({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const qa={inView:{Feature:Wa},tap:{Feature:Ba},focus:{Feature:ja},hover:{Feature:ka}},Ga={renderer:oa,...Ea,...qa};function Hs(e,t){return qo(e,t)}const Ua=Hs("div"),Ht=Hs("span"),za=({icon:e=J.ChevronsUpDown,"aria-hidden":t=!0,...n})=>{const s=p.useContext(I);return b.jsx(ce.Button.Icon,{as:Ht,animate:{rotate:s.open?180:0},transition:{duration:.15,type:"spring",bounce:0},icon:e,"aria-hidden":t,...n})},Ya=({tooltipProps:e,...t})=>{const n=p.useContext(I),s=()=>{var i,o;if(L(n.value)){const a=n.onValueChange;a==null||a([])}if(G(n.value)){const a=n.onValueChange;a==null||a(void 0)}(o=(i=n.triggerRef)==null?void 0:i.current)==null||o.focus()};return p.useMemo(()=>{var i;if(G(n.value))return n.clearable&&n.value;if(L(n.value))return n.clearable&&((i=n.value)==null?void 0:i.length)>0},[n.clearable,n.value])?b.jsx(nr.Tooltip,{label:"Clear field",...e,children:b.jsx(ce.Button,{type:"button",icon:{icon:J.X,alt:"Clear field"},size:"0",variant:"ghost",onClick:i=>{n.value&&(i.stopPropagation(),s())},onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&(i.stopPropagation(),i.preventDefault(),s())},"data-tgph-combobox-clear":!0,style:{marginTop:"calc(-1 * var(--tgph-spacing-1)",marginBottom:"calc(-1 * var(--tgph-spacing-1)"},...t})}):null},qs=({children:e,...t})=>{const n=p.useContext(I),s=p.useMemo(()=>{var a;if(!G(n.value))return;const r=Qe(n.value,n.options,n.legacyBehavior),i=(r==null?void 0:r.label)||(r==null?void 0:r.value)||n.placeholder,o=n.legacyBehavior&&((a=n==null?void 0:n.value)==null?void 0:a.label);return o||i},[n.value,n.options,n.legacyBehavior,n.placeholder]);return b.jsx(Mn.TooltipIfTruncated,{children:b.jsx(ce.Button.Text,{color:n.value?"default":"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||s})})},yt=({children:e,...t})=>{const n=p.useContext(I);return b.jsx(Mn.TooltipIfTruncated,{children:b.jsx(ce.Button.Text,{color:"gray",textOverflow:"ellipsis",overflow:"hidden",...t,children:e||n.placeholder})})},Gs=({children:e})=>{const t=p.useContext(I);if(!L(t.value))return null;const n=t.layout||"truncate",r=(t.value.length-2).toString().split("");return b.jsxs(q.Stack,{gap:"0_5",w:"full",wrap:n==="wrap"?"wrap":"nowrap",align:"center",style:{position:"relative",flexGrow:1},children:[e,n==="truncate"&&t.value.length>2&&b.jsx(q.Stack,{as:Ua,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},h:"full",pr:"1",pl:"8",align:"center","aria-label":`${t.value.length-2} more selected`,position:"absolute",right:"0",style:{backgroundImage:"linear-gradient(to left, var(--tgph-surface-1) 0 60%, transparent 90% 100%)"},children:b.jsxs(vt.Text,{as:"span",size:"1",style:{whiteSpace:"nowrap"},children:["+",r.map(i=>b.jsx(q.Box,{as:Ht,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1,type:"spring",bounce:0},w:"2",display:"inline-block",children:i},i))," ","more"]})})]})},qt=p.createContext({value:""}),Xa=({value:e,children:t,...n})=>b.jsx(qt.Provider,{value:{value:e},children:b.jsx(xt.Tag.Root,{as:Ht,initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.5},transition:{duration:.1,type:"spring",bounce:0},size:"1",maxH:"5",rounded:"1",layout:"position",...n,children:t})}),Qa=({children:e,...t})=>{const n=p.useContext(I),s=p.useContext(qt),r=p.useMemo(()=>{const i=n.options.find(c=>c.value===s.value);if(i)return i.label||i.value;if(!n.value)return;const a=n.value.find(c=>N(c,n.legacyBehavior)===s.value);if(a)return a},[n.options,n.value,s.value,n.legacyBehavior]);return b.jsx(xt.Tag.Text,{...t,children:e||r})},Za=({children:e,...t})=>{const n=p.useContext(I),s=p.useContext(qt);return b.jsx(xt.Tag.Button,{icon:{icon:J.X,alt:`Remove ${s.value}`},height:"full",onClick:r=>{if(!n.onValueChange)return;const i=n.onValueChange,a=n.value.filter(c=>N(c,n.legacyBehavior)!==s.value);i==null||i(a),r.stopPropagation(),r.preventDefault()},"data-tgph-combobox-tag-button":!0,...t,children:e})},Ja=({value:e,children:t,...n})=>b.jsxs(be.Root,{value:e,...n,children:[b.jsx(be.Text,{children:t}),b.jsx(be.Button,{})]}),ec=e=>b.jsx(q.Stack,{align:"center",gap:"1",...e}),tc=()=>{const e=p.useContext(I);if(e.value&&L(e.value)){const t=e.layout||"truncate";return e.value.length===0?b.jsx(yt,{}):b.jsx(mo,{features:Ga,children:b.jsx(Gs,{children:e.value.map((n,s)=>{const r=N(n,e.legacyBehavior);if(r&&(t==="truncate"&&s<=1||t==="wrap"))return b.jsx(tr.RefToTgphRef,{children:b.jsx(be.Default,{value:r})},r)})})})}if(e&&G(e.value))return e.value?b.jsx(qs,{}):b.jsx(yt,{})},be={Root:Xa,Text:Qa,Button:Za,Default:Ja},ge={TriggerIndicator:za,TriggerClear:Ya,TriggerText:qs,TriggerPlaceholder:yt,TriggerTagsContainer:Gs,TriggerActionsContainer:ec,TriggerTag:be,TriggerValue:tc},nc=["ArrowDown","PageUp","Home"],sc=["ArrowUp","PageDown","End"],Us=["Enter"," "],I=p.createContext({value:void 0,onValueChange:()=>{},contentId:"",triggerId:"",open:!1,setOpen:()=>{},onOpenToggle:()=>{},clearable:!1,disabled:!1,options:[],legacyBehavior:!1}),rc=({modal:e=!0,closeOnSelect:t=!0,clearable:n=!1,disabled:s=!1,legacyBehavior:r=!1,open:i,onOpenChange:o,defaultOpen:a,value:c,defaultValue:l,onValueChange:u,errored:d,placeholder:f,layout:h,defaultScrollToValue:g,children:y,...v})=>{const m=p.useId(),w=p.useId(),x=p.useRef(null),C=p.useRef(null),S=p.useRef(null),A=p.useMemo(()=>or(y),[y]),[P,V]=p.useState(""),[F=!1,D]=Ut.useControllableState({prop:i,defaultProp:a??!1,onChange:o}),[W,Ce]=Ut.useControllableState({prop:c,defaultProp:l,onChange:u}),We=p.useCallback(()=>{D(Ae=>!Ae)},[D]);return p.useEffect(()=>{F||V("")},[F]),b.jsx(I.Provider,{value:{contentId:m,triggerId:w,value:W,onValueChange:Ce,placeholder:f,open:F,setOpen:D,onOpenToggle:We,closeOnSelect:t,clearable:n,disabled:s,searchQuery:P,setSearchQuery:V,triggerRef:x,searchRef:C,contentRef:S,errored:d,layout:h,options:A,legacyBehavior:r,defaultScrollToValue:g},children:b.jsx(Be.Menu.Root,{open:F,onOpenChange:D,modal:e,...v,children:y})})},ic=({size:e="1",children:t,...n})=>{const s=p.useContext(I),r=L(s.value)&&s.value.length>0,i=p.useMemo(()=>{if(s.value){if(G(s.value))return Qe(s.value,s.options,s.legacyBehavior);if(L(s.value))return s.value.map(a=>Qe(a,s.options,s.legacyBehavior))}},[s.value,s.options,s.legacyBehavior]),o=p.useCallback(()=>i?G(i)?(i==null?void 0:i.label)||(i==null?void 0:i.value)||s.placeholder:L(i)&&i.map(a=>(a==null?void 0:a.label)||(a==null?void 0:a.value)).join(", ")||s.placeholder:s.placeholder,[i,s.placeholder]);return b.jsx(Be.Menu.Trigger,{...n,asChild:!0,onClick:a=>{var c,l;a.preventDefault(),s.onOpenToggle(),(l=(c=s.triggerRef)==null?void 0:c.current)==null||l.focus()},onKeyDown:a=>{var c;if(a.target===((c=s.triggerRef)==null?void 0:c.current)){if(a.key==="Tab"){a.stopPropagation();return}if(a.key==="ArrowDown"||Us.includes(a.key)){a.stopPropagation(),a.preventDefault(),s.onOpenToggle();return}}},tgphRef:s.triggerRef,children:b.jsx(ce.Button.Root,{id:s.triggerId,type:"button",bg:"surface-1",variant:"outline",align:"center",minH:ir[e],h:"full",w:"full",py:"0_5",pr:"1_5",pl:r?"0_5":"1_5",size:e,color:s.errored?"red":"gray",justify:"space-between",role:"combobox","aria-label":o(),"aria-controls":s.contentId,"aria-expanded":s.open,"aria-haspopup":"listbox","data-tgph-combobox-trigger":!0,"data-tgph-combobox-trigger-open":s.open,disabled:s.disabled,...n,children:t?typeof t=="function"?t({value:i}):t:b.jsxs(b.Fragment,{children:[b.jsx(ge.TriggerValue,{}),b.jsxs(ge.TriggerActionsContainer,{children:[b.jsx(ge.TriggerClear,{}),b.jsx(ge.TriggerIndicator,{})]})]})})})},oc=({style:e,children:t,tgphRef:n,...s})=>{const r=p.useContext(I),i=p.useRef(!1),o=bt.useComposedRefs(n,r.contentRef),a=p.useRef(null),[c,l]=p.useState(0),[u,d]=p.useState(!1),f=p.useCallback(h=>{const g=h==null?void 0:h.getBoundingClientRect();g&&l(g.height),u||d(!0)},[u]);return p.useEffect(()=>{const h=new ResizeObserver(g=>{for(const y of g){const v=y.target;f(v)}});return a.current&&u&&h.observe(a.current),()=>h.disconnect()},[u,f]),p.useEffect(()=>{u===!0&&r.open===!1&&d(!1)},[r.open,u]),p.useEffect(()=>{let h;return r.open&&(h=setTimeout(()=>{f(a.current)},10)),()=>h&&clearTimeout(h)},[r.open,f]),b.jsx(sr.Root,{asChild:!0,children:b.jsx(Qs.DismissableLayer,{onEscapeKeyDown:h=>{r.open&&(h.stopPropagation(),h.preventDefault(),r.setOpen(!1))},children:b.jsx(Be.Menu.Content,{className:"tgph",mt:"1",onCloseAutoFocus:h=>{var g,y;i.current||(y=(g=r.triggerRef)==null?void 0:g.current)==null||y.focus(),i.current=!1,h.preventDefault()},bg:"surface-1",style:{width:"var(--tgph-combobox-trigger-width)",transition:"min-height 200ms ease-in-out",minHeight:c?`${c}px`:"0",...e,"--tgph-combobox-content-transform-origin":"var(--radix-popper-transform-origin)","--tgph-combobox-content-available-width":"var(--radix-popper-available-width)","--tgph-combobox-content-available-height":"calc(var(--radix-popper-available-height) - var(--tgph-spacing-8))","--tgph-combobox-trigger-width":"var(--radix-popper-anchor-width)","--tgph-combobox-trigger-height":"var(--radix-popper-anchor-height)"},...s,tgphRef:o,"data-tgph-combobox-content":!0,"data-tgph-combobox-content-open":r.open,role:void 0,"aria-orientation":void 0,onKeyDown:h=>{var y,v,m,w;h.stopPropagation();const g=(v=(y=r.contentRef)==null?void 0:y.current)==null?void 0:v.querySelectorAll("[data-tgph-combobox-option]");document.activeElement===(g==null?void 0:g[0])&&sc.includes(h.key)&&((w=(m=r.searchRef)==null?void 0:m.current)==null||w.focus())},children:b.jsx(q.Stack,{direction:"column",gap:"1",tgphRef:a,children:t})})})})},ac=({tgphRef:e,...t})=>{const n=p.useContext(I),s=p.useRef(null),r=bt.useComposedRefs(e,s);return p.useEffect(()=>{n.open&&s.current&&requestAnimationFrame(()=>{var a;const o=(G(n.value)?N(n.value,n.legacyBehavior):L(n.value)&&n.value.length>0?N(n.value[0],n.legacyBehavior):null)??n.defaultScrollToValue;if(o){const c=(a=s.current)==null?void 0:a.querySelectorAll("[data-tgph-combobox-option]"),l=Array.from(c||[]).find(u=>u.getAttribute("data-tgph-combobox-option-value")===o);l&&typeof l.scrollIntoView=="function"&&l.scrollIntoView({block:"center"})}})},[n.open,n.value,n.legacyBehavior,n.defaultScrollToValue]),b.jsx(q.Stack,{id:n.contentId,direction:"column",gap:"1",style:{overflowY:"auto","--max-height":t.maxHeight?void 0:"calc(var(--tgph-combobox-content-available-height) - var(--tgph-spacing-12))"},role:"listbox",tgphRef:r,...t})},zs=({value:e,label:t,selected:n,onSelect:s,children:r,...i})=>{const o=p.useContext(I),[a,c]=p.useState(!1),l=o.value,u=!o.searchQuery||ar({children:t||r,value:e,searchQuery:o.searchQuery}),d=L(l)?l.some(h=>N(h,o.legacyBehavior)===e):N(l,o.legacyBehavior)===e,f=h=>{var y,v;h.stopPropagation();const g=h;if(!(g.key&&!Us.includes(g.key))){if(h.preventDefault(),o.closeOnSelect===!0&&o.setOpen(!1),s)return s(h);if(G(l)){const m=o.onValueChange;o.legacyBehavior===!0?m==null||m({value:e,label:t}):m==null||m(e)}else if(L(l)){const m=o.onValueChange,w=o.value,x=d?w.filter(C=>N(C,o.legacyBehavior)!==e):[...w,o.legacyBehavior===!0?{value:e,label:t}:e];m==null||m(x)}(v=(y=o.triggerRef)==null?void 0:y.current)==null||v.focus()}};if(u)return b.jsx(Be.Menu.Button,{type:"button",onSelect:f,onKeyDown:f,selected:n===null?null:n??d,onFocus:()=>c(!0),onBlur:()=>c(!1),role:"option","aria-selected":d?"true":"false","data-tgph-combobox-option":!0,"data-tgph-combobox-option-focused":a,"data-tgph-combobox-option-value":e,"data-tgph-combobox-option-label":t,...i,children:t||r||e})},cc=({label:e="Search",placeholder:t="Search",tgphRef:n,value:s,onValueChange:r,...i})=>{var d;const o=p.useId(),a=p.useContext(I),c=bt.useComposedRefs(n,a.searchRef),l=s??a.searchQuery,u=r??a.setSearchQuery;return p.useEffect(()=>{var g;const f=y=>{var v,m;nc.includes(y.key)&&((m=(v=a.contentRef)==null?void 0:v.current)==null||m.focus({preventScroll:!0})),y.key==="Escape"&&a.setOpen(!1),y.stopPropagation()},h=(g=a.searchRef)==null?void 0:g.current;if(h)return h.addEventListener("keydown",f),()=>{h.removeEventListener("keydown",f)}},[a]),b.jsxs(q.Box,{borderBottom:"px",px:"1",pb:"1",children:[b.jsx(rr.Root,{children:b.jsx(vt.Text,{as:"label",htmlFor:o,children:e})}),b.jsx(er.Input,{id:o,variant:"ghost",placeholder:t,value:l,onChange:f=>{u(f.target.value)},LeadingComponent:b.jsx(An.Icon,{icon:J.Search,alt:"Search Icon"}),TrailingComponent:a!=null&&a.searchQuery&&((d=a==null?void 0:a.searchQuery)==null?void 0:d.length)>0?b.jsx(ce.Button,{variant:"ghost",color:"gray",icon:{icon:J.X,alt:"Clear Search Query"},onClick:()=>{var f;return(f=a.setSearchQuery)==null?void 0:f.call(a,"")}}):null,autoFocus:!0,"data-tgph-combobox-search":!0,"aria-controls":a.contentId,...i,tgphRef:c})]})},uc=({icon:e={icon:J.Search,alt:"Search Icon"},message:t="No results found",children:n,...s})=>{const r=p.useContext(I),[i,o]=p.useState(!1);if(p.useEffect(()=>{var c,l;const a=(l=(c=r.contentRef)==null?void 0:c.current)==null?void 0:l.querySelectorAll("[data-tgph-combobox-option]");(a==null?void 0:a.length)===0?o(!0):o(!1)},[r.searchQuery,r.contentRef,n]),i)return b.jsxs(q.Stack,{gap:"1",align:"center",justify:"center",w:"full",my:"8","data-tgph-combobox-empty":!0,...s,children:[e===null?b.jsx(b.Fragment,{}):b.jsx(An.Icon,{...e}),t===null?b.jsx(b.Fragment,{}):b.jsx(vt.Text,{as:"span",children:t})]})},lc=({leadingText:e="Create",values:t,onCreate:n,selected:s=null,legacyBehavior:r=!1,...i})=>{const o=p.useContext(I),a=p.useCallback(c=>!t||(t==null?void 0:t.length)===0?!1:t.some(l=>N(l,r)===c),[t,r]);if(o.searchQuery&&!a(o.searchQuery))return b.jsx(zs,{leadingIcon:{icon:J.Plus,"aria-hidden":!0},mx:"1",value:o.searchQuery,label:`${e} "${o.searchQuery}"`,selected:s,onSelect:()=>{var c;if(n&&o.searchQuery){const l=r===!0?{value:o.searchQuery}:o.searchQuery;n(l),(c=o.setSearchQuery)==null||c.call(o,"")}},...i})},Ys={};Object.assign(Ys,{Root:rc,Trigger:ic,Content:oc,Options:ac,Option:zs,Search:cc,Empty:uc,Create:lc,Primitives:ge});exports.Combobox=Ys;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|