dsh-code-server-app 0.1.19 → 0.1.22

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/lib/client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  window.__ModuleLoader__.load({id:'dsh-code-server-app',factory:function(require){var module={exports:{}};var exports=module.exports;
2
- var yn=Object.defineProperty;var hc=Object.getOwnPropertyDescriptor;var gc=Object.getOwnPropertyNames;var xc=Object.prototype.hasOwnProperty;var yc=(e,t)=>{for(var r in t)yn(e,r,{get:t[r],enumerable:!0})},vc=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of gc(t))!xc.call(e,n)&&n!==r&&yn(e,n,{get:()=>t[n],enumerable:!(o=hc(t,n))||o.enumerable});return e};var bc=e=>vc(yn({},"__esModule",{value:!0}),e);var Em={};yc(Em,{apply:()=>Sm,inject:()=>Pm,name:()=>Cm});module.exports=bc(Em);var Ui=require("react"),zr=(0,Ui.createContext)({});var Hi=require("react");function Ki(e){let t=(0,Hi.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Gr=require("react");var _i=typeof window!="undefined";var $i=_i?Gr.useLayoutEffect:Gr.useEffect;var Yi=require("react"),vt=(0,Yi.createContext)(null);function et(e,t){e.indexOf(t)===-1&&e.push(t)}function Ne(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var Y=(e,t,r)=>r>t?t:r<e?e:r;var Me=()=>{},ie=()=>{};var te={};var Kt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var _t=e=>typeof e=="object"&&e!==null;var $t=e=>/^0[^.\s]+$/u.test(e);function Yt(e){let t;return()=>(t===void 0&&(t=e()),t)}var j=e=>e;var ve=(...e)=>e.reduce((t,r)=>o=>r(t(o)));var we=(e,t,r)=>{let o=t-e;return o?(r-e)/o:1};var De=class{constructor(){this.subscriptions=[]}add(t){return et(this.subscriptions,t),()=>Ne(this.subscriptions,t)}notify(t,r,o){let n=this.subscriptions.length;if(n)if(n===1)this.subscriptions[0](t,r,o);else for(let s=0;s<n;s++){let i=this.subscriptions[s];i&&i(t,r,o)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var H=e=>e*1e3,Z=e=>e/1e3;var Xt=(e,t)=>t?e*(1e3/t):0;var Xi=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,wc=1e-7,Tc=12;function Sc(e,t,r,o,n){let s,i,a=0;do i=t+(r-t)/2,s=Xi(i,o,n)-e,s>0?r=i:t=i;while(Math.abs(s)>wc&&++a<Tc);return i}function je(e,t,r,o){if(e===t&&r===o)return j;let n=s=>Sc(s,0,1,e,r);return s=>s===0||s===1?s:Xi(n(s),t,o)}var Wr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Ur=e=>t=>1-e(1-t);var Hr=je(.33,1.53,.69,.99),bt=Ur(Hr),qt=Wr(bt);var Zt=e=>e>=1?1:(e*=2)<1?.5*bt(e):.5*(2-Math.pow(2,-10*(e-1)));var Jt=e=>1-Math.sin(Math.acos(e)),Qt=Ur(Jt),er=Wr(Jt);var vn=je(.42,0,1,1),bn=je(0,0,.58,1),tr=je(.42,0,.58,1);var wn=e=>Array.isArray(e)&&typeof e[0]!="number";var rr=e=>Array.isArray(e)&&typeof e[0]=="number";var qi={linear:j,easeIn:vn,easeInOut:tr,easeOut:bn,circIn:Jt,circInOut:er,circOut:Qt,backIn:bt,backInOut:qt,backOut:Hr,anticipate:Zt},Vc=e=>typeof e=="string",Kr=e=>{if(rr(e)){ie(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,o,n]=e;return je(t,r,o,n)}else if(Vc(e))return ie(qi[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),qi[e];return e};var or=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Zi(e){let t=new Set,r=new Set,o=!1,n=!1,s=new WeakSet,i={delta:0,timestamp:0,isProcessing:!1};function a(u){s.has(u)&&(c.schedule(u),e()),u(i)}let c={schedule:(u,l=!1,f=!1)=>{let p=f&&o?t:r;return l&&s.add(u),p.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(i=u,o){n=!0;return}o=!0;let l=t;t=r,r=l,t.forEach(a),t.clear(),o=!1,n&&(n=!1,c.process(u))}};return c}var Pc=40;function _r(e,t){let r=!1,o=!0,n={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,i=or.reduce((w,y)=>(w[y]=Zi(s),w),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:f,preRender:m,render:p,postRender:d}=i,h=()=>{let w=te.useManualTiming,y=w?n.timestamp:performance.now();r=!1,w||(n.delta=o?1e3/60:Math.max(Math.min(y-n.timestamp,Pc),1)),n.timestamp=y,n.isProcessing=!0,a.process(n),c.process(n),u.process(n),l.process(n),f.process(n),m.process(n),p.process(n),d.process(n),n.isProcessing=!1,r&&t&&(o=!1,e(h))},x=()=>{r=!0,o=!0,n.isProcessing||e(h)};return{schedule:or.reduce((w,y)=>{let T=i[y];return w[y]=(C,E=!1,P=!1)=>(r||x(),T.schedule(C,E,P)),w},{}),cancel:w=>{for(let y=0;y<or.length;y++)i[or[y]].cancel(w)},state:n,steps:i}}var{schedule:A,cancel:se,state:W,steps:nr}=_r(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:j,!0);var $r;function Cc(){$r=void 0}var z={now:()=>($r===void 0&&z.set(W.isProcessing||te.useManualTiming?W.timestamp:performance.now()),$r),set:e=>{$r=e,queueMicrotask(Cc)}};var Ji=e=>t=>typeof t=="string"&&t.startsWith(e),Yr=Ji("--"),Ec=Ji("var(--"),wt=e=>Ec(e)?Ac.test(e.split("/*")[0].trim()):!1,Ac=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Tn(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var Te={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Re={...Te,transform:e=>Y(0,1,e)},ir={...Te,default:1};var ze=e=>Math.round(e*1e5)/1e5;var Tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Qi(e){return e==null}var es=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var St=(e,t)=>r=>!!(typeof r=="string"&&es.test(r)&&r.startsWith(e)||t&&!Qi(r)&&Object.prototype.hasOwnProperty.call(r,t)),Xr=(e,t,r)=>o=>{if(typeof o!="string")return o;let[n,s,i,a]=o.match(Tt);return{[e]:parseFloat(n),[t]:parseFloat(s),[r]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}};var Mc=e=>Y(0,255,e),Sn={...Te,transform:e=>Math.round(Mc(e))},Se={test:St("rgb","red"),parse:Xr("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:o=1})=>"rgba("+Sn.transform(e)+", "+Sn.transform(t)+", "+Sn.transform(r)+", "+ze(Re.transform(o))+")"};function Dc(e){let t="",r="",o="",n="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),o=e.substring(5,7),n=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),o=e.substring(3,4),n=e.substring(4,5),t+=t,r+=r,o+=o,n+=n),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(o,16),alpha:n?parseInt(n,16)/255:1}}var sr={test:St("#"),parse:Dc,transform:Se.transform};var ar=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),de=ar("deg"),ee=ar("%"),S=ar("px"),Vn=ar("vh"),Pn=ar("vw"),qr={...ee,parse:e=>ee.parse(e)/100,transform:e=>ee.transform(e*100)};var Ge={test:St("hsl","hue"),parse:Xr("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:o=1})=>"hsla("+Math.round(e)+", "+ee.transform(ze(t))+", "+ee.transform(ze(r))+", "+ze(Re.transform(o))+")"};var O={test:e=>Se.test(e)||sr.test(e)||Ge.test(e),parse:e=>Se.test(e)?Se.parse(e):Ge.test(e)?Ge.parse(e):sr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Se.transform(e):Ge.transform(e),getAnimatableNone:e=>{let t=O.parse(e);return t.alpha=0,O.transform(t)}};var ts=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rc(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Tt))==null?void 0:t.length)||0)+(((r=e.match(ts))==null?void 0:r.length)||0)>0}var os="number",ns="color",kc="var",Lc="var(",rs="${}",Ic=/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 We(e){let t=e.toString(),r=[],o={color:[],number:[],var:[]},n=[],s=0,a=t.replace(Ic,c=>(O.test(c)?(o.color.push(s),n.push(ns),r.push(O.parse(c))):c.startsWith(Lc)?(o.var.push(s),n.push(kc),r.push(c)):(o.number.push(s),n.push(os),r.push(parseFloat(c))),++s,rs)).split(rs);return{values:r,split:a,indexes:o,types:n}}function Oc(e){return We(e).values}function is({split:e,types:t}){let r=e.length;return o=>{let n="";for(let s=0;s<r;s++)if(n+=e[s],o[s]!==void 0){let i=t[s];i===os?n+=ze(o[s]):i===ns?n+=O.transform(o[s]):n+=o[s]}return n}}function Bc(e){return is(We(e))}var Fc=e=>typeof e=="number"?0:O.test(e)?O.getAnimatableNone(e):e,Nc=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Fc(e);function jc(e){let t=We(e);return is(t)(t.values.map((o,n)=>Nc(o,t.split[n])))}var X={test:Rc,parse:Oc,createTransformer:Bc,getAnimatableNone:jc};function Cn(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function ss({hue:e,saturation:t,lightness:r,alpha:o}){e/=360,t/=100,r/=100;let n=0,s=0,i=0;if(!t)n=s=i=r;else{let a=r<.5?r*(1+t):r+t-r*t,c=2*r-a;n=Cn(c,a,e+1/3),s=Cn(c,a,e),i=Cn(c,a,e-1/3)}return{red:Math.round(n*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:o}}function Vt(e,t){return r=>r>0?t:e}var D=(e,t,r)=>e+(t-e)*r;var En=(e,t,r)=>{let o=e*e,n=r*(t*t-o)+o;return n<0?0:Math.sqrt(n)},zc=[sr,Se,Ge],Gc=e=>zc.find(t=>t.test(e));function as(e){let t=Gc(e);if(Me(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===Ge&&(r=ss(r)),r}var An=(e,t)=>{let r=as(e),o=as(t);if(!r||!o)return Vt(e,t);let n={...r};return s=>(n.red=En(r.red,o.red,s),n.green=En(r.green,o.green,s),n.blue=En(r.blue,o.blue,s),n.alpha=D(r.alpha,o.alpha,s),Se.transform(n))};var Zr=new Set(["none","hidden"]);function ls(e,t){return Zr.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function Wc(e,t){return r=>D(e,t,r)}function Jr(e){return typeof e=="number"?Wc:typeof e=="string"?wt(e)?Vt:O.test(e)?An:Kc:Array.isArray(e)?cs:typeof e=="object"?O.test(e)?An:Uc:Vt}function cs(e,t){let r=[...e],o=r.length,n=e.map((s,i)=>Jr(s)(s,t[i]));return s=>{for(let i=0;i<o;i++)r[i]=n[i](s);return r}}function Uc(e,t){let r={...e,...t},o={};for(let n in r)e[n]!==void 0&&t[n]!==void 0&&(o[n]=Jr(e[n])(e[n],t[n]));return n=>{for(let s in o)r[s]=o[s](n);return r}}function Hc(e,t){var n;let r=[],o={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){let i=t.types[s],a=e.indexes[i][o[i]],c=(n=e.values[a])!=null?n:0;r[s]=c,o[i]++}return r}var Kc=(e,t)=>{let r=X.createTransformer(t),o=We(e),n=We(t);return o.indexes.var.length===n.indexes.var.length&&o.indexes.color.length===n.indexes.color.length&&o.indexes.number.length>=n.indexes.number.length?Zr.has(e)&&!n.values.length||Zr.has(t)&&!o.values.length?ls(e,t):ve(cs(Hc(o,n),n.values),r):(Me(!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"),Vt(e,t))};function Qr(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?D(e,t,r):Jr(e)(e,t)}var us=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>A.update(t,r),stop:()=>se(t),now:()=>W.isProcessing?W.timestamp:z.now()}};var eo=(e,t,r=10)=>{let o="",n=Math.max(Math.round(t/r),2);for(let s=0;s<n;s++)o+=Math.round(e(s/(n-1))*1e4)/1e4+", ";return`linear(${o.substring(0,o.length-2)})`};function Pt(e){let t=0,r=50,o=e.next(t);for(;!o.done&&t<2e4;)t+=r,o=e.next(t);return t>=2e4?1/0:t}function fs(e,t=100,r){let o=r({...e,keyframes:[0,t]}),n=Math.min(Pt(o),2e4);return{type:"keyframes",ease:s=>o.next(n*s).value/t,duration:Z(n)}}var G={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Rn(e,t){return e*Math.sqrt(1-t*t)}var _c=12;function $c(e,t,r){let o=r;for(let n=1;n<_c;n++)o=o-e(o)/t(o);return o}var Dn=.001;function Yc({duration:e=G.duration,bounce:t=G.bounce,velocity:r=G.velocity,mass:o=G.mass}){let n,s;Me(e<=H(G.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Y(G.minDamping,G.maxDamping,i),e=Y(G.minDuration,G.maxDuration,Z(e)),i<1?(n=u=>{let l=u*i,f=l*e,m=l-r,p=Rn(u,i),d=Math.exp(-f);return Dn-m/p*d},s=u=>{let f=u*i*e,m=f*r+r,p=Math.pow(i,2)*Math.pow(u,2)*e,d=Math.exp(-f),h=Rn(Math.pow(u,2),i);return(-n(u)+Dn>0?-1:1)*((m-p)*d)/h}):(n=u=>{let l=Math.exp(-u*e),f=(u-r)*e+1;return-Dn+l*f},s=u=>{let l=Math.exp(-u*e),f=(r-u)*(e*e);return l*f});let a=5/e,c=$c(n,s,a);if(e=H(e),isNaN(c))return{stiffness:G.stiffness,damping:G.damping,duration:e};{let u=Math.pow(c,2)*o;return{stiffness:u,damping:i*2*Math.sqrt(o*u),duration:e}}}var Xc=["duration","bounce"],qc=["stiffness","damping","mass"];function ms(e,t){return t.some(r=>e[r]!==void 0)}function Zc(e){let t={velocity:G.velocity,stiffness:G.stiffness,damping:G.damping,mass:G.mass,isResolvedFromDuration:!1,...e};if(!ms(e,qc)&&ms(e,Xc))if(t.velocity=0,e.visualDuration){let r=e.visualDuration,o=2*Math.PI/(r*1.2),n=o*o,s=2*Y(.05,1,1-(e.bounce||0))*Math.sqrt(n);t={...t,mass:G.mass,stiffness:n,damping:s}}else{let r=Yc({...e,velocity:0});t={...t,...r,mass:G.mass},t.isResolvedFromDuration=!0}return t}function Ct(e=G.visualDuration,t=G.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:o,restDelta:n}=r,s=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:l,duration:f,velocity:m,isResolvedFromDuration:p}=Zc({...r,velocity:-Z(r.velocity||0)}),d=m||0,h=u/(2*Math.sqrt(c*l)),x=i-s,v=Z(Math.sqrt(c/l)),b=Math.abs(x)<5;o||(o=b?G.restSpeed.granular:G.restSpeed.default),n||(n=b?G.restDelta.granular:G.restDelta.default);let w,y,T,C,E,P;if(h<1)T=Rn(v,h),C=(d+h*v*x)/T,w=V=>{let I=Math.exp(-h*v*V);return i-I*(C*Math.sin(T*V)+x*Math.cos(T*V))},E=h*v*C+x*T,P=h*v*x-C*T,y=V=>Math.exp(-h*v*V)*(E*Math.sin(T*V)+P*Math.cos(T*V));else if(h===1){w=I=>i-Math.exp(-v*I)*(x+(d+v*x)*I);let V=d+v*x;y=I=>Math.exp(-v*I)*(v*V*I-d)}else{let V=v*Math.sqrt(h*h-1);w=M=>{let L=Math.exp(-h*v*M),F=Math.min(V*M,300);return i-L*((d+h*v*x)*Math.sinh(F)+V*x*Math.cosh(F))/V};let I=(d+h*v*x)/V,K=h*v*I-x*V,fe=h*v*x-I*V;y=M=>{let L=Math.exp(-h*v*M),F=Math.min(V*M,300);return L*(K*Math.sinh(F)+fe*Math.cosh(F))}}let U={calculatedDuration:p&&f||null,velocity:V=>H(y(V)),next:V=>{if(!p&&h<1){let K=Math.exp(-h*v*V),fe=Math.sin(T*V),M=Math.cos(T*V),L=i-K*(C*fe+x*M),F=H(K*(E*fe+P*M));return a.done=Math.abs(F)<=o&&Math.abs(i-L)<=n,a.value=a.done?i:L,a}let I=w(V);if(p)a.done=V>=f;else{let K=H(y(V));a.done=Math.abs(K)<=o&&Math.abs(i-I)<=n}return a.value=a.done?i:I,a},toString:()=>{let V=Math.min(Pt(U),2e4),I=eo(K=>U.next(V*K).value,V,30);return V+"ms "+I},toTransition:()=>{}};return U}Ct.applyToOptions=e=>{let t=fs(e,100,Ct);return e.ease=t.ease,e.duration=H(t.duration),e.type="keyframes",e};var Jc=5;function to(e,t,r){let o=Math.max(t-Jc,0);return Xt(r-e(o),t-o)}function lr({keyframes:e,velocity:t=0,power:r=.8,timeConstant:o=325,bounceDamping:n=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:u=.5,restSpeed:l}){let f=e[0],m={done:!1,value:f},p=P=>a!==void 0&&P<a||c!==void 0&&P>c,d=P=>a===void 0?c:c===void 0||Math.abs(a-P)<Math.abs(c-P)?a:c,h=r*t,x=f+h,v=i===void 0?x:i(x);v!==x&&(h=v-f);let b=P=>-h*Math.exp(-P/o),w=P=>v+b(P),y=P=>{let U=b(P),V=w(P);m.done=Math.abs(U)<=u,m.value=m.done?v:V},T,C,E=P=>{p(m.value)&&(T=P,C=Ct({keyframes:[m.value,d(m.value)],velocity:to(w,P,m.value),damping:n,stiffness:s,restDelta:u,restSpeed:l}))};return E(0),{calculatedDuration:null,next:P=>{let U=!1;return!C&&T===void 0&&(U=!0,y(P),E(P)),T!==void 0&&P>=T?C.next(P-T):(!U&&y(P),m)}}}function Qc(e,t,r){let o=[],n=r||te.mix||Qr,s=e.length-1;for(let i=0;i<s;i++){let a=n(e[i],e[i+1]);if(t){let c=Array.isArray(t)?t[i]||j:t;a=ve(c,a)}o.push(a)}return o}function ps(e,t,{clamp:r=!0,ease:o,mixer:n}={}){let s=e.length;if(ie(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];let i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=Qc(t,o,n),c=a.length,u=l=>{if(i&&l<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(l<e[f+1]);f++);let m=we(e[f],e[f+1],l);return a[f](m)};return r?l=>u(Y(e[0],e[s-1],l)):u}function ds(e,t){let r=e[e.length-1];for(let o=1;o<=t;o++){let n=we(0,t,o);e.push(D(r,1,n))}}function hs(e){let t=[0];return ds(t,e.length-1),t}function gs(e,t){return e.map(r=>r*t)}function eu(e,t){return e.map(()=>t||tr).splice(0,e.length-1)}function tt({duration:e=300,keyframes:t,times:r,ease:o="easeInOut"}){let n=wn(o)?o.map(Kr):Kr(o),s={done:!1,value:t[0]},i=gs(r&&r.length===t.length?r:hs(t),e),a=ps(i,t,{ease:Array.isArray(n)?n:eu(t,n)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}var tu=e=>e!==null;function Ue(e,{repeat:t,repeatType:r="loop"},o,n=1){let s=e.filter(tu),a=n<0||t&&r!=="loop"&&t%2===1?0:s.length-1;return!a||o===void 0?s[a]:o}var ru={decay:lr,inertia:lr,tween:tt,keyframes:tt,spring:Ct};function ro(e){typeof e.type=="string"&&(e.type=ru[e.type])}var He=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}};var ou=e=>e/100,ke=class extends He{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var o,n;let{motionValue:r}=this.options;r&&r.updatedAt!==z.now()&&this.tick(z.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(n=(o=this.options).onStop)==null||n.call(o))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;ro(t);let{type:r=tt,repeat:o=0,repeatDelay:n=0,repeatType:s,velocity:i=0}=t,{keyframes:a}=t,c=r||tt;c!==tt&&typeof a[0]!="number"&&(this.mixKeyframes=ve(ou,Qr(a[0],a[1])),a=[0,100]);let u=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=Pt(u));let{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+n,this.totalDuration=this.resolvedDuration*(o+1)-n,this.generator=u}updateTime(t){let r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){let{generator:o,totalDuration:n,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return o.next(0);let{delay:u=0,keyframes:l,repeat:f,repeatType:m,repeatDelay:p,type:d,onUpdate:h,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?v<0:v>n;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=n);let w=this.currentTime,y=o;if(f){let P=Math.min(this.currentTime,n)/a,U=Math.floor(P),V=P%1;!V&&P>=1&&(V=1),V===1&&U--,U=Math.min(U,f+1),!!(U%2)&&(m==="reverse"?(V=1-V,p&&(V-=p/a)):m==="mirror"&&(y=i)),w=Y(0,1,V)*a}let T;b?(this.delayState.value=l[0],T=this.delayState):T=y.next(w),s&&!b&&(T.value=s(T.value));let{done:C}=T;!b&&c!==null&&(C=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return E&&d!==lr&&(T.value=Ue(l,this.options,x,this.speed)),h&&h(T.value),E&&this.finish(),T}then(t,r){return this.finished.then(t,r)}get duration(){return Z(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Z(t)}get time(){return Z(this.currentTime)}set time(t){t=H(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),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let r=this.generator.next(t).value;return to(o=>this.generator.next(o).value,t,r)}get speed(){return this.playbackSpeed}set speed(t){let r=this.playbackSpeed!==t;r&&this.driver&&this.updateTime(z.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=Z(this.currentTime))}play(){var n,s;if(this.isStopped)return;let{driver:t=us,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(n=this.options).onPlay)==null||s.call(n);let o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=r!=null?r:o),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(z.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.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 r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}};function xs(e){var t;for(let r=1;r<e.length;r++)(t=e[r])!=null||(e[r]=e[r-1])}var rt=e=>e*180/Math.PI,kn=e=>{let t=rt(Math.atan2(e[1],e[0]));return Ln(t)},nu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:kn,rotateZ:kn,skewX:e=>rt(Math.atan(e[1])),skewY:e=>rt(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ln=e=>(e=e%360,e<0&&(e+=360),e),ys=kn,vs=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),bs=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),iu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:vs,scaleY:bs,scale:e=>(vs(e)+bs(e))/2,rotateX:e=>Ln(rt(Math.atan2(e[6],e[5]))),rotateY:e=>Ln(rt(Math.atan2(-e[2],e[0]))),rotateZ:ys,rotate:ys,skewX:e=>rt(Math.atan(e[4])),skewY:e=>rt(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function oo(e){return e.includes("scale")?1:0}function no(e,t){if(!e||e==="none")return oo(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),o,n;if(r)o=iu,n=r;else{let a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=nu,n=a}if(!n)return oo(t);let s=o[t],i=n[1].split(",").map(su);return typeof s=="function"?s(i):i[s]}var ws=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return no(r,t)};function su(e){return parseFloat(e.trim())}var Ve=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],he=new Set([...Ve,"pathRotation"]);var In=e=>e===Te||e===S,au=new Set(["x","y","z"]),lu=Ve.filter(e=>!au.has(e));function Ts(e){let t=[];return lu.forEach(r=>{let o=e.getValue(r);o!==void 0&&(t.push([r,o.get()]),o.set(r.startsWith("scale")?1:0))}),t}var Le={width:({x:e},{paddingLeft:t="0",paddingRight:r="0",boxSizing:o})=>{let n=e.max-e.min;return o==="border-box"?n:n-parseFloat(t)-parseFloat(r)},height:({y:e},{paddingTop:t="0",paddingBottom:r="0",boxSizing:o})=>{let n=e.max-e.min;return o==="border-box"?n:n-parseFloat(t)-parseFloat(r)},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})=>no(t,"x"),y:(e,{transform:t})=>no(t,"y")};Le.translateX=Le.x;Le.translateY=Le.y;var ot=new Set,On=!1,Bn=!1,Fn=!1;function Ss(){if(Bn){let e=Array.from(ot).filter(o=>o.needsMeasurement),t=new Set(e.map(o=>o.element)),r=new Map;t.forEach(o=>{let n=Ts(o);n.length&&(r.set(o,n),o.render())}),e.forEach(o=>o.measureInitialState()),t.forEach(o=>{o.render();let n=r.get(o);n&&n.forEach(([s,i])=>{var a;(a=o.getValue(s))==null||a.set(i)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}Bn=!1,On=!1,ot.forEach(e=>e.complete(Fn)),ot.clear()}function Vs(){ot.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Bn=!0)})}function Ps(){Fn=!0,Vs(),Ss(),Fn=!1}var Ke=class{constructor(t,r,o,n,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=o,this.motionValue=n,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(ot.add(this),On||(On=!0,A.read(Vs),A.resolveKeyframes(Ss))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:o,motionValue:n}=this;if(t[0]===null){let s=n==null?void 0:n.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(o&&r){let a=o.readValue(r,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),n&&s===void 0&&n.set(t[0])}xs(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ot.delete(this)}cancel(){this.state==="scheduled"&&(ot.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var Cs=e=>e.startsWith("--");function io(e,t,r){Cs(t)?e.style.setProperty(t,r):e.style[t]=r}var Es={};function so(e,t){let r=Yt(e);return()=>{var o;return(o=Es[t])!=null?o:r()}}var As=so(()=>window.ScrollTimeline!==void 0,"scrollTimeline");var ao=so(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing");var nt=([e,t,r,o])=>`cubic-bezier(${e}, ${t}, ${r}, ${o})`;var Nn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:nt([0,.65,.55,1]),circOut:nt([.55,0,1,.45]),backIn:nt([.31,.01,.66,-.59]),backOut:nt([.33,1.53,.69,.99])};function jn(e,t){if(e)return typeof e=="function"?ao()?eo(e,t):"ease-out":rr(e)?nt(e):Array.isArray(e)?e.map(r=>jn(r,t)||Nn.easeOut):Nn[e]}function Ms(e,t,r,{delay:o=0,duration:n=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){let l={[t]:r};c&&(l.offset=c);let f=jn(a,n);Array.isArray(f)&&(l.easing=f);let m={delay:o,duration:n,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return u&&(m.pseudoElement=u),e.animate(l,m)}function lo(e){return typeof e=="function"&&"applyToOptions"in e}function Ds({type:e,...t}){var r,o;return lo(e)&&ao()?e.applyToOptions(t):((r=t.duration)!=null||(t.duration=300),(o=t.ease)!=null||(t.ease="easeOut"),t)}var Et=class extends He{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;let{element:r,name:o,keyframes:n,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,ie(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let u=Ds(t);this.animation=Ms(r,o,n,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let l=Ue(n,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),io(r,o,l),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var r,o,n;let t=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((n=(o=this.animation).commitStyles)==null||n.call(o))}get duration(){var r,o;let t=((o=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:o.call(r).duration)||0;return Z(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Z(t)}get time(){return Z(Number(this.animation.currentTime)||0)}set time(t){let r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=H(t),r&&this.animation.pause()}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(){var t;return(t=this.manualStartTime)!=null?t:Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:r,rangeEnd:o,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&As()?(this.animation.timeline=t,r&&(this.animation.rangeStart=r),o&&(this.animation.rangeEnd=o),j):n(this)}};var Rs={anticipate:Zt,backInOut:qt,circInOut:er};function cu(e){return e in Rs}function ks(e){typeof e.ease=="string"&&cu(e.ease)&&(e.ease=Rs[e.ease])}var zn=10,co=class extends Et{constructor(t){ks(t),ro(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:r,onUpdate:o,onComplete:n,element:s,...i}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let a=new ke({...i,autoplay:!1}),c=Math.max(zn,z.now()-this.startTime),u=Y(0,zn,c-zn),l=a.sample(c).value,{name:f}=this.options;s&&f&&io(s,f,l),r.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}};var Gn=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(X.test(e)||e==="0")&&!e.startsWith("url("));function uu(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function Ls(e,t,r,o){let n=e[0];if(n===null)return!1;if(t==="display"||t==="visibility")return!0;let s=e[e.length-1],i=Gn(n,t),a=Gn(s,t);return Me(i===a,`You are trying to animate ${t} from "${n}" to "${s}". "${i?s:n}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:uu(e)||(r==="spring"||lo(r))&&o}function cr(e){e.duration=0,e.type="keyframes"}var uo=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);var fu=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Is(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&fu.test(e[t]))return!0;return!1}var mu=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),pu=Yt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Os(e){var f;let{motionValue:t,name:r,repeatDelay:o,repeatType:n,damping:s,type:i,keyframes:a}=e,c=(f=t==null?void 0:t.owner)==null?void 0:f.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:u,transformTemplate:l}=t.owner.getProps();return pu()&&r&&(uo.has(r)||mu.has(r)&&Is(a))&&(r!=="transform"||!l)&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}var du=40,fo=class extends He{constructor({autoplay:t=!0,delay:r=0,type:o="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:u,element:l,...f}){var d;super(),this.stop=()=>{var h,x;this._animation&&(this._animation.stop(),(h=this.stopTimeline)==null||h.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=z.now();let m={autoplay:t,delay:r,type:o,repeat:n,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:l,...f},p=(l==null?void 0:l.KeyframeResolver)||Ke;this.keyframeResolver=new p(a,(h,x,v)=>this.onKeyframesResolved(h,x,m,!v),c,u,l),(d=this.keyframeResolver)==null||d.scheduleResolve()}onKeyframesResolved(t,r,o,n){var v,b;this.keyframeResolver=void 0;let{name:s,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:l}=o;this.resolvedAt=z.now();let f=!0;Ls(t,s,i,a)||(f=!1,(te.instantAnimations||!c)&&(l==null||l(Ue(t,o,r))),t[0]=t[t.length-1],cr(o),o.repeat=0);let p={startTime:n?this.resolvedAt?this.resolvedAt-this.createdAt>du?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...o,keyframes:t},d=f&&!u&&Os(p),h=(b=(v=p.motionValue)==null?void 0:v.owner)==null?void 0:b.current,x;if(d)try{x=new co({...p,element:h})}catch(w){x=new ke(p)}else x=new ke(p);x.finished.then(()=>{this.notifyFinished()}).catch(j),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Ps()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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()}};function mo(e,t,r,o=0,n=1){let s=Array.from(e).sort((u,l)=>u.sortNodePosition(l)).indexOf(t),i=e.size,a=(i-1)*o;return typeof r=="function"?r(s,i):n===1?s*o:a-s*o}var Bs=30,hu=e=>!isNaN(parseFloat(e)),Fs={current:void 0},Wn=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{var s;let n=z.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(let i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=z.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=hu(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new De);let o=this.events[t].add(r);return t==="change"?()=>{o(),A.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,o){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-o}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&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 Fs.current&&Fs.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Bs)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,Bs);return Xt(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),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,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function be(e,t){return new Wn(e,t)}function po(e,t){if(e!=null&&e.inherit&&t){let{inherit:r,...o}=e;return{...t,...o}}return e}function At(e,t){var o,n;let r=(n=(o=e==null?void 0:e[t])!=null?o:e==null?void 0:e.default)!=null?n:e;return r!==e?po(r,e):r}var gu={type:"spring",stiffness:500,damping:25,restSpeed:10},xu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),yu={type:"keyframes",duration:.8},vu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ns=(e,{keyframes:t})=>t.length>2?yu:he.has(e)?e.startsWith("scale")?xu(t[1]):gu:vu;var bu=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function js(e){for(let t in e)if(!bu.has(t))return!0;return!1}var it=(e,t,r,o={},n,s)=>i=>{let a=At(o,e)||{},c=a.delay||o.delay||0,{elapsed:u=0}=o;u=u-H(c);let l={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:n};js(a)||Object.assign(l,Ns(e,l)),l.duration&&(l.duration=H(l.duration)),l.repeatDelay&&(l.repeatDelay=H(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let f=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(cr(l),l.delay===0&&(f=!0)),(te.instantAnimations||te.skipAnimations||n!=null&&n.shouldSkipAnimations||a.skipAnimations)&&(f=!0,cr(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){let m=Ue(l.keyframes,a);if(m!==void 0){A.update(()=>{l.onUpdate(m),l.onComplete()});return}}return a.isSync?new ke(l):new fo(l)};var wu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Tu(e){let t=wu.exec(e);if(!t)return[,];let[,r,o,n]=t;return[`--${r!=null?r:o}`,n]}var Su=4;function Un(e,t,r=1){ie(r<=Su,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[o,n]=Tu(e);if(!o)return;let s=window.getComputedStyle(t).getPropertyValue(o);if(s){let i=s.trim();return Kt(i)?parseFloat(i):i}return wt(n)?Un(n,t,r+1):n}function zs(e){let t=[{},{}];return e==null||e.values.forEach((r,o)=>{t[0][o]=r.get(),t[1][o]=r.getVelocity()}),t}function st(e,t,r,o){if(typeof t=="function"){let[n,s]=zs(o);t=t(r!==void 0?r:e.custom,n,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[n,s]=zs(o);t=t(r!==void 0?r:e.custom,n,s)}return t}function le(e,t,r){let o=e.getProps();return st(o,t,r!==void 0?r:o.custom,e)}var ho=new Set(["width","height","top","left","right","bottom",...Ve]);var ur=e=>Array.isArray(e);function Vu(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,be(r))}function Pu(e){return ur(e)?e[e.length-1]||0:e}function Gs(e,t){let r=le(e,t),{transitionEnd:o={},transition:n={},...s}=r||{};s={...s,...o};for(let i in s){let a=Pu(s[i]);Vu(e,i,a)}}var k=e=>!!(e&&e.getVelocity);function Ws(e){return!!(k(e)&&e.add)}function Mt(e,t){let r=e.getValue("willChange");if(Ws(r))return r.add(t);if(!r&&te.WillChange){let o=new te.WillChange("auto");e.addValue("willChange",o),o.add(t)}}function Dt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Us="framerAppearId",fr="data-"+Dt(Us);function go(e){return e.props[fr]}function Cu({protectedKeys:e,needsAnimating:t},r){let o=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,o}function xo(e,t,{delay:r=0,transitionOverride:o,type:n}={}){var d;let{transition:s,transitionEnd:i,...a}=t,c=e.getDefaultTransition();s=s?po(s,c):c;let u=s==null?void 0:s.reduceMotion,l=s==null?void 0:s.skipAnimations;o&&(s=o);let f=[],m=n&&e.animationState&&e.animationState.getState()[n],p=s==null?void 0:s.path;p&&p.animateVisualElement(e,a,s,r,f);for(let h in a){let x=e.getValue(h,(d=e.latestValues[h])!=null?d:null),v=a[h];if(v===void 0||m&&Cu(m,h))continue;let b={delay:r,...At(s||{},h)};l&&(b.skipAnimations=!0);let w=x.get();if(w!==void 0&&!x.isAnimating()&&!Array.isArray(v)&&v===w&&!b.velocity){A.update(()=>x.set(v));continue}let y=!1;if(window.MotionHandoffAnimation){let E=go(e);if(E){let P=window.MotionHandoffAnimation(E,h,A);P!==null&&(b.startTime=P,y=!0)}}Mt(e,h);let T=u!=null?u:e.shouldReduceMotion;x.start(it(h,x,v,T&&ho.has(h)?{type:!1}:b,e,y));let C=x.animation;C&&f.push(C)}if(i){let h=()=>A.update(()=>{i&&Gs(e,i)});f.length?Promise.all(f).then(h):h()}return f}function yo(e,t,r={}){var c;let o=le(e,t,r.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(n=r.transitionOverride);let s=o?()=>Promise.all(xo(e,o,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:l=0,staggerChildren:f,staggerDirection:m}=n;return Eu(e,t,u,l,f,m,r)}:()=>Promise.resolve(),{when:a}=n;if(a){let[u,l]=a==="beforeChildren"?[s,i]:[i,s];return u().then(()=>l())}else return Promise.all([s(),i(r.delay)])}function Eu(e,t,r=0,o=0,n=0,s=1,i){let a=[];for(let c of e.variantChildren)c.notify("AnimationStart",t),a.push(yo(c,t,{...i,delay:r+(typeof o=="function"?0:o)+mo(e.variantChildren,c,o,n,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Hs(e,t,r={}){e.notify("AnimationStart",t);let o;if(Array.isArray(t)){let n=t.map(s=>yo(e,s,r));o=Promise.all(n)}else if(typeof t=="string")o=yo(e,t,r);else{let n=typeof t=="function"?le(e,t,r.custom):t;o=Promise.all(xo(e,n,r))}return o.then(()=>{e.notify("AnimationComplete",t)})}var Ks={test:e=>e==="auto",parse:e=>e};var vo=e=>t=>t.test(e);var Hn=[Te,S,ee,de,Pn,Vn,Ks],Kn=e=>Hn.find(vo(e));function _s(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$t(e):!0}var Au=new Set(["brightness","contrast","saturate","opacity"]);function Mu(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[o]=r.match(Tt)||[];if(!o)return e;let n=r.replace(o,""),s=Au.has(t)?1:0;return o!==r&&(s*=100),t+"("+s+n+")"}var Du=/\b([a-z-]*)\(.*?\)/gu,mr={...X,getAnimatableNone:e=>{let t=e.match(Du);return t?t.map(Mu).join(" "):e}};var pr={...X,getAnimatableNone:e=>{let t=X.parse(e);return X.createTransformer(e)(t.map(o=>typeof o=="number"?0:typeof o=="object"?{...o,alpha:1}:o))}};var _n={...Te,transform:Math.round};var $s={rotate:de,pathRotation:de,rotateX:de,rotateY:de,rotateZ:de,scale:ir,scaleX:ir,scaleY:ir,scaleZ:ir,skew:de,skewX:de,skewY:de,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:Re,originX:qr,originY:qr,originZ:S};var at={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,inset:S,insetBlock:S,insetBlockStart:S,insetBlockEnd:S,insetInline:S,insetInlineStart:S,insetInlineEnd:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockStart:S,paddingBlockEnd:S,paddingInline:S,paddingInlineStart:S,paddingInlineEnd:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockStart:S,marginBlockEnd:S,marginInline:S,marginInlineStart:S,marginInlineEnd:S,fontSize:S,backgroundPositionX:S,backgroundPositionY:S,...$s,zIndex:_n,fillOpacity:Re,strokeOpacity:Re,numOctaves:_n};var Ru={...at,color:O,backgroundColor:O,outlineColor:O,fill:O,stroke:O,borderColor:O,borderTopColor:O,borderRightColor:O,borderBottomColor:O,borderLeftColor:O,filter:mr,WebkitFilter:mr,mask:pr,WebkitMask:pr},bo=e=>Ru[e];var ku=new Set([mr,pr]);function wo(e,t){let r=bo(e);return ku.has(r)||(r=X),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var Lu=new Set(["auto","none","0"]);function Ys(e,t,r){let o=0,n;for(;o<e.length&&!n;){let s=e[o];typeof s=="string"&&!Lu.has(s)&&We(s).values.length&&(n=e[o]),o++}if(n&&r)for(let s of t)e[s]=wo(r,n)}var To=class extends Ke{constructor(t,r,o,n,s){super(t,r,o,n,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:o}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let f=t[l];if(typeof f=="string"&&(f=f.trim(),wt(f))){let m=Un(f,r.current);m!==void 0&&(t[l]=m),l===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!ho.has(o)||t.length!==2)return;let[n,s]=t,i=Kn(n),a=Kn(s),c=Tn(n),u=Tn(s);if(c!==u&&Le[o]){this.needsMeasurement=!0;return}if(i!==a)if(In(i)&&In(a))for(let l=0;l<t.length;l++){let f=t[l];typeof f=="string"&&(t[l]=parseFloat(f))}else Le[o]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,o=[];for(let n=0;n<t.length;n++)(t[n]===null||_s(t[n]))&&o.push(n);o.length&&Ys(t,o,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:o}=this;if(!t||!t.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Le[o](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let n=r[r.length-1];n!==void 0&&t.getValue(o,n).jump(n,!1)}measureEndState(){var a;let{element:t,name:r,unresolvedKeyframes:o}=this;if(!t||!t.current)return;let n=t.getValue(r);n&&n.jump(this.measuredOrigin,!1);let s=o.length-1,i=o[s];o[s]=Le[r](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}};var dr=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function So(e,t,r){var o;if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;t&&(n=t.current);let s=(o=r==null?void 0:r[e])!=null?o:n.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(n=>n!=null)}var hr=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Xs(e){return _t(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var{schedule:lt,cancel:Iu}=_r(queueMicrotask,!1);var ge={x:!1,y:!1};function Vo(){return ge.x||ge.y}function $n(e){return e==="x"||e==="y"?ge[e]?null:(ge[e]=!0,()=>{ge[e]=!1}):ge.x||ge.y?null:(ge.x=ge.y=!0,()=>{ge.x=ge.y=!1})}function Po(e,t){let r=So(e),o=new AbortController,n={passive:!0,...t,signal:o.signal};return[r,n,()=>o.abort()]}function Ou(e){return!(e.pointerType==="touch"||Vo())}function Yn(e,t,r={}){let[o,n,s]=Po(e,r);return o.forEach(i=>{let a=!1,c=!1,u,l=()=>{i.removeEventListener("pointerleave",d)},f=x=>{u&&(u(x),u=void 0),l()},m=x=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,f(x))},p=()=>{a=!0,window.addEventListener("pointerup",m,n),window.addEventListener("pointercancel",m,n)},d=x=>{if(x.pointerType!=="touch"){if(a){c=!0;return}f(x)}},h=x=>{if(!Ou(x))return;c=!1;let v=t(i,x);typeof v=="function"&&(u=v,i.addEventListener("pointerleave",d,n))};i.addEventListener("pointerenter",h,n),i.addEventListener("pointerdown",p,n)}),s}var Xn=(e,t)=>t?e===t?!0:Xn(e,t.parentElement):!1;var ct=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var Bu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function qn(e){return Bu.has(e.tagName)||e.isContentEditable===!0}var Fu=new Set(["INPUT","SELECT","TEXTAREA"]);function Zn(e){return Fu.has(e.tagName)||e.isContentEditable===!0}var Rt=new WeakSet;function qs(e){return t=>{t.key==="Enter"&&e(t)}}function Jn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var Zs=(e,t)=>{let r=e.currentTarget;if(!r)return;let o=qs(()=>{if(Rt.has(r))return;Jn(r,"down");let n=qs(()=>{Jn(r,"up")}),s=()=>Jn(r,"cancel");r.addEventListener("keyup",n,t),r.addEventListener("blur",s,t)});r.addEventListener("keydown",o,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",o),t)};function Js(e){return ct(e)&&!Vo()}var Qs=new WeakSet;function Qn(e,t,r={}){let[o,n,s]=Po(e,r),i=a=>{let c=a.currentTarget;if(!Js(a)||Qs.has(a))return;Rt.add(c),r.stopPropagation&&Qs.add(a);let u=t(c,a),l={...n,capture:!0},f=(d,h)=>{window.removeEventListener("pointerup",m,l),window.removeEventListener("pointercancel",p,l),Rt.has(c)&&Rt.delete(c),Js(d)&&typeof u=="function"&&u(d,{success:h})},m=d=>{f(d,c===window||c===document||r.useGlobalTarget||Xn(c,d.target))},p=d=>{f(d,!1)};window.addEventListener("pointerup",m,l),window.addEventListener("pointercancel",p,l)};return o.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",i,n),Xs(a)&&(a.addEventListener("focus",u=>Zs(u,n)),!qn(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function kt(e){return _t(e)&&"ownerSVGElement"in e}var Co=new WeakMap,_e,ea=(e,t,r)=>(o,n)=>n&&n[0]?n[0][e+"Size"]:kt(o)&&"getBBox"in o?o.getBBox()[t]:o[r],Nu=ea("inline","width","offsetWidth"),ju=ea("block","height","offsetHeight");function zu({target:e,borderBoxSize:t}){var r;(r=Co.get(e))==null||r.forEach(o=>{o(e,{get width(){return Nu(e,t)},get height(){return ju(e,t)}})})}function Gu(e){e.forEach(zu)}function Wu(){typeof ResizeObserver!="undefined"&&(_e=new ResizeObserver(Gu))}function ta(e,t){_e||Wu();let r=So(e);return r.forEach(o=>{let n=Co.get(o);n||(n=new Set,Co.set(o,n)),n.add(t),_e==null||_e.observe(o)}),()=>{r.forEach(o=>{let n=Co.get(o);n==null||n.delete(t),n!=null&&n.size||_e==null||_e.unobserve(o)})}}var Eo=new Set,Lt;function Uu(){Lt=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Eo.forEach(t=>t(e))},window.addEventListener("resize",Lt)}function ra(e){return Eo.add(e),Lt||Uu(),()=>{Eo.delete(e),!Eo.size&&typeof Lt=="function"&&(window.removeEventListener("resize",Lt),Lt=void 0)}}function Ao(e,t){return typeof e=="function"?ra(e):ta(e,t)}var ut={value:null,addProjectionMetrics:null};function oa(e){return kt(e)&&e.tagName==="svg"}var Hu=[...Hn,O,X],na=e=>Hu.find(vo(e));var ei=()=>({translate:0,scale:1,origin:0,originPoint:0}),$e=()=>({x:ei(),y:ei()}),ti=()=>({min:0,max:0}),B=()=>({x:ti(),y:ti()});var ia=new WeakMap;function Ie(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Pe(e){return typeof e=="string"||Array.isArray(e)}var Mo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],gr=["initial",...Mo];function Ye(e){return Ie(e.animate)||gr.some(t=>Pe(e[t]))}function xr(e){return!!(Ye(e)||e.variants)}function sa(e,t,r){for(let o in t){let n=t[o],s=r[o];if(k(n))e.addValue(o,n);else if(k(s))e.addValue(o,be(n,{owner:e}));else if(s!==n)if(e.hasValue(o)){let i=e.getValue(o);i.liveStyle===!0?i.jump(n):i.hasAnimated||i.set(n)}else{let i=e.getStaticValue(o);e.addValue(o,be(i!==void 0?i:n,{owner:e}))}}for(let o in r)t[o]===void 0&&e.removeValue(o);return t}var yr={current:null},Do={current:!1};var Ku=typeof window!="undefined";function aa(){if(Do.current=!0,!!Ku)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yr.current=e.matches;e.addEventListener("change",t),t()}else yr.current=!1}var la=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ro={};function br(e){Ro=e}function ri(){return Ro}var vr=class{scrapeMotionValuesFromProps(t,r,o){return{}}constructor({parent:t,props:r,presenceContext:o,reducedMotionConfig:n,skipAnimations:s,blockInitialAnimation:i,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ke,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let p=z.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,A.render(this.render,!1,!0))};let{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=r.initial?{...u}:{},this.renderState=l,this.parent=t,this.props=r,this.presenceContext=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=Ye(r),this.isVariantNode=xr(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:f,...m}=this.scrapeMotionValuesFromProps(r,{},this);for(let p in m){let d=m[p];u[p]!==void 0&&k(d)&&d.set(u[p])}}mount(t){var r,o,n;if(this.hasBeenMounted)for(let s in this.initialValues)(r=this.values.get(s))==null||r.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,ia.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,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Do.current||aa(),this.shouldReduceMotion=yr.current),this.shouldSkipAnimations=(o=this.skipAnimationsConfig)!=null?o:!1,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),se(this.notifyUpdate),se(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(let r in this.events)this.events[r].clear();for(let r in this.features){let o=this.features[r];o&&(o.unmount(),o.isMounted=!1)}this.current=null}addChild(t){var r;this.children.add(t),(r=this.enteringChildren)!=null||(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),r.accelerate&&uo.has(t)&&this.current instanceof HTMLElement){let{factory:i,keyframes:a,times:c,ease:u,duration:l}=r.accelerate,f=new Et({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:H(l)}),m=i(f);this.valueSubscriptions.set(t,()=>{m(),f.cancel()});return}let o=he.has(t);o&&this.onBindTransform&&this.onBindTransform();let n=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&A.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),s;typeof window!="undefined"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{n(),s&&s()})}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 Ro){let r=Ro[t];if(!r)continue;let{isEnabled:o,Feature:n}=r;if(!this.features[t]&&n&&o(this.props)&&(this.features[t]=new n(this)),this.features[t]){let s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):B()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let o=0;o<la.length;o++){let n=la[o];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let s="on"+n,i=t[s];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=sa(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){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let o=this.values.get(t);r!==o&&(o&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let o=this.values.get(t);return o===void 0&&r!==void 0&&(o=be(r===null?void 0:r,{owner:this}),this.addValue(t,o)),o}readValue(t,r){var n;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!=null?n:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(Kt(o)||$t(o))?o=parseFloat(o):!na(o)&&X.test(r)&&(o=wo(t,r)),this.setBaseTarget(t,k(o)?o.get():o)),k(o)?o.get():o}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var s;let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let i=st(this.props,r,(s=this.presenceContext)==null?void 0:s.custom);i&&(o=i[t])}if(r&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!k(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new De),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){lt.render(this.render)}};var It=class extends vr{constructor(){super(...arguments),this.KeyframeResolver=To}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){let o=t.style;return o?o[r]:void 0}removeValueFromRenderState(t,{vars:r,style:o}){delete r[t],delete o[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;k(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};var q=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};function wr({top:e,left:t,right:r,bottom:o}){return{x:{min:t,max:r},y:{min:e,max:o}}}function oi({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ni(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:o.y,right:o.x}}function ii(e){return e===void 0||e===1}function ko({scale:e,scaleX:t,scaleY:r}){return!ii(e)||!ii(t)||!ii(r)}function Oe(e){return ko(e)||si(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function si(e){return ca(e.x)||ca(e.y)}function ca(e){return e&&e!=="0%"}function Tr(e,t,r){let o=e-r,n=t*o;return r+n}function ua(e,t,r,o,n){return n!==void 0&&(e=Tr(e,n,o)),Tr(e,r,o)+t}function ai(e,t=0,r=1,o,n){e.min=ua(e.min,t,r,o,n),e.max=ua(e.max,t,r,o,n)}function li(e,{x:t,y:r}){ai(e.x,t.translate,t.scale,t.originPoint),ai(e.y,r.translate,r.scale,r.originPoint)}var fa=.999999999999,ma=1.0000000000001;function ha(e,t,r,o=!1){var a;let n=r.length;if(!n)return;t.x=t.y=1;let s,i;for(let c=0;c<n;c++){s=r[c],i=s.projectionDelta;let{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(o&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(xe(e.x,-s.scroll.offset.x),xe(e.y,-s.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,li(e,i)),o&&Oe(s.latestValues)&&Sr(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<ma&&t.x>fa&&(t.x=1),t.y<ma&&t.y>fa&&(t.y=1)}function xe(e,t){e.min+=t,e.max+=t}function pa(e,t,r,o,n=.5){let s=D(e.min,e.max,n);ai(e,t,r,s,o)}function da(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Sr(e,t,r){let o=r!=null?r:e;pa(e.x,da(t.x,o.x),t.scaleX,t.scale,t.originX),pa(e.y,da(t.y,o.y),t.scaleY,t.scale,t.originY)}function Lo(e,t){return wr(ni(e.getBoundingClientRect(),t))}function ci(e,t,r){let o=Lo(e,r),{scroll:n}=t;return n&&(xe(o.x,n.offset.x),xe(o.y,n.offset.y)),o}var _u={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$u=Ve.length;function ga(e,t,r){let o="",n=!0;for(let i=0;i<$u;i++){let a=Ve[i],c=e[a];if(c===void 0)continue;let u=!0;if(typeof c=="number")u=c===(a.startsWith("scale")?1:0);else{let l=parseFloat(c);u=a.startsWith("scale")?l===1:l===0}if(!u||r){let l=hr(c,at[a]);if(!u){n=!1;let f=_u[a]||a;o+=`${f}(${l}) `}r&&(t[a]=l)}}let s=e.pathRotation;return s&&(n=!1,o+=`rotate(${hr(s,at.pathRotation)}) `),o=o.trim(),r?o=r(t,n?"":o):n&&(o="none"),o}function ft(e,t,r){let{style:o,vars:n,transformOrigin:s}=e,i=!1,a=!1;for(let c in t){let u=t[c];if(he.has(c)){i=!0;continue}else if(Yr(c)){n[c]=u;continue}else{let l=hr(u,at[c]);c.startsWith("origin")?(a=!0,s[c]=l):o[c]=l}}if(t.transform||(i||r?o.transform=ga(t,e.transform,r):o.transform&&(o.transform="none")),a){let{originX:c="50%",originY:u="50%",originZ:l=0}=s;o.transformOrigin=`${c} ${u} ${l}`}}function Io(e,{style:t,vars:r},o,n){let s=e.style,i;for(i in t)s[i]=t[i];n==null||n.applyProjectionStyles(s,o);for(i in r)s.setProperty(i,r[i])}function xa(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ot={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(S.test(e))e=parseFloat(e);else return e;let r=xa(e,t.target.x),o=xa(e,t.target.y);return`${r}% ${o}%`}};var ya={correct:(e,{treeScale:t,projectionDelta:r})=>{let o=e,n=X.parse(e);if(n.length>5)return o;let s=X.createTransformer(e),i=typeof n[0]!="number"?1:0,a=r.x.scale*t.x,c=r.y.scale*t.y;n[0+i]/=a,n[1+i]/=c;let u=D(a,c,.5);return typeof n[2+i]=="number"&&(n[2+i]/=u),typeof n[3+i]=="number"&&(n[3+i]/=u),s(n)}};var Vr={borderRadius:{...Ot,applyTo:[...dr]},borderTopLeftRadius:Ot,borderTopRightRadius:Ot,borderBottomLeftRadius:Ot,borderBottomRightRadius:Ot,boxShadow:ya};function Pr(e,{layout:t,layoutId:r}){return he.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Vr[e]||e==="opacity")}function mt(e,t,r){var i;let o=e.style,n=t==null?void 0:t.style,s={};if(!o)return s;for(let a in o)(k(o[a])||n&&k(n[a])||Pr(a,e)||((i=r==null?void 0:r.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=o[a]);return s}function Yu(e){return window.getComputedStyle(e)}var Cr=class extends It{constructor(){super(...arguments),this.type="html",this.renderInstance=Io}mount(t){ie(!!t.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,r){var o;if(he.has(r))return(o=this.projection)!=null&&o.isProjecting?oo(r):ws(t,r);{let n=Yu(t),s=(Yr(r)?n.getPropertyValue(r):n[r])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:r}){return Lo(t,r)}build(t,r,o){ft(t,r,o.transformTemplate)}scrapeMotionValuesFromProps(t,r,o){return mt(t,r,o)}};var Xu={offset:"stroke-dashoffset",array:"stroke-dasharray"},qu={offset:"strokeDashoffset",array:"strokeDasharray"};function va(e,t,r=1,o=0,n=!0){e.pathLength=1;let s=n?Xu:qu;e[s.offset]=`${-o}`,e[s.array]=`${t} ${r}`}var Zu=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Er(e,{attrX:t,attrY:r,attrScale:o,pathLength:n,pathSpacing:s=1,pathOffset:i=0,...a},c,u,l){var p,d;if(ft(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:m}=e;f.transform&&(m.transform=f.transform,delete f.transform),(m.transform||f.transformOrigin)&&(m.transformOrigin=(p=f.transformOrigin)!=null?p:"50% 50%",delete f.transformOrigin),m.transform&&(m.transformBox=(d=l==null?void 0:l.transformBox)!=null?d:"fill-box",delete f.transformBox);for(let h of Zu)f[h]!==void 0&&(m[h]=f[h],delete f[h]);t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),o!==void 0&&(f.scale=o),n!==void 0&&va(f,n,s,i,!1)}var Oo=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"]);var Ar=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ba(e,t,r,o){Io(e,t,void 0,o);for(let n in t.attrs)e.setAttribute(Oo.has(n)?n:Dt(n),t.attrs[n])}function Mr(e,t,r){let o=mt(e,t,r);for(let n in e)if(k(e[n])||k(t[n])){let s=Ve.indexOf(n)!==-1?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n;o[s]=e[n]}return o}var Dr=class extends It{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=B}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(he.has(r)){let o=bo(r);return o&&o.default||0}return r=Oo.has(r)?r:Dt(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,o){return Mr(t,r,o)}build(t,r,o){Er(t,r,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(t,r,o,n){ba(t,r,o,n)}mount(t){this.isSVGTag=Ar(t.tagName),super.mount(t)}};var Ju=gr.length;function ui(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?ui(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<Ju;r++){let o=gr[r],n=e.props[o];(Pe(n)||n===!1)&&(t[o]=n)}return t}function fi(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let o=0;o<r;o++)if(t[o]!==e[o])return!1;return!0}var Qu=[...Mo].reverse(),ef=Mo.length;function tf(e){return t=>Promise.all(t.map(({animation:r,options:o})=>Hs(e,r,o)))}function mi(e){let t=tf(e),r=wa(),o=!0,n=!1,s=u=>(l,f)=>{var p;let m=le(e,f,u==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(m){let{transition:d,transitionEnd:h,...x}=m;l={...l,...x,...h}}return l};function i(u){t=u(e)}function a(u){let{props:l}=e,f=ui(e.parent)||{},m=[],p=new Set,d={},h=1/0;for(let v=0;v<ef;v++){let b=Qu[v],w=r[b],y=l[b]!==void 0?l[b]:f[b],T=Pe(y),C=b===u?w.isActive:null;C===!1&&(h=v);let E=y===f[b]&&y!==l[b]&&T;if(E&&(o||n)&&e.manuallyAnimateOnMount&&(E=!1),w.protectedKeys={...d},!w.isActive&&C===null||!y&&!w.prevProp||Ie(y)||typeof y=="boolean")continue;if(b==="exit"&&w.isActive&&C!==!0){w.prevResolvedValues&&(d={...d,...w.prevResolvedValues});continue}let P=Ta(w.prevProp,y),U=P||b===u&&w.isActive&&!E&&T||v>h&&T,V=!1,I=Array.isArray(y)?y:[y],K=I.reduce(s(b),{});C===!1&&(K={});let{prevResolvedValues:fe={}}=w,M={...fe,...K},L=$=>{U=!0,p.has($)&&(V=!0,p.delete($)),w.needsAnimating[$]=!0;let oe=e.getValue($);oe&&(oe.liveStyle=!1)};for(let $ in M){let oe=K[$],me=fe[$];if(d.hasOwnProperty($))continue;let Fe=!1;ur(oe)&&ur(me)?Fe=!fi(oe,me)||P:Fe=oe!==me,Fe?oe!=null?L($):p.add($):oe!==void 0&&p.has($)?L($):w.protectedKeys[$]=!0}w.prevProp=y,w.prevResolvedValues=K,w.isActive&&(d={...d,...K}),(o||n)&&e.blockInitialAnimation&&(U=!1);let F=E&&P;U&&(!F||V)&&m.push(...I.map($=>{let oe={type:b};if(typeof $=="string"&&(o||n)&&!F&&e.manuallyAnimateOnMount&&e.parent){let{parent:me}=e,Fe=le(me,$);if(me.enteringChildren&&Fe){let{delayChildren:hn}=Fe.transition||{};oe.delay=mo(me.enteringChildren,e,hn)}}return{animation:$,options:oe}}))}if(p.size){let v={};if(typeof l.initial!="boolean"){let b=le(e,Array.isArray(l.initial)?l.initial[0]:l.initial);b&&b.transition&&(v.transition=b.transition)}p.forEach(b=>{let w=e.getBaseTarget(b),y=e.getValue(b);y&&(y.liveStyle=!0),v[b]=w!=null?w:null}),m.push({animation:v})}let x=!!m.length;return o&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(x=!1),o=!1,n=!1,x?t(m):Promise.resolve()}function c(u,l){var m;if(r[u].isActive===l)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(p=>{var d;return(d=p.animationState)==null?void 0:d.setActive(u,l)}),r[u].isActive=l;let f=a(u);for(let p in r)r[p].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>r,reset:()=>{r=wa(),n=!0}}}function Ta(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!fi(t,e):!1}function pt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wa(){return{animate:pt(!0),whileInView:pt(),whileHover:pt(),whileTap:pt(),whileDrag:pt(),whileFocus:pt(),exit:pt()}}function Bo(e,t){e.min=t.min,e.max=t.max}function ye(e,t){Bo(e.x,t.x),Bo(e.y,t.y)}function pi(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Sa=1e-4,rf=1-Sa,of=1+Sa,Va=.01,nf=0-Va,sf=0+Va;function _(e){return e.max-e.min}function xi(e,t,r){return Math.abs(e-t)<=r}function di(e,t,r,o=.5){e.origin=o,e.originPoint=D(t.min,t.max,e.origin),e.scale=_(r)/_(t),e.translate=D(r.min,r.max,e.origin)-e.originPoint,(e.scale>=rf&&e.scale<=of||isNaN(e.scale))&&(e.scale=1),(e.translate>=nf&&e.translate<=sf||isNaN(e.translate))&&(e.translate=0)}function dt(e,t,r,o){di(e.x,t.x,r.x,o?o.originX:void 0),di(e.y,t.y,r.y,o?o.originY:void 0)}function hi(e,t,r,o=0){let n=o?D(r.min,r.max,o):r.min;e.min=n+t.min,e.max=e.min+_(t)}function yi(e,t,r,o){hi(e.x,t.x,r.x,o==null?void 0:o.x),hi(e.y,t.y,r.y,o==null?void 0:o.y)}function gi(e,t,r,o=0){let n=o?D(r.min,r.max,o):r.min;e.min=t.min-n,e.max=e.min+_(t)}function Bt(e,t,r,o){gi(e.x,t.x,r.x,o==null?void 0:o.x),gi(e.y,t.y,r.y,o==null?void 0:o.y)}function Pa(e,t,r,o,n){return e-=t,e=Tr(e,1/r,o),n!==void 0&&(e=Tr(e,1/n,o)),e}function af(e,t=0,r=1,o=.5,n,s=e,i=e){if(ee.test(t)&&(t=parseFloat(t),t=D(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=D(s.min,s.max,o);e===s&&(a-=t),e.min=Pa(e.min,t,r,a,n),e.max=Pa(e.max,t,r,a,n)}function Ca(e,t,[r,o,n],s,i){af(e,t[r],t[o],t[n],t.scale,s,i)}var lf=["x","scaleX","originX"],cf=["y","scaleY","originY"];function vi(e,t,r,o){Ca(e.x,t,lf,r?r.x:void 0,o?o.x:void 0),Ca(e.y,t,cf,r?r.y:void 0,o?o.y:void 0)}function Ea(e){return e.translate===0&&e.scale===1}function bi(e){return Ea(e.x)&&Ea(e.y)}function Aa(e,t){return e.min===t.min&&e.max===t.max}function Da(e,t){return Aa(e.x,t.x)&&Aa(e.y,t.y)}function Ma(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wi(e,t){return Ma(e.x,t.x)&&Ma(e.y,t.y)}function Ti(e){return _(e.x)/_(e.y)}function Si(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ce(e){return[e("x"),e("y")]}function Ra(e,t,r){let o="",n=e.x.translate/t.x,s=e.y.translate/t.y,i=(r==null?void 0:r.z)||0;if((n||s||i)&&(o=`translate3d(${n}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:l,pathRotation:f,rotateX:m,rotateY:p,skewX:d,skewY:h}=r;u&&(o=`perspective(${u}px) ${o}`),l&&(o+=`rotate(${l}deg) `),f&&(o+=`rotate(${f}deg) `),m&&(o+=`rotateX(${m}deg) `),p&&(o+=`rotateY(${p}deg) `),d&&(o+=`skewX(${d}deg) `),h&&(o+=`skewY(${h}deg) `)}let a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(o+=`scale(${a}, ${c})`),o||"none"}var uf=dr.length,ka=e=>typeof e=="string"?parseFloat(e):e,La=e=>typeof e=="number"||S.test(e);function Oa(e,t,r,o,n,s){var i,a,c,u;n?(e.opacity=D(0,(i=r.opacity)!=null?i:1,ff(o)),e.opacityExit=D((a=t.opacity)!=null?a:1,0,mf(o))):s&&(e.opacity=D((c=t.opacity)!=null?c:1,(u=r.opacity)!=null?u:1,o));for(let l=0;l<uf;l++){let f=dr[l],m=Ia(t,f),p=Ia(r,f);if(m===void 0&&p===void 0)continue;m||(m=0),p||(p=0),m===0||p===0||La(m)===La(p)?(e[f]=Math.max(D(ka(m),ka(p),o),0),(ee.test(p)||ee.test(m))&&(e[f]+="%")):e[f]=p}(t.rotate||r.rotate)&&(e.rotate=D(t.rotate||0,r.rotate||0,o))}function Ia(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var ff=Ba(0,.5,Qt),mf=Ba(.5,.95,j);function Ba(e,t,r){return o=>o<e?0:o>t?1:r(we(e,t,o))}function Fa(e,t,r){let o=k(e)?e:be(e);return o.start(it("",o,t,r)),o.animation}function Ce(e,t,r,o={passive:!0}){return e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o)}var Na=(e,t)=>e.depth-t.depth;var Fo=class{constructor(){this.children=[],this.isDirty=!1}add(t){et(this.children,t),this.isDirty=!0}remove(t){Ne(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Na),this.isDirty=!1,this.children.forEach(t)}};function ja(e,t){let r=z.now(),o=({timestamp:n})=>{let s=n-r;s>=t&&(se(o),e(s-t))};return A.setup(o,!0),()=>se(o)}function ht(e){return k(e)?e.get():e}var No=class{constructor(){this.members=[]}add(t){et(this.members,t);for(let r=this.members.length-1;r>=0;r--){let o=this.members[r];if(o===t||o===this.lead||o===this.prevLead)continue;let n=o.instance;(!n||n.isConnected===!1)&&!o.snapshot&&(Ne(this.members,o),o.unmount())}t.scheduleRender()}remove(t){if(Ne(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){var r;for(let o=this.members.indexOf(t)-1;o>=0;o--){let n=this.members[o];if(n.isPresent!==!1&&((r=n.instance)==null?void 0:r.isConnected)!==!1)return this.promote(n),!0}return!1}promote(t,r){var n;let o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.updateSnapshot(),t.scheduleRender();let{layoutDependency:s}=o.options,{layoutDependency:i}=t.options;(s===void 0||s!==i)&&(t.resumeFrom=o,r&&(o.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),(n=t.root)!=null&&n.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var r,o,n,s,i;(o=(r=t.options).onExitComplete)==null||o.call(r),(i=(n=t.resumingFrom)==null?void 0:(s=n.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}};var gt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var xt={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Vi=["","X","Y","Z"],pf=1e3,df=0;function Pi(e,t,r,o){let{latestValues:n}=t;n[e]&&(r[e]=n[e],t.setStaticValue(e,0),o&&(o[e]=0))}function Ya(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=go(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:n,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",A,!(n||s))}let{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&Ya(o)}function jo({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:o,resetTransform:n}){return class{constructor(i={},a=t==null?void 0:t()){this.id=df++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ut.value&&(xt.nodes=xt.calculatedTargetDeltas=xt.calculatedProjections=0),this.nodes.forEach(xf),this.nodes.forEach(Sf),this.nodes.forEach(Vf),this.nodes.forEach(yf),ut.addProjectionMetrics&&ut.addProjectionMetrics(xt)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Fo)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new De),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){let c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=kt(i)&&!oa(i),this.instance=i;let{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let l,f=0,m=()=>this.root.updateBlockedByResize=!1;A.read(()=>{f=window.innerWidth}),e(i,()=>{let p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,l&&l(),l=ja(m,250),gt.hasAnimatedSinceResize&&(gt.hasAnimatedSinceResize=!1,this.nodes.forEach(Wa)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let d=this.options.transition||u.getDefaultTransition()||Mf,{onLayoutAnimationStart:h,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!wi(this.targetLayout,p),b=!f&&m;if(this.options.layoutRoot||this.resumeFrom||b||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let w={...At(d,"layout"),onPlay:h,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(l,b,w.path)}else f||Wa(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),se(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Pf),this.animationId++)}getTransformTemplate(){let{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ya(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){let f=this.path[l];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}let{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(bf),this.nodes.forEach(za);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ga);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(wf),this.nodes.forEach(Tf),this.nodes.forEach(hf),this.nodes.forEach(gf)):this.nodes.forEach(Ga),this.clearAllSnapshots();let a=z.now();W.delta=Y(0,1e3/60,a-W.timestamp),W.timestamp=a,W.isProcessing=!0,nr.update.process(W),nr.preRender.process(W),nr.render.process(W),W.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,lt.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(vf),this.sharedNodes.forEach(Cf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,A.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){A.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!_(this.snapshot.measuredBox.x)&&!_(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();let i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=B()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){let c=o(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!n)return;let i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!bi(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||Oe(this.latestValues)||l)&&(n(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){let a=this.measurePageBox(),c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),Df(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;let{visualElement:i}=this.options;if(!i)return B();let a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Rf))){let{scroll:l}=this.root;l&&(xe(a.x,l.offset.x),xe(a.y,l.offset.y))}return a}removeElementScroll(i){var c;let a=B();if(ye(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let u=0;u<this.path.length;u++){let l=this.path[u],{scroll:f,options:m}=l;l!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&ye(a,i),xe(a.x,f.offset.x),xe(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var l,f;let u=c||B();ye(u,i);for(let m=0;m<this.path.length;m++){let p=this.path[m];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(xe(u.x,-p.scroll.offset.x),xe(u.y,-p.scroll.offset.y)),Oe(p.latestValues)&&Sr(u,p.latestValues,(l=p.layout)==null?void 0:l.layoutBox)}return Oe(this.latestValues)&&Sr(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;let a=B();ye(a,i);for(let u=0;u<this.path.length;u++){let l=this.path[u];if(!Oe(l.latestValues))continue;let f;l.instance&&(ko(l.latestValues)&&l.updateSnapshot(),f=B(),ye(f,l.measurePageBox())),vi(a,l.latestValues,(c=l.snapshot)==null?void 0:c.layoutBox,f)}return Oe(this.latestValues)&&vi(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==W.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var p;let a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);let c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:l,layoutId:f}=this.options;if(!this.layout||!(l||f))return;this.resolvedRelativeTargetAt=W.timestamp;let m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=B(),this.targetWithTransforms=B()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),yi(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ye(this.target,this.layout.layoutBox),li(this.target,this.targetDelta)):ye(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0),ut.value&&xt.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||ko(this.parent.latestValues)||si(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=B(),this.relativeTargetOrigin=B(),Bt(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),ye(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var d;let i=this.getLead(),a=!!this.resumingFrom||this!==i,c=!0;if((this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===W.timestamp&&(c=!1),c)return;let{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;ye(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;ha(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=B());let{target:p}=i;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(pi(this.prevProjectionDelta.x,this.projectionDelta.x),pi(this.prevProjectionDelta.y,this.projectionDelta.y)),dt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Si(this.projectionDelta.x,this.prevProjectionDelta.x)||!Si(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),ut.value&&xt.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){let c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=$e(),this.projectionDelta=$e(),this.projectionDeltaWithTransform=$e()}setAnimationOrigin(i,a=!1,c){let u=this.snapshot,l=u?u.latestValues:{},f={...this.latestValues},m=$e();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let p=B(),d=u?u.source:void 0,h=this.layout?this.layout.source:void 0,x=d!==h,v=this.getStack(),b=!v||v.members.length<=1,w=!!(x&&!b&&this.options.crossfade===!0&&!this.path.some(Af));this.animationProgress=0;let y,T=c==null?void 0:c.interpolateProjection(i);this.mixTargetDelta=C=>{let E=C/1e3,P=T==null?void 0:T(E);P?(m.x.translate=P.x,m.x.scale=D(i.x.scale,1,E),m.x.origin=i.x.origin,m.x.originPoint=i.x.originPoint,m.y.translate=P.y,m.y.scale=D(i.y.scale,1,E),m.y.origin=i.y.origin,m.y.originPoint=i.y.originPoint):(Ua(m.x,i.x,E),Ua(m.y,i.y,E)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Bt(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ef(this.relativeTarget,this.relativeTargetOrigin,p,E),y&&Da(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=B()),ye(y,this.relativeTarget)),x&&(this.animationValues=f,Oa(f,l,this.latestValues,E,w,b)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(se(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=A.update(()=>{gt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=be(0)),this.motionValue.jump(0,!1),this.currentAnimation=Fa(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:l=>{this.mixTargetDelta(l),i.onUpdate&&i.onUpdate(l)},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(pf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let i=this.getLead(),{targetWithTransforms:a,target:c,layout:u,latestValues:l}=i;if(!(!a||!c||!u)){if(this!==i&&this.layout&&u&&Xa(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||B();let f=_(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;let m=_(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+m}ye(a,c),Sr(a,l),dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new No),this.sharedNodes.get(i).add(a);let u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){let i=this.getStack();return i?i.lead===this:!0}getLead(){var a;let{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;let{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){let{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){let u=this.getStack();u&&u.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){let i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){let{visualElement:i}=this.options;if(!i)return;let a=!1,{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;let u={};c.z&&Pi("z",i,u,this.animationValues);for(let l=0;l<Vi.length;l++)Pi(`rotate${Vi[l]}`,i,u,this.animationValues),Pi(`skew${Vi[l]}`,i,u,this.animationValues);i.render();for(let l in u)i.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);i.scheduleRender()}applyProjectionStyles(i,a){var d,h;if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}let c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=ht(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}let u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=ht(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Oe(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";let l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Ra(this.projectionDeltaWithTransform,this.treeScale,l);c&&(f=c(l,f)),i.transform=f;let{x:m,y:p}=this.projectionDelta;i.transformOrigin=`${m.origin*100}% ${p.origin*100}% 0`,u.animationValues?i.opacity=u===this?(h=(d=l.opacity)!=null?d:this.latestValues.opacity)!=null?h:1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:i.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(let x in Vr){if(l[x]===void 0)continue;let{correct:v,applyTo:b,isCSSVariable:w}=Vr[x],y=f==="none"?l[x]:v(l[x],u);if(b){let T=b.length;for(let C=0;C<T;C++)i[b[C]]=y}else w?this.options.visualElement.renderState.vars[x]=y:i[x]=y}this.options.layoutId&&(i.pointerEvents=u===this?ht(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(za),this.root.sharedNodes.clear()}}}function hf(e){e.updateLayout()}function gf(e){var r;let t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:o,measuredBox:n}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;if(s==="size")ce(f=>{let m=i?t.measuredBox[f]:t.layoutBox[f],p=_(m);m.min=o[f].min,m.max=m.min+p});else if(s==="x"||s==="y"){let f=s==="x"?"y":"x";Bo(i?t.measuredBox[f]:t.layoutBox[f],o[f])}else Xa(s,t.layoutBox,o)&&ce(f=>{let m=i?t.measuredBox[f]:t.layoutBox[f],p=_(o[f]);m.max=m.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});let a=$e();dt(a,o,t.layoutBox);let c=$e();i?dt(c,e.applyTransform(n,!0),t.measuredBox):dt(c,o,t.layoutBox);let u=!bi(a),l=!1;if(!e.resumeFrom){let f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){let{snapshot:m,layout:p}=f;if(m&&p){let d=e.options.layoutAnchor||void 0,h=B();Bt(h,t.layoutBox,m.layoutBox,d);let x=B();Bt(x,o,p.layoutBox,d),wi(h,x)||(l=!0),f.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=h,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:o}=e.options;o&&o()}e.options.transition=void 0}function xf(e){ut.value&&xt.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function yf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function vf(e){e.clearSnapshot()}function za(e){e.clearMeasurements()}function bf(e){e.isLayoutDirty=!0,e.updateLayout()}function Ga(e){e.isLayoutDirty=!1}function wf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Tf(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wa(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Sf(e){e.resolveTargetDelta()}function Vf(e){e.calcProjection()}function Pf(e){e.resetSkewAndRotation()}function Cf(e){e.removeLeadSnapshot()}function Ua(e,t,r){e.translate=D(t.translate,0,r),e.scale=D(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function Ha(e,t,r,o){e.min=D(t.min,r.min,o),e.max=D(t.max,r.max,o)}function Ef(e,t,r,o){Ha(e.x,t.x,r.x,o),Ha(e.y,t.y,r.y,o)}function Af(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Mf={duration:.45,ease:[.4,0,.1,1]},Ka=e=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),_a=Ka("applewebkit/")&&!Ka("chrome/")?Math.round:j;function $a(e){e.min=_a(e.min),e.max=_a(e.max)}function Df(e){$a(e.x),$a(e.y)}function Xa(e,t,r){return e==="position"||e==="preserve-aspect"&&!xi(Ti(t),Ti(r),.2)}function Rf(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}var qa=jo({attachResizeListener:(e,t)=>Ce(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0});var zo={current:void 0},Rr=jo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!zo.current){let e=new qa({});e.mount(window),e.setOptions({layoutScroll:!0}),zo.current=e}return zo.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var Za=require("react"),Go=(0,Za.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Xe=require("react");function Ja(e=!0){let t=(0,Xe.useContext)(vt);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:o,register:n}=t,s=(0,Xe.useId)();(0,Xe.useEffect)(()=>{if(e)return n(s)},[e]);let i=(0,Xe.useCallback)(()=>e&&o&&o(s),[s,o,e]);return!r&&o?[!1,i]:[!0]}var Qa=require("react"),Wo=(0,Qa.createContext)({strict:!1});var el={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"]},tl=!1;function kf(){if(tl)return;let e={};for(let t in el)e[t]={isEnabled:r=>el[t].some(o=>!!r[o])};br(e),tl=!0}function Uo(){return kf(),ri()}function rl(e){let t=Uo();for(let r in e)t[r]={...t[r],...e[r]};br(t)}var Lf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function kr(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Lf.has(e)}var ol=e=>!kr(e);function If(e){typeof e=="function"&&(ol=t=>t.startsWith("on")?!kr(t):e(t))}try{If(require("@emotion/is-prop-valid").default)}catch(e){}function nl(e,t,r){let o={};for(let n in e)n==="values"&&typeof e.values=="object"||k(e[n])||(ol(n)||r===!0&&kr(n)||!t&&!kr(n)||e.draggable&&n.startsWith("onDrag"))&&(o[n]=e[n]);return o}var Yo=require("react/jsx-runtime");var zt=require("react");var il=require("react"),qe=(0,il.createContext)({});var Ho=require("react");function sl(e,t){if(Ye(e)){let{initial:r,animate:o}=e;return{initial:r===!1||Pe(r)?r:void 0,animate:Pe(o)?o:void 0}}return e.inherit!==!1?t:{}}function ll(e){let{initial:t,animate:r}=sl(e,(0,Ho.useContext)(qe));return(0,Ho.useMemo)(()=>({initial:t,animate:r}),[al(t),al(r)])}function al(e){return Array.isArray(e)?e.join(" "):e}var jt=require("react");var cl=require("react");var Ft=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ci(e,t,r){for(let o in t)!k(t[o])&&!Pr(o,r)&&(e[o]=t[o])}function Of({transformTemplate:e},t){return(0,cl.useMemo)(()=>{let r=Ft();return ft(r,t,e),Object.assign({},r.vars,r.style)},[t])}function Bf(e,t){let r=e.style||{},o={};return Ci(o,r,e),Object.assign(o,Of(e,t)),o}function ul(e,t){let r={},o=Bf(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}var fl=require("react");var Ko=()=>({...Ft(),attrs:{}});function ml(e,t,r,o){let n=(0,fl.useMemo)(()=>{let s=Ko();return Er(s,t,Ar(o),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let s={};Ci(s,e.style,e),n.style={...s,...n.style}}return n}var pl=["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 Nt(e){return typeof e!="string"||e.includes("-")?!1:!!(pl.indexOf(e)>-1||/[A-Z]/u.test(e))}function dl(e,t,r,{latestValues:o},n,s=!1,i){let c=((i!=null?i:Nt(e))?ml:ul)(t,o,n,e),u=nl(t,typeof e=="string",s),l=e!==jt.Fragment?{...u,...c,ref:r}:{},{children:f}=t,m=(0,jt.useMemo)(()=>k(f)?f.get():f,[f]);return(0,jt.createElement)(e,{...l,children:m})}var Ei=require("react");function Ff({scrapeMotionValuesFromProps:e,createRenderState:t},r,o,n){return{latestValues:Nf(r,o,n,e),renderState:t()}}function Nf(e,t,r,o){let n={},s=o(e,{});for(let m in s)n[m]=ht(s[m]);let{initial:i,animate:a}=e,c=Ye(e),u=xr(e);t&&u&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let l=r?r.initial===!1:!1;l=l||i===!1;let f=l?a:i;if(f&&typeof f!="boolean"&&!Ie(f)){let m=Array.isArray(f)?f:[f];for(let p=0;p<m.length;p++){let d=st(e,m[p]);if(d){let{transitionEnd:h,transition:x,...v}=d;for(let b in v){let w=v[b];if(Array.isArray(w)){let y=l?w.length-1:0;w=w[y]}w!==null&&(n[b]=w)}for(let b in h)n[b]=h[b]}}}return n}var _o=e=>(t,r)=>{let o=(0,Ei.useContext)(qe),n=(0,Ei.useContext)(vt),s=()=>Ff(e,t,o,n);return r?s():Ki(s)};var hl=_o({scrapeMotionValuesFromProps:mt,createRenderState:Ft});var gl=_o({scrapeMotionValuesFromProps:Mr,createRenderState:Ko});var xl=Symbol.for("motionComponentSymbol");var yt=require("react");function yl(e,t,r){let o=(0,yt.useRef)(r);(0,yt.useInsertionEffect)(()=>{o.current=r});let n=(0,yt.useRef)(null);return(0,yt.useCallback)(s=>{var a;s&&((a=e.onMount)==null||a.call(e,s)),t&&(s?t.mount(s):t.unmount());let i=o.current;if(typeof i=="function")if(s){let c=i(s);typeof c=="function"&&(n.current=c)}else n.current?(n.current(),n.current=null):i(s);else i&&(i.current=s)},[t])}var re=require("react");var vl=require("react"),$o=(0,vl.createContext)({});function Ze(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function bl(e,t,r,o,n,s){var w,y;let{visualElement:i}=(0,re.useContext)(qe),a=(0,re.useContext)(Wo),c=(0,re.useContext)(vt),u=(0,re.useContext)(Go),l=u.reducedMotion,f=u.skipAnimations,m=(0,re.useRef)(null),p=(0,re.useRef)(!1);o=o||a.renderer,!m.current&&o&&(m.current=o(e,{visualState:t,parent:i,props:r,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:f,isSVG:s}),p.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let d=m.current,h=(0,re.useContext)($o);d&&!d.projection&&n&&(d.type==="html"||d.type==="svg")&&jf(m.current,r,n,h);let x=(0,re.useRef)(!1);(0,re.useInsertionEffect)(()=>{d&&x.current&&d.update(r,c)});let v=r[fr],b=(0,re.useRef)(!!v&&typeof window!="undefined"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,v))&&((y=window.MotionHasOptimisedAnimation)==null?void 0:y.call(window,v)));return $i(()=>{p.current=!0,d&&(x.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),b.current&&d.animationState&&d.animationState.animateChanges())}),(0,re.useEffect)(()=>{d&&(!b.current&&d.animationState&&d.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,v)}),b.current=!1),d.enteringChildren=void 0)}),d}function jf(e,t,r,o){let{layoutId:n,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:l,layoutCrossfade:f}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:wl(e.parent)),e.projection.setOptions({layoutId:n,layout:s,alwaysMeasureLayout:!!i||a&&Ze(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:o,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:l})}function wl(e){if(e)return e.options.allowProjection!==!1?e.projection:wl(e.parent)}function Xo(e,{forwardMotionProps:t=!1,type:r}={},o,n){var u,l;o&&rl(o);let s=r?r==="svg":Nt(e),i=s?gl:hl;function a(f,m){let p,d={...(0,zt.useContext)(Go),...f,layoutId:zf(f)},{isStatic:h}=d,x=ll(f),v=i(f,h);if(!h&&typeof window!="undefined"){Gf(d,o);let b=Wf(d);p=b.MeasureLayout,x.visualElement=bl(e,v,d,n,b.ProjectionNode,s)}return(0,Yo.jsxs)(qe.Provider,{value:x,children:[p&&x.visualElement?(0,Yo.jsx)(p,{visualElement:x.visualElement,...d}):null,dl(e,f,yl(v,x.visualElement,m),v,h,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${(l=(u=e.displayName)!=null?u:e.name)!=null?l:""})`}`;let c=(0,zt.forwardRef)(a);return c[xl]=e,c}function zf({layoutId:e}){let t=(0,zt.useContext)(zr).id;return t&&e!==void 0?t+"-"+e:e}function Gf(e,t){let r=(0,zt.useContext)(Wo).strict}function Wf(e){let t=Uo(),{drag:r,layout:o}=t;if(!r&&!o)return{};let n={...r,...o};return{MeasureLayout:r!=null&&r.isEnabled(e)||o!=null&&o.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function Tl(e,t){if(typeof Proxy=="undefined")return Xo;let r=new Map,o=(s,i)=>Xo(s,i,e,t),n=(s,i)=>o(s,i);return new Proxy(n,{get:(s,i)=>i==="create"?o:(r.has(i)||r.set(i,Xo(i,void 0,e,t)),r.get(i))})}var Sl=require("react");var Vl=(e,t)=>{var o;return((o=t.isSVG)!=null?o:Nt(e))?new Dr(t):new Cr(t,{allowProjection:e!==Sl.Fragment})};var qo=class extends q{constructor(t){super(t),t.animationState||(t.animationState=mi(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();Ie(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}};var Uf=0,Zo=class extends q{constructor(){super(...arguments),this.id=Uf++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)return;if(t&&o===!1){if(this.isExitComplete){let{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"||typeof i=="object"&&i!==null&&!Array.isArray(i)){let c=le(this.node,i,a);if(c){let{transition:u,transitionEnd:l,...f}=c;for(let m in f)(s=this.node.getValue(m))==null||s.jump(f[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let n=this.node.animationState.setActive("exit",!t);r&&!t&&n.then(()=>{this.isExitComplete=!0,r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var Pl={animation:{Feature:qo},exit:{Feature:Zo}};function Be(e){return{point:{x:e.pageX,y:e.pageY}}}var Cl=e=>t=>ct(t)&&e(t,Be(t));function Je(e,t,r,o){return Ce(e,t,Cl(r),o)}var Jo=({current:e})=>e?e.ownerDocument.defaultView:null;var El=(e,t)=>Math.abs(e-t);function Al(e,t){let r=El(e.x,t.x),o=El(e.y,t.y);return Math.sqrt(r**2+o**2)}var Ml=new Set(["auto","scroll"]),Gt=class{constructor(t,r,{transformPagePoint:o,contextWindow:n=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Qo(this.lastRawMoveEventInfo,this.transformPagePoint));let d=Ai(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,x=Al(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!x)return;let{point:v}=d,{timestamp:b}=W;this.history.push({...v,timestamp:b});let{onStart:w,onMove:y}=this.handlers;h||(w&&w(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=h,this.lastMoveEventInfo=Qo(h,this.transformPagePoint),A.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();let{onEnd:x,onSessionEnd:v,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let w=Ai(d.type==="pointercancel"?this.lastMoveEventInfo:Qo(h,this.transformPagePoint),this.history);this.startEvent&&x&&x(d,w),v&&v(d,w)},!ct(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=o,this.distanceThreshold=i,this.contextWindow=n||window;let c=Be(t),u=Qo(c,this.transformPagePoint),{point:l}=u,{timestamp:f}=W;this.history=[{...l,timestamp:f}];let{onSessionStart:m}=r;m&&m(t,Ai(u,this.history));let p={passive:!0,capture:!0};this.removeListeners=ve(Je(this.contextWindow,"pointermove",this.handlePointerMove,p),Je(this.contextWindow,"pointerup",this.handlePointerUp,p),Je(this.contextWindow,"pointercancel",this.handlePointerUp,p)),a&&this.startScrollTracking(a)}startScrollTracking(t){let r=t.parentElement;for(;r;){let o=getComputedStyle(r);(Ml.has(o.overflowX)||Ml.has(o.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){let r=this.scrollPositions.get(t);if(!r)return;let o=t===window,n=o?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:n.x-r.x,y:n.y-r.y};s.x===0&&s.y===0||(o?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,n),A.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),se(this.updatePoint)}};function Qo(e,t){return t?{point:t(e.point)}:e}function Dl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ai({point:e},t){return{point:e,delta:Dl(e,Rl(t)),offset:Dl(e,Hf(t)),velocity:Kf(t,.1)}}function Hf(e){return e[0]}function Rl(e){return e[e.length-1]}function Kf(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,o=null,n=Rl(e);for(;r>=0&&(o=e[r],!(n.timestamp-o.timestamp>H(t)));)r--;if(!o)return{x:0,y:0};o===e[0]&&e.length>2&&n.timestamp-o.timestamp>H(t)*2&&(o=e[1]);let s=Z(n.timestamp-o.timestamp);if(s===0)return{x:0,y:0};let i={x:(n.x-o.x)/s,y:(n.y-o.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Bl(e,{min:t,max:r},o){return t!==void 0&&e<t?e=o?D(t,e,o.min):Math.max(e,t):r!==void 0&&e>r&&(e=o?D(r,e,o.max):Math.min(e,r)),e}function kl(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function Fl(e,{top:t,left:r,bottom:o,right:n}){return{x:kl(e.x,r,n),y:kl(e.y,t,o)}}function Ll(e,t){let r=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,o]=[o,r]),{min:r,max:o}}function Nl(e,t){return{x:Ll(e.x,t.x),y:Ll(e.y,t.y)}}function jl(e,t){let r=.5,o=_(e),n=_(t);return n>o?r=we(t.min,t.max-o,e.min):o>n&&(r=we(e.min,e.max-n,t.min)),Y(0,1,r)}function zl(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var en=.35;function Gl(e=en){return e===!1?e=0:e===!0&&(e=en),{x:Il(e,"left","right"),y:Il(e,"top","bottom")}}function Il(e,t,r){return{min:Ol(e,t),max:Ol(e,r)}}function Ol(e,t){return typeof e=="number"?e:e[t]||0}var _f=new WeakMap,rn=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=B(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:o}={}){let{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;let s=f=>{r&&this.snapToCursor(Be(f).point),this.stopAnimation()},i=(f,m)=>{let{drag:p,dragPropagation:d,onDragStart:h}=this.getProps();if(p&&!d&&(this.openDragLock&&this.openDragLock(),this.openDragLock=$n(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ce(v=>{let b=this.getAxisMotionValue(v).get()||0;if(ee.test(b)){let{projection:w}=this.visualElement;if(w&&w.layout){let y=w.layout.layoutBox[v];y&&(b=_(y)*(parseFloat(b)/100))}}this.originPoint[v]=b}),h&&A.update(()=>h(f,m),!1,!0),Mt(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;let{dragPropagation:p,dragDirectionLock:d,onDirectionLock:h,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;let{offset:v}=m;if(d&&this.currentDirection===null){this.currentDirection=Yf(v),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",m.point,v),this.updateAxis("y",m.point,v),this.visualElement.render(),x&&A.update(()=>x(f,m),!1,!0)},c=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m,this.stop(f,m),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{let{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Gt(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:o,contextWindow:Jo(this.visualElement),element:this.visualElement.current})}stop(t,r){let o=t||this.latestPointerEvent,n=r||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!n||!o)return;let{velocity:i}=n;this.startAnimation(i);let{onDragEnd:a}=this.getProps();a&&A.postRender(()=>a(o,n))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,r,o){let{drag:n}=this.getProps();if(!o||!tn(t,n,this.currentDirection))return;let s=this.getAxisMotionValue(t),i=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(i=Bl(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;let{dragConstraints:t,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,n=this.constraints;t&&Ze(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=Fl(o.layoutBox,t):this.constraints=!1,this.elastic=Gl(r),n!==this.constraints&&!Ze(t)&&o&&this.constraints&&!this.hasMutatedConstraints&&ce(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=zl(o.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Ze(t))return!1;let o=t.current;ie(o!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:n}=this.visualElement;if(!n||!n.layout)return!1;n.root&&(n.root.scroll=void 0,n.root.updateScroll());let s=ci(o,n.root,this.visualElement.getTransformPagePoint()),i=Nl(n.layout.layoutBox,s);if(r){let a=r(oi(i));this.hasMutatedConstraints=!!a,a&&(i=wr(a))}return i}startAnimation(t){let{drag:r,dragMomentum:o,dragElastic:n,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=ce(l=>{if(!tn(l,r,this.currentDirection))return;let f=c&&c[l]||{};(i===!0||i===l)&&(f={min:0,max:0});let m=n?200:1e6,p=n?40:1e7,d={type:"inertia",velocity:o?t[l]:0,bounceStiffness:m,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(l,d)});return Promise.all(u).then(a)}startAxisValueAnimation(t,r){let o=this.getAxisMotionValue(t);return Mt(this.visualElement,t),o.start(it(t,o,0,r,this.visualElement,!1))}stopAnimation(){ce(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var s;let r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[r];return n||this.visualElement.getValue(t,(s=this.visualElement.latestValues[t])!=null?s:0)}snapToCursor(t){ce(r=>{let{drag:o}=this.getProps();if(!tn(r,o,this.currentDirection))return;let{projection:n}=this.visualElement,s=this.getAxisMotionValue(r);if(n&&n.layout){let{min:i,max:a}=n.layout.layoutBox[r],c=s.get()||0;s.set(t[r]-D(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:o}=this.visualElement;if(!Ze(r)||!o||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};ce(i=>{let a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){let c=a.get();n[i]=jl({min:c,max:c},this.constraints[i])}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.constraints=!1,this.resolveConstraints(),ce(i=>{if(!tn(i,t,null))return;let a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(D(c,u,n[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_f.set(this.visualElement,this);let t=this.visualElement.current,r=Je(t,"pointerdown",u=>{let{drag:l,dragListener:f=!0}=this.getProps(),m=u.target,p=m!==t&&Zn(m);l&&f&&!p&&this.start(u)}),o,n=()=>{let{dragConstraints:u}=this.getProps();Ze(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),o||(o=$f(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",n);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),A.read(n);let a=Ce(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(ce(f=>{let m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=u[f].translate,m.set(m.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),r(),i(),c&&c(),o&&o()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:o=!1,dragPropagation:n=!1,dragConstraints:s=!1,dragElastic:i=en,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:o,dragPropagation:n,dragConstraints:s,dragElastic:i,dragMomentum:a}}};function Wl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function $f(e,t,r){let o=Ao(e,Wl(r)),n=Ao(t,Wl(r));return()=>{o(),n()}}function tn(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Yf(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var on=class extends q{constructor(t){super(t),this.removeGroupControls=j,this.removeListeners=j,this.controls=new rn(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||j}update(){let{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};var Mi=e=>(t,r)=>{e&&A.update(()=>e(t,r),!1,!0)},nn=class extends q{constructor(){super(...arguments),this.removePointerDownListener=j}onPointerDown(t){this.session=new Gt(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jo(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:o,onPanEnd:n}=this.node.getProps();return{onSessionStart:Mi(t),onStart:Mi(r),onMove:Mi(o),onEnd:(s,i)=>{delete this.session,n&&A.postRender(()=>n(s,i))}}}mount(){this.removePointerDownListener=Je(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var Ul=require("react/jsx-runtime");var Lr=require("react");var Di=!1,Ri=class extends Lr.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:o,layoutId:n}=this.props,{projection:s}=t;s&&(r.group&&r.group.add(s),o&&o.register&&n&&o.register(s),Di&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),gt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:o,drag:n,isPresent:s}=this.props,{projection:i}=o;return i&&(i.isPresent=s,t.layoutDependency!==r&&i.setOptions({...i.options,layoutDependency:r}),Di=!0,n||t.layoutDependency!==r||r===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||A.postRender(()=>{let a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:t,layoutAnchor:r}=this.props,{projection:o}=t;o&&(o.options.layoutAnchor=r,o.root.didUpdate(),lt.postRender(()=>{!o.currentAnimation&&o.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:o}=this.props,{projection:n}=t;Di=!0,n&&(n.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(n),o&&o.deregister&&o.deregister(n))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function sn(e){let[t,r]=Ja(),o=(0,Lr.useContext)(zr);return(0,Ul.jsx)(Ri,{...e,layoutGroup:o,switchLayoutGroup:(0,Lr.useContext)($o),isPresent:t,safeToRemove:r})}var Hl={pan:{Feature:nn},drag:{Feature:on,ProjectionNode:Rr,MeasureLayout:sn}};function Kl(e,t,r){let{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",r==="Start");let n="onHover"+r,s=o[n];s&&A.postRender(()=>s(t,Be(t)))}var an=class extends q{mount(){let{current:t}=this.node;t&&(this.unmount=Yn(t,(r,o)=>(Kl(this.node,o,"Start"),n=>Kl(this.node,n,"End"))))}unmount(){}};var ln=class extends q{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(r){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=ve(Ce(this.node.current,"focus",()=>this.onFocus()),Ce(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function _l(e,t,r){let{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",r==="Start");let n="onTap"+(r==="End"?"":r),s=o[n];s&&A.postRender(()=>s(t,Be(t)))}var cn=class extends q{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:r,propagate:o}=this.node.props;this.unmount=Qn(t,(n,s)=>(_l(this.node,s,"Start"),(i,{success:a})=>_l(this.node,i,a?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(o==null?void 0:o.tap)===!1})}unmount(){}};var Li=new WeakMap,ki=new WeakMap,Xf=e=>{let t=Li.get(e.target);t&&t(e)},qf=e=>{e.forEach(Xf)};function Zf({root:e,...t}){let r=e||document;ki.has(r)||ki.set(r,{});let o=ki.get(r),n=JSON.stringify(t);return o[n]||(o[n]=new IntersectionObserver(qf,{root:e,...t})),o[n]}function $l(e,t,r){let o=Zf(t);return Li.set(e,r),o.observe(e),()=>{Li.delete(e),o.unobserve(e)}}var Jf={some:0,all:1},un=class extends q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);let{viewport:t={}}=this.node.getProps(),{root:r,margin:o,amount:n="some",once:s}=t,i={root:r?r.current:void 0,rootMargin:o,threshold:typeof n=="number"?n:Jf[n]},a=u=>{let{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);let{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),p=l?f:m;p&&p(u)};this.stopObserver=$l(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver=="undefined")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Qf(t,r))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}};function Qf({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var Yl={inView:{Feature:un},tap:{Feature:cn},focus:{Feature:ln},hover:{Feature:an}};var Xl={layout:{ProjectionNode:Rr,MeasureLayout:sn}};var ql={...Pl,...Yl,...Hl,...Xl};var Ii=Tl(ql,Vl);var Oi=Ii;var g=require("react"),rc=require("react-dom"),Bi=new Set,Fi={open:!1,status:null,busy:!1};function ue(e){Fi=Object.assign({},Fi,e),Bi.forEach(function(t){t()})}function tm(e){return Bi.add(e),function(){Bi.delete(e)}}function rm(){return Fi}function oc(){return g.useSyncExternalStore(tm,rm)}async function Ae(e,t){var r={method:t===void 0?"GET":"POST",headers:{}};t!==void 0&&(r.headers["content-type"]="application/json",r.body=JSON.stringify(t));var o=await fetch(e,r),n=await o.text(),s=null;try{s=n===""?null:JSON.parse(n)}catch(i){s=null}return o.ok?s!==null?s:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+o.status+(s!==null&&s.error!==void 0?": "+s.error:"")}}function nc(e,t){try{var r=e(function(f){return f}),o=t===null?null:typeof t=="function"?t(function(f){return f}):null,n=r!=null?r.current:void 0;if(n!==void 0&&r!=null&&r.byId!=null){var s=r.byId[n];if(s!=null&&typeof s.cwd=="string"&&s.cwd!=="")return s.cwd}var i=o!=null&&Array.isArray(o.items)?o.items:[];if(n!==void 0)for(var a=0;a<i.length;a++){var c=i[a];if(c.sessionIds!=null&&c.sessionIds.indexOf(n)!==-1&&typeof c.path=="string"&&c.path!=="")return c.path}var u=o!=null?o.recentWorkspaceId:void 0;if(u!==void 0){for(var l=0;l<i.length;l++)if(i[l].workspaceId===u&&typeof i[l].path=="string"&&i[l].path!=="")return i[l].path}if(i.length>0&&typeof i[0].path=="string"&&i[0].path!=="")return i[0].path}catch(f){}}function om(e,t){if(e==null||typeof e.url!="string"||e.url==="")return null;var r=typeof t=="string"&&t!==""?t:e!=null&&e.cwd!=null?e.cwd:null;if(r==null||r==="")return e.url;var o=r.replace(/\\/g,"/"),n=o;return(/^[A-Za-z]:\//.test(o)||o.charCodeAt(0)!==47)&&(n="/"+o),e.url+"?folder="+encodeURIComponent(n)}var nm=["nw","n","ne","w","e","sw","s","se"],J=12,im=720,sm=520,ic=360,sc=260,Zl=24;function ac(e){if(e===!1)return 0;try{if(typeof document=="undefined")return 0;var t=document.querySelectorAll("[data-composer-seat]");if(t===null||t.length===0)return 0;for(var r=Number.POSITIVE_INFINITY,o=0,n=0;n<t.length;n++){var s=t[n].getBoundingClientRect();s===null||s.width<=0||(s.top<r&&(r=s.top),s.bottom>o&&(o=s.bottom))}if(!isFinite(r)||o<=0)return 0;var i=window.innerHeight;return i-o>24?0:Math.min(Math.max(1,i-r+8),420)}catch(a){return 0}}function Ee(){return{width:Math.max(1,window.innerWidth),height:Math.max(1,window.innerHeight)}}function dn(e,t){return{width:Math.max(1,e.width-J*2),height:Math.max(1,e.height-J*2-t)}}function Qe(e,t,r){return Math.min(r,Math.max(t,e))}function Ut(e,t,r){let o=dn(t,r),n=Qe(e.width,Math.min(ic,o.width),o.width),s=Qe(e.height,Math.min(sc,o.height),o.height);return{x:Qe(e.x,J,Math.max(J,t.width-J-n)),y:Qe(e.y,J,Math.max(J,t.height-J-r-s)),width:n,height:s}}function am(e,t,r){let o=dn(t,r),n=Math.min(im,o.width),s=Math.min(sm,o.height),i=lm(),a=i>0?i-8:t.height-J-r;return Ut({x:t.width-J-n-e*Zl,y:Math.max(J,a-s-e*Zl),width:n,height:s},t,r)}function lm(){try{if(typeof document=="undefined")return-1;var e=document.querySelectorAll("[data-composer-seat]");if(e===null||e.length===0)return-1;for(var t=Number.POSITIVE_INFINITY,r=0;r<e.length;r++){var o=e[r].getBoundingClientRect();o!==null&&o.width>0&&o.top<t&&(t=o.top)}return isFinite(t)?t:-1}catch(n){return-1}}function cm(e,t,r,o,n){return Ut({...e,x:e.x+t,y:e.y+r},o,n)}function um(e,t,r,o,n,s){let i=Ut(e,n,s),a=dn(n,s),c=Math.min(ic,a.width),u=Math.min(sc,a.height),l=n.height-J-s,f=i.x,m=i.x+i.width,p=i.y,d=i.y+i.height;return t.includes("w")&&(f=Qe(i.x+r,J,m-c)),t.includes("e")&&(m=Qe(m+r,f+c,n.width-J)),t.includes("n")&&(p=Qe(i.y+o,J,d-u)),t.includes("s")&&(d=Qe(d+o,p+u,l)),{x:f,y:p,width:m-f,height:d-p}}function fn(e,t){let r=dn(e,t);return{x:J,y:J,width:r.width,height:r.height}}var fm='.dshcs-root{position:fixed;inset:0;z-index:2147483000;pointer-events:none}.dshcs-win{--dshcs-accent:#5b6cff;pointer-events:auto;position:fixed;isolation:isolate;z-index:2147483000;display:flex;flex-direction:column;min-width:1px;min-height:1px;overflow:hidden;color:var(--dsw-alias-label-primary,#172033);background:var(--dsw-alias-bg-base,#fff);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;box-shadow:0 1px 2px rgba(13,22,38,.08),0 18px 48px rgba(13,22,38,.2),0 0 0 1px rgba(255,255,255,.4) inset;transition:border-color .16s ease,box-shadow .16s ease}.dshcs-win:hover{border-color:color-mix(in srgb,var(--dshcs-accent) 28%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 2px 5px rgba(13,22,38,.1),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-win[data-interaction]{transition:none;user-select:none}.dshcs-win[data-interaction]::after{content:"";position:absolute;inset:0;z-index:18;background:transparent}.dshcs-win-max{border-radius:14px;z-index:2147483001;box-shadow:0 1px 2px rgba(13,22,38,.06),0 8px 24px rgba(13,22,38,.12)}.dshcs-win-max:hover{box-shadow:0 1px 2px rgba(13,22,38,.06),0 10px 28px rgba(13,22,38,.14)}.dshcs-win-snap{border-color:color-mix(in srgb,var(--dshcs-accent) 70%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 26%,transparent),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-snapghost{position:fixed;left:0;top:0;z-index:2147483000;pointer-events:none;display:grid;place-items:center;border:1.5px solid color-mix(in srgb,var(--dshcs-accent,#5b6cff) 85%,transparent);background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 11%,transparent);border-radius:12px;box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent,#5b6cff) 20%,transparent),0 10px 34px rgba(13,22,38,.14)}.dshcs-snapghint{position:absolute;top:12px;left:50%;transform:translateX(-50%);padding:5px 14px;border-radius:999px;background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 92%,#172033);color:#fff;font-size:12px;font-weight:650;letter-spacing:.02em;white-space:nowrap;box-shadow:0 6px 18px rgba(13,22,38,.3)}.dshcs-drag{position:absolute;top:0;left:0;right:0;height:14px;z-index:26;cursor:grab;touch-action:none;user-select:none}.dshcs-win[data-interaction=move] .dshcs-drag{cursor:grabbing}.dshcs-win-max .dshcs-drag{cursor:default}.dshcs-drag:hover{background:color-mix(in srgb,var(--dsw-alias-label-primary,#172033) 5%,transparent)}.dshcs-body{position:relative;display:flex;flex:1;min-width:0;min-height:0;flex-direction:column;background:var(--dsw-alias-bg-base,#fff)}.dshcs-body[hidden]{display:none}.dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-resize{position:absolute;z-index:24;display:block;touch-action:none}.dshcs-resize-n,.dshcs-resize-s{left:16px;right:16px;height:10px;cursor:ns-resize}.dshcs-resize-n{top:0}.dshcs-resize-s{bottom:0}.dshcs-resize-w,.dshcs-resize-e{top:16px;bottom:16px;width:10px;cursor:ew-resize}.dshcs-resize-w{left:0}.dshcs-resize-e{right:0}.dshcs-resize-nw,.dshcs-resize-ne,.dshcs-resize-sw,.dshcs-resize-se{width:18px;height:18px}.dshcs-resize-nw{left:0;top:0;cursor:nwse-resize}.dshcs-resize-ne{right:0;top:0;cursor:nesw-resize}.dshcs-resize-sw{left:0;bottom:0;cursor:nesw-resize}.dshcs-resize-se{right:0;bottom:0;cursor:nwse-resize}.dshcs-resize-se::after{content:"";position:absolute;right:4px;bottom:4px;width:7px;height:7px;border-right:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-bottom:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-radius:0 0 2px}.dshcs-ball{position:fixed;width:38px;height:38px;padding:0;border:1px solid color-mix(in srgb,var(--dsw-alias-border-l2,#dfe3eb) 80%,transparent);border-radius:50%;display:grid;place-items:center;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;z-index:2147483002;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2,#f2f4f8) 88%,transparent);backdrop-filter:blur(8px) saturate(1.2);box-shadow:0 8px 20px rgba(13,22,38,.18),0 1px 2px rgba(13,22,38,.1);transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}.dshcs-ball img,.dshcs-ball svg{-webkit-user-drag:none;user-drag:none}.dshcs-ball[data-dragging]{cursor:grabbing;transform:scale(1.06);box-shadow:0 14px 28px rgba(13,22,38,.28),0 2px 6px rgba(13,22,38,.16)}.dshcs-ball:hover{transform:scale(1.06);box-shadow:0 10px 24px rgba(13,22,38,.22),0 1px 2px rgba(13,22,38,.1)}.dshcs-ball:active{transform:scale(.94)}.dshcs-ball:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent) 65%,transparent);outline-offset:2px}.dshcs-ball-open{background:color-mix(in srgb,var(--dshcs-accent) 14%,var(--dsw-alias-bg-layer-2,#f2f4f8));border-color:color-mix(in srgb,var(--dshcs-accent) 55%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 22%,transparent),0 0 20px color-mix(in srgb,var(--dshcs-accent) 38%,transparent),0 8px 20px rgba(13,22,38,.16);transform:scale(1.08)}.dshcs-ball-dot{position:absolute;top:-2px;right:-2px;width:9px;height:9px;border-radius:50%;background:#20a66a;border:2px solid var(--dsw-alias-bg-base,#fff)}.dshcs-ball-dot[data-status=starting]{background:#d78b25}.dshcs-ball-dot[data-status=error]{background:#f85149}.dshcs-ball-dot[data-status=idle]{background:#7d8798}.dshcs-ball-dot[data-status=running]::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid currentColor;opacity:.3;animation:dshcs-pulse 2s ease-out infinite}@keyframes dshcs-pulse{0%{transform:scale(.7);opacity:.35}70%,100%{transform:scale(1.65);opacity:0}}',Jl="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(Jl)+"]")===null&&(mn=document.createElement("style"),mn.setAttribute("data-dshcs",Jl),mn.textContent=fm,document.head.appendChild(mn));var mn;function mm(e){var[t,r]=g.useState(!1),o=g.useRef(e.url);return g.useEffect(function(){o.current!==e.url&&(o.current=e.url,r(!1))},[e.url]),e.url!=null&&t!==!0?g.createElement("img",{src:e.url,key:"img-"+e.url,alt:"","aria-hidden":!0,draggable:!1,onError:function(){r(!0)},style:{width:20,height:20,display:"block",objectFit:"contain",borderRadius:3,WebkitUserDrag:"none",userSelect:"none"}}):g.createElement("svg",{viewBox:"0 0 18 18","aria-hidden":!0,style:{width:17,height:17}},g.createElement("rect",{x:"3",y:"3",width:"12",height:"12",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:1.4}),g.createElement("path",{d:"M3 7h12M7 3v12",fill:"none",stroke:"currentColor",strokeWidth:1.4}))}var Ql=38,Wt=8,lc="dshcs-ball-pos";function Ni(e){var t=Math.max(Wt,window.innerWidth-Wt-Ql),r=Math.max(Wt,window.innerHeight-Wt-Ql);return{x:Math.min(t,Math.max(Wt,e.x)),y:Math.min(r,Math.max(Wt,e.y))}}function pm(){try{var e=window.localStorage.getItem(lc);if(e==null)return null;var t=JSON.parse(e);if(t!=null&&typeof t.x=="number"&&typeof t.y=="number"&&isFinite(t.x)&&isFinite(t.y))return Ni(t)}catch(r){}return null}function dm(e){try{window.localStorage.setItem(lc,JSON.stringify(e))}catch(t){}}function hm(e){var t=oc(),r=t.status,o=r!=null?r.env:null,n=r!=null&&r.running===!0,s=n?"running":r!=null&&r.status==="starting"?"starting":r!=null&&r.status==="error"?"error":"idle",i=ac(r!=null?r.reserveComposer:!0),a=t.open===!0,c=n&&r!=null&&typeof r.url=="string"?r.url+"_static/src/browser/media/favicon-dark-support.svg":null,[u,l]=g.useState(pm),[f,m]=g.useState(!1),p=g.useRef(null),d=g.useRef(!1);if(g.useEffect(function(){var y=function(){l(function(T){return T==null?T:Ni(T)})};return window.addEventListener("resize",y),function(){window.removeEventListener("resize",y)}},[]),o!=null&&o.ok!==!0)return null;var h=function(y){if(y.button===0){var T=y.currentTarget,C=T.getBoundingClientRect();p.current={pointerId:y.pointerId,dx:y.clientX-C.left,dy:y.clientY-C.top,moved:!1},d.current=!1,m(!0);try{T.setPointerCapture(y.pointerId)}catch(E){}}},x=function(y){var T=p.current;if(!(T==null||y.pointerId!==T.pointerId)){var C=y.clientX-T.dx,E=y.clientY-T.dy;(Math.abs(C-(u!=null?u.x:0))>2||Math.abs(E-(u!=null?u.y:0))>2)&&(T.moved=!0),l(Ni({x:C,y:E}))}},v=function(){var y=p.current;p.current=null,m(!1),y!=null&&y.moved===!0&&(d.current=!0),y!=null&&y.moved===!0&&l(function(T){return T!=null&&dm(T),T})},b=function(){if(d.current===!0){d.current=!1;return}if(r!=null&&r.windowedOpen===!0){var y=nc(e&&e.useSessions,e&&e.useWorkspaces),T=function(C){var E=om(C,y);E!=null&&typeof window.open=="function"&&window.open(E,"_blank","noopener")};if(r.running===!0){T(r);return}if(t.busy===!0)return;ue({busy:!0}),Ae("/code-server/start",typeof y=="string"?{cwd:y}:{}).then(function(C){ue({status:C,busy:!1}),T(C)}).catch(function(){ue({busy:!1})});return}ue({open:!a})},w=u!=null?{left:u.x,top:u.y}:{right:14,bottom:i>0?i+10:18};return rc.createPortal(g.createElement("button",{type:"button",className:"dshcs-ball"+(a?" dshcs-ball-open":""),style:w,"data-dragging":f===!0?"":void 0,title:r!=null&&r.windowedOpen===!0?"\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)","aria-label":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server","aria-expanded":a,onPointerDown:h,onPointerMove:x,onPointerUp:v,onPointerCancel:v,onDragStart:function(y){y&&y.preventDefault&&y.preventDefault()},onClick:b},g.createElement(mm,{url:c}),g.createElement("span",{className:"dshcs-ball-dot","data-status":s,"aria-hidden":!0})),document.body)}function gm(e){var t=oc(),r=t.status,o=r!=null&&r.ok===!0&&r.running===!0,n=r!=null&&r.status==="starting",s=r!=null&&r.ok===!1,i=nc(e&&e.useSessions,e&&e.useWorkspaces),a=g.useRef(void 0),[c,u]=g.useState(0),l=ac(r!=null?r.reserveComposer:!0),[f,m]=g.useState(!1),[p,d]=g.useState(null),[h,x]=g.useState(function(){return am(0,Ee(),l)}),v=g.useRef(h),b=g.useRef(function(){});v.current=h,g.useEffect(function(){var R=function(){x(function(Q){return f?fn(Ee(),l):Ut(Q,Ee(),l)})};return window.addEventListener("resize",R),function(){window.removeEventListener("resize",R)}},[f,l]),g.useEffect(function(){x(function(R){return Ut(R,Ee(),l)})},[l]),g.useEffect(function(){return function(){b.current()}},[]);var w=12,y=4,[T,C]=g.useState(!1),E=g.useRef(null),P=function(R,Q){if(R.button===0){R.preventDefault(),R.stopPropagation(),b.current();var ne=R.currentTarget.ownerDocument.defaultView;if(ne!==null){var pe=R.pointerId,Br=R.currentTarget,ji=f,Ht=ji?fn(Ee(),l):v.current,fc=Ht.width>0?(R.clientX-Ht.x)/Ht.width:0,mc=Math.min(14,Math.max(0,R.clientY-Ht.y)),N={pointerId:pe,origin:{x:R.clientX,y:R.clientY},start:Ht,ratio:fc,grabY:mc,wasMaximized:ji,restored:!1,snapped:!1,moved:!1};E.current=N,d(Q);try{Br.setPointerCapture(pe)}catch(ae){}var zi=function(ae){if(ae.pointerId===pe){if(Q!=="move"){x(um(N.start,Q,ae.clientX-N.origin.x,ae.clientY-N.origin.y,Ee(),l));return}var Wi=ae.clientX-N.origin.x,Nr=ae.clientY-N.origin.y;if(Math.abs(Wi)+Math.abs(Nr)>3&&(N.moved=!0),N.wasMaximized&&!N.restored){if(Nr<y)return;var gn=v.current,jr={x:ae.clientX-gn.width*Math.min(.9,Math.max(.1,N.ratio)),y:ae.clientY-N.grabY,width:gn.width,height:gn.height};jr=Ut(jr,Ee(),l),N.restored=!0,N.start=jr,N.origin={x:ae.clientX,y:ae.clientY},m(!1),x(jr);return}var pc=N.start.y+Nr,dc=cm(N.start,Wi,Nr,Ee(),l);x(dc);var xn=pc<=w;xn!==N.snapped&&(N.snapped=xn,C(xn))}},Gi=function(){ne.removeEventListener("pointermove",zi),ne.removeEventListener("pointerup",Fr),ne.removeEventListener("pointercancel",Fr),b.current=function(){},E.current=null;try{Br.releasePointerCapture(pe)}catch(ae){}},Fr=function(ae){ae.pointerId===pe&&(Gi(),d(null),(!N.wasMaximized||N.restored===!0)&&(N.snapped===!0&&N.moved===!0&&m(!0),N.snapped===!0&&C(!1)))};b.current=Gi,ne.addEventListener("pointermove",zi),ne.addEventListener("pointerup",Fr),ne.addEventListener("pointercancel",Fr)}}},U=function(){m(function(R){return!R})},V=function(R){R.target.closest("[data-window-control]")===null&&P(R,"move")},I=function(R){R.target.closest("[data-window-control]")===null&&U()};if(g.useEffect(function(){if(!t.open)return;var R=!1;async function Q(){ue({busy:!0});var ne=await Ae("/code-server/status");if(!R){if(ne!=null&&ne.ok===!0&&ne.running===!0){ue({status:ne,busy:!1});return}var pe=await Ae("/code-server/start",typeof i=="string"?{cwd:i}:{});R||ue({status:pe,busy:!1})}}return Q(),function(){R=!0}},[t.open]),g.useEffect(function(){if(!t.open||typeof i!="string"||i===""||a.current===i)return;var R=a.current!==void 0&&a.current!==i;a.current=i;var Q=!1;async function ne(){ue({busy:!0});var pe=await Ae("/code-server/start",{cwd:i});Q||(ue({status:pe,busy:!1}),R&&pe!=null&&pe.ok===!0&&pe.running===!0&&u(function(Br){return Br+1}))}return ne(),function(){Q=!0}},[t.open,i]),g.useEffect(function(){t.open||(a.current=void 0)},[t.open]),g.useEffect(function(){if(t.open){var R=window.setInterval(function(){Ae("/code-server/status").then(function(Q){ue({status:Q})})},3e3);return function(){window.clearInterval(R)}}},[t.open]),g.useEffect(function(){if(!t.open)return;function R(Q){Q.key==="Escape"&&ue({open:!1})}return window.addEventListener("keydown",R),function(){window.removeEventListener("keydown",R)}},[t.open]),!t.open)return null;var K=r!=null&&typeof r.url=="string"?r.url:null,fe=o&&r!=null&&typeof r.cwd=="string"&&r.cwd!==""?r.cwd:null,M=null;if(fe!==null){var L=fe.replace(/\\/g,"/");M=L,(/^[A-Za-z]:\//.test(L)||L.charCodeAt(0)!==47)&&(M="/"+L)}var F=K!==null?K+(M!==null?"?folder="+encodeURIComponent(M):""):null,Ir;if(o&&F!==null)Ir=g.createElement("iframe",{key:c,className:"dshcs-frame",src:F,title:"code-server",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock"});else{var $=s&&r!=null&&r.error?r.error:n?"\u6B63\u5728\u542F\u52A8 code-server\u2026":"code-server \u672A\u8FD0\u884C";Ir=g.createElement("div",{className:"dshcs-empty"},g.createElement("div",{className:"dshcs-emptybox"},g.createElement("div",null,n?"\u6B63\u5728\u542F\u52A8 code-server\u2026":s?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),g.createElement("pre",{className:"dshcs-error"},$),g.createElement("p",{className:"dshcs-hint"},"\u5B89\u88C5\u547D\u4EE4(Windows \u539F\u751F):npm install -g code-server@latest(\u9700\u914D\u5957\u6700\u65B0\u7248 node-gyp \u4E0E VS Spectre \u7F13\u89E3\u5E93);\u6216\u5728 cordis.patch.yml \u7684 code-server config \u4E2D\u8BBE\u7F6E bin \u6307\u5411\u5DF2\u5B89\u88C5\u4F4D\u7F6E\u3002\u7AEF\u53E3 "+(r!=null?r.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E\u3002")))}var oe=["dshcs-win",f?"dshcs-win-max":"",T?"dshcs-win-snap":""].filter(Boolean).join(" "),me=f?fn(Ee(),l):h,Fe={x:me.x,y:me.y,width:me.width,height:me.height},hn=p!==null?{duration:0}:{type:"spring",stiffness:430,damping:42,mass:.9},cc=g.createElement(Oi.section,{className:oe,style:{left:0,top:0},animate:Fe,initial:!1,transition:hn,"data-interaction":p!==null?p:void 0,role:"dialog","aria-label":"Code Server"},g.createElement("span",{className:"dshcs-drag",title:"\u62D6\u52A8\u79FB\u52A8 / \u53CC\u51FB\u6700\u5927\u5316",onPointerDown:V,onDoubleClick:I}),g.createElement("div",{className:"dshcs-body"},Ir),f?null:nm.map(function(R){return g.createElement("span",{key:R,className:"dshcs-resize dshcs-resize-"+R,"data-direction":R,onPointerDown:function(Q){P(Q,R)}})})),Or=fn(Ee(),l),uc=g.createElement(Oi.div,{className:"dshcs-snapghost",initial:!1,animate:{opacity:T===!0?1:0,x:Or.x,y:Or.y,width:Or.width,height:Or.height},transition:T===!0?{type:"spring",stiffness:500,damping:44,mass:.9}:{duration:.14}},g.createElement("span",{className:"dshcs-snapghint"},"\u677E\u5F00\u4EE5\u6700\u5927\u5316"));return rc.createPortal(g.createElement(g.Fragment,null,cc,uc),document.body)}var xm=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",ym="dsh-code-server/Card.module.css";function vm(e,t){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var r=document.createElement("style");r.dataset.plugin="dsh-code-server",r.dataset.pluginCss=e,r.textContent=t,document.head.appendChild(r)}}vm(ym,xm);function bm(e){return g.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},g.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function pn(e){return g.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function ec(e){return g.createElement("label",{className:"dshcs-check"},g.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(t){e.onChange(t.target.checked)}}),g.createElement("span",{className:"dshcs-hint"},e.children))}function tc(e){var t=[];return e.overridden===!0&&(t.push(g.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),t.push(g.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),t.length===0?null:g.createElement("span",{className:"dshcs-badges"},...t)}function wm(e){var[t,r]=g.useState(!1),o=e.state;if(o==null||o.available!==!0)return null;var n=e.title,s=o.dirty!==!0||o.invalid===!0||o.saving===!0;return g.createElement("li",{className:"dshcs-card"+(t?" dshcs-cardOpen":"")},g.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":t,onClick:function(){r(!t)}},g.createElement("span",{className:"dshcs-cardHeadText"},g.createElement("span",{className:"dshcs-cardName"},n),g.createElement("span",{className:"dshcs-cardDescription"},e.description)),o.dirty===!0?g.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,g.createElement(bm,{className:"dshcs-cardChevron"+(t?" dshcs-cardChevronOpen":"")})),t===!0?g.createElement("div",{className:"dshcs-cardBody"},o.writable!==!0?g.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,g.createElement("div",{className:"dshcs-cardFooter"},o.failed===!0?g.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,g.createElement(pn,{disabled:o.dirty!==!0||o.saving===!0,onClick:e.onDiscard},e.discardLabel),g.createElement(pn,{variant:"primary",disabled:s,onClick:e.onSave},o.saving===!0?e.savingLabel:e.saveLabel))):null)}function Tm(e){try{let V=function(){Ae("/code-server/status").then(function(M){M!=null&&typeof M=="object"&&ue({status:M})}).catch(function(){})};var t=e.scope,[r,o]=g.useState(function(){return t!==void 0?t.getSnapshot():null}),[n,s]=g.useState(null),[i,a]=g.useState(!1),[c,u]=g.useState(!1);if(g.useEffect(function(){if(t===void 0||typeof t.subscribe!="function")return;function M(){try{o(t.getSnapshot())}catch(F){}}var L=t.subscribe(M);return function(){typeof L=="function"&&L()}},[t]),t===void 0)return console.error("[code-server] card scope missing"),null;if(r==null||r.status!=="ready")return r!=null&&r.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",r.status),null;var l=r.value!==void 0&&r.value!==null?r.value:{},f=r.user,m={reserveComposer:l.reserveComposer!==!1,windowedOpen:l.windowedOpen===!0},p=f!=null&&Object.prototype.hasOwnProperty.call(f,"reserveComposer"),d=f!=null&&Object.prototype.hasOwnProperty.call(f,"windowedOpen"),h=n!==null&&(n.reserveComposer!==m.reserveComposer||n.windowedOpen!==m.windowedOpen),x=!h||i,v={available:!0,writable:r.writable,dirty:h,invalid:!1,saving:i,failed:c,reserveComposer:{text:n!==null?n.reserveComposer:m.reserveComposer,overridden:p}};async function I(){if(h&&!i){a(!0),u(!1);try{var M=n!==null?n:m;await e.scope.set("reserveComposer",M.reserveComposer===!0),await e.scope.set("windowedOpen",M.windowedOpen===!0),s(null),V()}catch(L){u(!0)}a(!1)}}async function K(){if(!(i||r.writable!==!0)){a(!0),u(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("reserveComposer"),await e.scope.unset("windowedOpen")):(await e.scope.set("reserveComposer",l.reserveComposer===void 0||l.reserveComposer===null?!0:l.reserveComposer),await e.scope.set("windowedOpen",l.windowedOpen===!0)),s(null),V()}catch(M){u(!0)}a(!1)}}var[b,w]=g.useState(null),[y,T]=g.useState(!1),[C,E]=g.useState(null),P=g.useRef(!0);g.useEffect(function(){return P.current=!0,function(){P.current=!1}},[]);async function fe(){if(y)return;T(!0),E(null);var M=await Ae("/code-server/setup",{});if(M==null||M.ok!==!0){E(M!=null&&M.error?M.error:"\u542F\u52A8\u5B89\u88C5\u5931\u8D25"),T(!1);return}E("\u73AF\u5883\u5B89\u88C5\u5DF2\u5728\u540E\u53F0\u5F00\u59CB,\u5B8C\u6210\u540E\u81EA\u52A8\u5237\u65B0\u2026");function L(){P.current===!0&&Ae("/code-server/status").then(function(F){if(P.current===!0){if(F==null||F.setup==null){T(!1);return}if(F.setup.running===!0){setTimeout(L,2e3);return}T(!1),w(F.env!=null?F.env:{error:"status \u672A\u8FD4\u56DE env"}),E(F.setup.ok===!0?"\u73AF\u5883\u5B89\u88C5\u5B8C\u6210":`\u73AF\u5883\u5B89\u88C5\u5931\u8D25:
3
- `+(F.setup.logTail!=null?F.setup.logTail.slice(-600):"(\u65E0\u65E5\u5FD7)"))}})}L()}var U=g.createElement("div",{className:"dshcs-field"},g.createElement("div",{className:"dshcs-fieldHead"},g.createElement("span",{className:"dshcs-fieldLabel"},"\u73AF\u5883\u68C0\u6D4B"),g.createElement("span",{className:"dshcs-badges"},g.createElement(pn,{variant:"primary",disabled:y,onClick:async function(){T(!0),E(null);var M=await Ae("/code-server/status");w(M!=null&&M.env!=null?M.env:{error:"status \u672A\u8FD4\u56DE env"}),T(!1)}},"\u68C0\u6D4B\u73AF\u5883"),g.createElement(pn,{disabled:y,onClick:function(){fe()}},y?"\u5B89\u88C5\u4E2D\u2026":"\u5B89\u88C5\u73AF\u5883"))),b!=null?g.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},b.error!=null?g.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+b.error):g.createElement("span",null,"\u72B6\u6001: "+(b.ok===!0?"\u2705 \u5C31\u7EEA":"\u274C \u4E0D\u901A\u8FC7")+(b.entry!=null?" \xB7 \u5165\u53E3: "+b.entry:" \xB7 \u5165\u53E3\u7F3A\u5931")+" \xB7 native: "+(b.native===!0?"\u2705":"\u274C")+" \xB7 VS Code \u5185\u90E8\u4F9D\u8D56: "+(b.vscodeInner===!0?"\u2705":"\u274C"))):g.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},'\u70B9\u51FB"\u68C0\u6D4B\u73AF\u5883"\u67E5\u770B code-server \u5B89\u88C5\u72B6\u6001'),C!=null?g.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},C):null,g.createElement("div",{className:"dshcs-hint",style:{marginTop:10,color:"var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary))"}},"\u5B89\u88C5\u4F4D\u7F6E: "+(b!=null&&b.entry!=null?b.entry:"(profile)\\.code-server-app(\u5F85\u5B89\u88C5\u540E\u53EF\u67E5\u770B)")+`
4
- \u5378\u8F7D: \u5148\u624B\u52A8\u5220\u9664 .code-server-app \u76EE\u5F55,\u518D dsh plugin --profile web remove dsh-code-server-app`));return g.createElement(wm,{title:"Code Server",description:"\u7A97\u53E3\u884C\u4E3A:\u4FDD\u7559\u8F93\u5165\u6846\u4E0A\u65B9\u7A7A\u95F4 / \u7A97\u53E3\u5316(\u65B0\u6807\u7B7E\u9875)\u6253\u5F00",state:v,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:I,onDiscard:function(){s(null),u(!1)}},g.createElement("div",{className:"dshcs-field"},g.createElement("div",{className:"dshcs-fieldHead"},g.createElement("span",{className:"dshcs-fieldLabel"},"\u4FDD\u7559\u8F93\u5165\u6846\u4E0A\u65B9\u7A7A\u95F4"),p===!0?g.createElement(tc,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){K()}}):null),g.createElement(ec,{checked:n!==null?n.reserveComposer:m.reserveComposer,disabled:r.writable!==!0,onChange:function(M){s(function(L){return Object.assign({},L!==null?L:m,{reserveComposer:M===!0})}),u(!1)}},"\u5F00\u542F\u65F6\u7A97\u53E3\u521D\u59CB/\u7F29\u653E/\u6700\u5927\u5316\u6B62\u4E8E\u8F93\u5165\u6846\u4E0A\u65B9;\u5173\u95ED\u540E\u5141\u8BB8\u76D6\u4F4F\u8F93\u5165\u6846(\u6700\u5927\u5316\u5230\u89C6\u53E3\u5E95)")),g.createElement("div",{className:"dshcs-field"},g.createElement("div",{className:"dshcs-fieldHead"},g.createElement("span",{className:"dshcs-fieldLabel"},"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"),d===!0?g.createElement(tc,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){K()}}):null),g.createElement(ec,{checked:n!==null?n.windowedOpen:m.windowedOpen,disabled:r.writable!==!0,onChange:function(M){s(function(L){return Object.assign({},L!==null?L:m,{windowedOpen:M===!0})}),u(!1)}},"\u5F00\u542F\u540E\u70B9\u51FB\u60AC\u6D6E\u7403\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 code-server(\u81EA\u52A8\u542F\u52A8\u5E76\u8DDF\u968F\u5F53\u524D\u5DE5\u4F5C\u533A);\u5173\u95ED\u5219\u4F7F\u7528\u5185\u90E8\u6D6E\u52A8\u7A97\u53E3")),U)}catch(V){return console.error("[code-server] card render error:",V!=null&&V.message!==void 0?V.message:String(V)),null}}function Sm(e){try{Vm(e)}catch(t){console.error("[code-server] apply failed:",t&&t.stack?t.stack:String(t));try{document.title="CS-ERR "+(t&&t.message||String(t))}catch(r){}}}function Vm(e){var t=e.get("slots");if(t===void 0){console.error("[code-server] slots service unavailable");return}Ae("/code-server/status").then(function(n){ue({status:n})}).catch(function(){}),t.inject("shell.overlay",()=>t.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},n=>g.createElement(g.Fragment,null,g.createElement(hm,n),g.createElement(gm,n))));var r=e.settingsScope;if(r===void 0||typeof r.bind!="function"){console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}var o=r.bind({namespace:"code-server"});t.inject("settings.plugin.item",()=>t.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:o}}},Tm)),console.log("[code-server] client bundle registered (floating ball + window + settings card)")}var Pm=["slots","settingsScope"],Cm="code-server";
2
+ var bo=Object.defineProperty;var bc=Object.getOwnPropertyDescriptor;var wc=Object.getOwnPropertyNames;var Tc=Object.prototype.hasOwnProperty;var Sc=(e,t)=>{for(var r in t)bo(e,r,{get:t[r],enumerable:!0})},Vc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wc(t))!Tc.call(e,o)&&o!==r&&bo(e,o,{get:()=>t[o],enumerable:!(n=bc(t,o))||n.enumerable});return e};var Pc=e=>Vc(bo({},"__esModule",{value:!0}),e);var zm={};Sc(zm,{apply:()=>Bm,inject:()=>Nm,name:()=>jm});module.exports=Pc(zm);var Xi=require("react"),Wr=(0,Xi.createContext)({});var qi=require("react");function Zi(e){let t=(0,qi.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ur=require("react");var Ji=typeof window!="undefined";var Qi=Ji?Ur.useLayoutEffect:Ur.useEffect;var es=require("react"),Tt=(0,es.createContext)(null);function nt(e,t){e.indexOf(t)===-1&&e.push(t)}function Ge(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var Y=(e,t,r)=>r>t?t:r<e?e:r;var Re=()=>{},ue=()=>{};var ie={};var $t=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var Yt=e=>typeof e=="object"&&e!==null;var Xt=e=>/^0[^.\s]+$/u.test(e);function qt(e){let t;return()=>(t===void 0&&(t=e()),t)}var z=e=>e;var we=(...e)=>e.reduce((t,r)=>n=>r(t(n)));var Se=(e,t,r)=>{let n=t-e;return n?(r-e)/n:1};var Le=class{constructor(){this.subscriptions=[]}add(t){return nt(this.subscriptions,t),()=>Ge(this.subscriptions,t)}notify(t,r,n){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,r,n);else for(let s=0;s<o;s++){let i=this.subscriptions[s];i&&i(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var H=e=>e*1e3,Q=e=>e/1e3;var Zt=(e,t)=>t?e*(1e3/t):0;var ts=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Cc=1e-7,Ec=12;function Ac(e,t,r,n,o){let s,i,a=0;do i=t+(r-t)/2,s=ts(i,n,o)-e,s>0?r=i:t=i;while(Math.abs(s)>Cc&&++a<Ec);return i}function We(e,t,r,n){if(e===t&&r===n)return z;let o=s=>Ac(s,0,1,e,r);return s=>s===0||s===1?s:ts(o(s),t,n)}var Hr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Kr=e=>t=>1-e(1-t);var _r=We(.33,1.53,.69,.99),St=Kr(_r),Jt=Hr(St);var Qt=e=>e>=1?1:(e*=2)<1?.5*St(e):.5*(2-Math.pow(2,-10*(e-1)));var er=e=>1-Math.sin(Math.acos(e)),tr=Kr(er),rr=Hr(er);var wo=We(.42,0,1,1),To=We(0,0,.58,1),nr=We(.42,0,.58,1);var So=e=>Array.isArray(e)&&typeof e[0]!="number";var or=e=>Array.isArray(e)&&typeof e[0]=="number";var rs={linear:z,easeIn:wo,easeInOut:nr,easeOut:To,circIn:er,circInOut:rr,circOut:tr,backIn:St,backInOut:Jt,backOut:_r,anticipate:Qt},Mc=e=>typeof e=="string",$r=e=>{if(or(e)){ue(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,o]=e;return We(t,r,n,o)}else if(Mc(e))return ue(rs[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),rs[e];return e};var ir=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ns(e){let t=new Set,r=new Set,n=!1,o=!1,s=new WeakSet,i={delta:0,timestamp:0,isProcessing:!1};function a(u){s.has(u)&&(c.schedule(u),e()),u(i)}let c={schedule:(u,l=!1,f=!1)=>{let d=f&&n?t:r;return l&&s.add(u),d.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(i=u,n){o=!0;return}n=!0;let l=t;t=r,r=l,t.forEach(a),t.clear(),n=!1,o&&(o=!1,c.process(u))}};return c}var Dc=40;function Yr(e,t){let r=!1,n=!0,o={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,i=ir.reduce((b,y)=>(b[y]=ns(s),b),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:f,preRender:m,render:d,postRender:h}=i,g=()=>{let b=ie.useManualTiming,y=b?o.timestamp:performance.now();r=!1,b||(o.delta=n?1e3/60:Math.max(Math.min(y-o.timestamp,Dc),1)),o.timestamp=y,o.isProcessing=!0,a.process(o),c.process(o),u.process(o),l.process(o),f.process(o),m.process(o),d.process(o),h.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(g))},x=()=>{r=!0,n=!0,o.isProcessing||e(g)};return{schedule:ir.reduce((b,y)=>{let T=i[y];return b[y]=(P,M=!1,V=!1)=>(r||x(),T.schedule(P,M,V)),b},{}),cancel:b=>{for(let y=0;y<ir.length;y++)i[ir[y]].cancel(b)},state:o,steps:i}}var{schedule:A,cancel:fe,state:U,steps:sr}=Yr(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:z,!0);var Xr;function kc(){Xr=void 0}var G={now:()=>(Xr===void 0&&G.set(U.isProcessing||ie.useManualTiming?U.timestamp:performance.now()),Xr),set:e=>{Xr=e,queueMicrotask(kc)}};var os=e=>t=>typeof t=="string"&&t.startsWith(e),qr=os("--"),Rc=os("var(--"),Vt=e=>Rc(e)?Lc.test(e.split("/*")[0].trim()):!1,Lc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Vo(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var Ve={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ie={...Ve,transform:e=>Y(0,1,e)},ar={...Ve,default:1};var Ue=e=>Math.round(e*1e5)/1e5;var Pt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function is(e){return e==null}var ss=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Ct=(e,t)=>r=>!!(typeof r=="string"&&ss.test(r)&&r.startsWith(e)||t&&!is(r)&&Object.prototype.hasOwnProperty.call(r,t)),Zr=(e,t,r)=>n=>{if(typeof n!="string")return n;let[o,s,i,a]=n.match(Pt);return{[e]:parseFloat(o),[t]:parseFloat(s),[r]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}};var Ic=e=>Y(0,255,e),Po={...Ve,transform:e=>Math.round(Ic(e))},Pe={test:Ct("rgb","red"),parse:Zr("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Po.transform(e)+", "+Po.transform(t)+", "+Po.transform(r)+", "+Ue(Ie.transform(n))+")"};function Oc(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}}var lr={test:Ct("#"),parse:Oc,transform:Pe.transform};var cr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ge=cr("deg"),ne=cr("%"),S=cr("px"),Co=cr("vh"),Eo=cr("vw"),Jr={...ne,parse:e=>ne.parse(e)/100,transform:e=>ne.transform(e*100)};var He={test:Ct("hsl","hue"),parse:Zr("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+ne.transform(Ue(t))+", "+ne.transform(Ue(r))+", "+Ue(Ie.transform(n))+")"};var B={test:e=>Pe.test(e)||lr.test(e)||He.test(e),parse:e=>Pe.test(e)?Pe.parse(e):He.test(e)?He.parse(e):lr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Pe.transform(e):He.transform(e),getAnimatableNone:e=>{let t=B.parse(e);return t.alpha=0,B.transform(t)}};var as=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Bc(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Pt))==null?void 0:t.length)||0)+(((r=e.match(as))==null?void 0:r.length)||0)>0}var cs="number",us="color",Fc="var",Nc="var(",ls="${}",jc=/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 Ke(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[],s=0,a=t.replace(jc,c=>(B.test(c)?(n.color.push(s),o.push(us),r.push(B.parse(c))):c.startsWith(Nc)?(n.var.push(s),o.push(Fc),r.push(c)):(n.number.push(s),o.push(cs),r.push(parseFloat(c))),++s,ls)).split(ls);return{values:r,split:a,indexes:n,types:o}}function zc(e){return Ke(e).values}function fs({split:e,types:t}){let r=e.length;return n=>{let o="";for(let s=0;s<r;s++)if(o+=e[s],n[s]!==void 0){let i=t[s];i===cs?o+=Ue(n[s]):i===us?o+=B.transform(n[s]):o+=n[s]}return o}}function Gc(e){return fs(Ke(e))}var Wc=e=>typeof e=="number"?0:B.test(e)?B.getAnimatableNone(e):e,Uc=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Wc(e);function Hc(e){let t=Ke(e);return fs(t)(t.values.map((n,o)=>Uc(n,t.split[o])))}var X={test:Bc,parse:zc,createTransformer:Gc,getAnimatableNone:Hc};function Ao(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function ms({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let o=0,s=0,i=0;if(!t)o=s=i=r;else{let a=r<.5?r*(1+t):r+t-r*t,c=2*r-a;o=Ao(c,a,e+1/3),s=Ao(c,a,e),i=Ao(c,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:n}}function Et(e,t){return r=>r>0?t:e}var D=(e,t,r)=>e+(t-e)*r;var Mo=(e,t,r)=>{let n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},Kc=[lr,Pe,He],_c=e=>Kc.find(t=>t.test(e));function ds(e){let t=_c(e);if(Re(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===He&&(r=ms(r)),r}var Do=(e,t)=>{let r=ds(e),n=ds(t);if(!r||!n)return Et(e,t);let o={...r};return s=>(o.red=Mo(r.red,n.red,s),o.green=Mo(r.green,n.green,s),o.blue=Mo(r.blue,n.blue,s),o.alpha=D(r.alpha,n.alpha,s),Pe.transform(o))};var Qr=new Set(["none","hidden"]);function ps(e,t){return Qr.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function $c(e,t){return r=>D(e,t,r)}function en(e){return typeof e=="number"?$c:typeof e=="string"?Vt(e)?Et:B.test(e)?Do:qc:Array.isArray(e)?hs:typeof e=="object"?B.test(e)?Do:Yc:Et}function hs(e,t){let r=[...e],n=r.length,o=e.map((s,i)=>en(s)(s,t[i]));return s=>{for(let i=0;i<n;i++)r[i]=o[i](s);return r}}function Yc(e,t){let r={...e,...t},n={};for(let o in r)e[o]!==void 0&&t[o]!==void 0&&(n[o]=en(e[o])(e[o],t[o]));return o=>{for(let s in n)r[s]=n[s](o);return r}}function Xc(e,t){var o;let r=[],n={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){let i=t.types[s],a=e.indexes[i][n[i]],c=(o=e.values[a])!=null?o:0;r[s]=c,n[i]++}return r}var qc=(e,t)=>{let r=X.createTransformer(t),n=Ke(e),o=Ke(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?Qr.has(e)&&!o.values.length||Qr.has(t)&&!n.values.length?ps(e,t):we(hs(Xc(n,o),o.values),r):(Re(!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"),Et(e,t))};function tn(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?D(e,t,r):en(e)(e,t)}var gs=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>A.update(t,r),stop:()=>fe(t),now:()=>U.isProcessing?U.timestamp:G.now()}};var rn=(e,t,r=10)=>{let n="",o=Math.max(Math.round(t/r),2);for(let s=0;s<o;s++)n+=Math.round(e(s/(o-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function At(e){let t=0,r=50,n=e.next(t);for(;!n.done&&t<2e4;)t+=r,n=e.next(t);return t>=2e4?1/0:t}function xs(e,t=100,r){let n=r({...e,keyframes:[0,t]}),o=Math.min(At(n),2e4);return{type:"keyframes",ease:s=>n.next(o*s).value/t,duration:Q(o)}}var W={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Lo(e,t){return e*Math.sqrt(1-t*t)}var Zc=12;function Jc(e,t,r){let n=r;for(let o=1;o<Zc;o++)n=n-e(n)/t(n);return n}var Ro=.001;function Qc({duration:e=W.duration,bounce:t=W.bounce,velocity:r=W.velocity,mass:n=W.mass}){let o,s;Re(e<=H(W.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let i=1-t;i=Y(W.minDamping,W.maxDamping,i),e=Y(W.minDuration,W.maxDuration,Q(e)),i<1?(o=u=>{let l=u*i,f=l*e,m=l-r,d=Lo(u,i),h=Math.exp(-f);return Ro-m/d*h},s=u=>{let f=u*i*e,m=f*r+r,d=Math.pow(i,2)*Math.pow(u,2)*e,h=Math.exp(-f),g=Lo(Math.pow(u,2),i);return(-o(u)+Ro>0?-1:1)*((m-d)*h)/g}):(o=u=>{let l=Math.exp(-u*e),f=(u-r)*e+1;return-Ro+l*f},s=u=>{let l=Math.exp(-u*e),f=(r-u)*(e*e);return l*f});let a=5/e,c=Jc(o,s,a);if(e=H(e),isNaN(c))return{stiffness:W.stiffness,damping:W.damping,duration:e};{let u=Math.pow(c,2)*n;return{stiffness:u,damping:i*2*Math.sqrt(n*u),duration:e}}}var eu=["duration","bounce"],tu=["stiffness","damping","mass"];function ys(e,t){return t.some(r=>e[r]!==void 0)}function ru(e){let t={velocity:W.velocity,stiffness:W.stiffness,damping:W.damping,mass:W.mass,isResolvedFromDuration:!1,...e};if(!ys(e,tu)&&ys(e,eu))if(t.velocity=0,e.visualDuration){let r=e.visualDuration,n=2*Math.PI/(r*1.2),o=n*n,s=2*Y(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:W.mass,stiffness:o,damping:s}}else{let r=Qc({...e,velocity:0});t={...t,...r,mass:W.mass},t.isResolvedFromDuration=!0}return t}function Mt(e=W.visualDuration,t=W.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:n,restDelta:o}=r,s=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:l,duration:f,velocity:m,isResolvedFromDuration:d}=ru({...r,velocity:-Q(r.velocity||0)}),h=m||0,g=u/(2*Math.sqrt(c*l)),x=i-s,v=Q(Math.sqrt(c/l)),w=Math.abs(x)<5;n||(n=w?W.restSpeed.granular:W.restSpeed.default),o||(o=w?W.restDelta.granular:W.restDelta.default);let b,y,T,P,M,V;if(g<1)T=Lo(v,g),P=(h+g*v*x)/T,b=C=>{let R=Math.exp(-g*v*C);return i-R*(P*Math.sin(T*C)+x*Math.cos(T*C))},M=g*v*P+x*T,V=g*v*x-P*T,y=C=>Math.exp(-g*v*C)*(M*Math.sin(T*C)+V*Math.cos(T*C));else if(g===1){b=R=>i-Math.exp(-v*R)*(x+(h+v*x)*R);let C=h+v*x;y=R=>Math.exp(-v*R)*(v*C*R-h)}else{let C=v*Math.sqrt(g*g-1);b=Z=>{let E=Math.exp(-g*v*Z),L=Math.min(C*Z,300);return i-E*((h+g*v*x)*Math.sinh(L)+C*x*Math.cosh(L))/C};let R=(h+g*v*x)/C,_=g*v*R-x*C,ae=g*v*x-R*C;y=Z=>{let E=Math.exp(-g*v*Z),L=Math.min(C*Z,300);return E*(_*Math.sinh(L)+ae*Math.cosh(L))}}let O={calculatedDuration:d&&f||null,velocity:C=>H(y(C)),next:C=>{if(!d&&g<1){let _=Math.exp(-g*v*C),ae=Math.sin(T*C),Z=Math.cos(T*C),E=i-_*(P*ae+x*Z),L=H(_*(M*ae+V*Z));return a.done=Math.abs(L)<=n&&Math.abs(i-E)<=o,a.value=a.done?i:E,a}let R=b(C);if(d)a.done=C>=f;else{let _=H(y(C));a.done=Math.abs(_)<=n&&Math.abs(i-R)<=o}return a.value=a.done?i:R,a},toString:()=>{let C=Math.min(At(O),2e4),R=rn(_=>O.next(C*_).value,C,30);return C+"ms "+R},toTransition:()=>{}};return O}Mt.applyToOptions=e=>{let t=xs(e,100,Mt);return e.ease=t.ease,e.duration=H(t.duration),e.type="keyframes",e};var nu=5;function nn(e,t,r){let n=Math.max(t-nu,0);return Zt(r-e(n),t-n)}function ur({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:c,restDelta:u=.5,restSpeed:l}){let f=e[0],m={done:!1,value:f},d=V=>a!==void 0&&V<a||c!==void 0&&V>c,h=V=>a===void 0?c:c===void 0||Math.abs(a-V)<Math.abs(c-V)?a:c,g=r*t,x=f+g,v=i===void 0?x:i(x);v!==x&&(g=v-f);let w=V=>-g*Math.exp(-V/n),b=V=>v+w(V),y=V=>{let O=w(V),C=b(V);m.done=Math.abs(O)<=u,m.value=m.done?v:C},T,P,M=V=>{d(m.value)&&(T=V,P=Mt({keyframes:[m.value,h(m.value)],velocity:nn(b,V,m.value),damping:o,stiffness:s,restDelta:u,restSpeed:l}))};return M(0),{calculatedDuration:null,next:V=>{let O=!1;return!P&&T===void 0&&(O=!0,y(V),M(V)),T!==void 0&&V>=T?P.next(V-T):(!O&&y(V),m)}}}function ou(e,t,r){let n=[],o=r||ie.mix||tn,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){let c=Array.isArray(t)?t[i]||z:t;a=we(c,a)}n.push(a)}return n}function vs(e,t,{clamp:r=!0,ease:n,mixer:o}={}){let s=e.length;if(ue(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];let i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=ou(t,n,o),c=a.length,u=l=>{if(i&&l<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(l<e[f+1]);f++);let m=Se(e[f],e[f+1],l);return a[f](m)};return r?l=>u(Y(e[0],e[s-1],l)):u}function bs(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let o=Se(0,t,n);e.push(D(r,1,o))}}function ws(e){let t=[0];return bs(t,e.length-1),t}function Ts(e,t){return e.map(r=>r*t)}function iu(e,t){return e.map(()=>t||nr).splice(0,e.length-1)}function ot({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let o=So(n)?n.map($r):$r(n),s={done:!1,value:t[0]},i=Ts(r&&r.length===t.length?r:ws(t),e),a=vs(i,t,{ease:Array.isArray(o)?o:iu(t,o)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}var su=e=>e!==null;function _e(e,{repeat:t,repeatType:r="loop"},n,o=1){let s=e.filter(su),a=o<0||t&&r!=="loop"&&t%2===1?0:s.length-1;return!a||n===void 0?s[a]:n}var au={decay:ur,inertia:ur,tween:ot,keyframes:ot,spring:Mt};function on(e){typeof e.type=="string"&&(e.type=au[e.type])}var $e=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}};var lu=e=>e/100,Oe=class extends $e{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var n,o;let{motionValue:r}=this.options;r&&r.updatedAt!==G.now()&&this.tick(G.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(n=this.options).onStop)==null||o.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;on(t);let{type:r=ot,repeat:n=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=t,{keyframes:a}=t,c=r||ot;c!==ot&&typeof a[0]!="number"&&(this.mixKeyframes=we(lu,tn(a[0],a[1])),a=[0,100]);let u=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=At(u));let{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+o,this.totalDuration=this.resolvedDuration*(n+1)-o,this.generator=u}updateTime(t){let r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){let{generator:n,totalDuration:o,mixKeyframes:s,mirroredGenerator:i,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);let{delay:u=0,keyframes:l,repeat:f,repeatType:m,repeatDelay:d,type:h,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),w=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let b=this.currentTime,y=n;if(f){let V=Math.min(this.currentTime,o)/a,O=Math.floor(V),C=V%1;!C&&V>=1&&(C=1),C===1&&O--,O=Math.min(O,f+1),!!(O%2)&&(m==="reverse"?(C=1-C,d&&(C-=d/a)):m==="mirror"&&(y=i)),b=Y(0,1,C)*a}let T;w?(this.delayState.value=l[0],T=this.delayState):T=y.next(b),s&&!w&&(T.value=s(T.value));let{done:P}=T;!w&&c!==null&&(P=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);let M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return M&&h!==ur&&(T.value=_e(l,this.options,x,this.speed)),g&&g(T.value),M&&this.finish(),T}then(t,r){return this.finished.then(t,r)}get duration(){return Q(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Q(t)}get time(){return Q(this.currentTime)}set time(t){t=H(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),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let r=this.generator.next(t).value;return nn(n=>this.generator.next(n).value,t,r)}get speed(){return this.playbackSpeed}set speed(t){let r=this.playbackSpeed!==t;r&&this.driver&&this.updateTime(G.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=Q(this.currentTime))}play(){var o,s;if(this.isStopped)return;let{driver:t=gs,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),(s=(o=this.options).onPlay)==null||s.call(o);let n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r!=null?r:n),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(G.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.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 r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}};function Ss(e){var t;for(let r=1;r<e.length;r++)(t=e[r])!=null||(e[r]=e[r-1])}var it=e=>e*180/Math.PI,Io=e=>{let t=it(Math.atan2(e[1],e[0]));return Oo(t)},cu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Io,rotateZ:Io,skewX:e=>it(Math.atan(e[1])),skewY:e=>it(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Oo=e=>(e=e%360,e<0&&(e+=360),e),Vs=Io,Ps=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Cs=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),uu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ps,scaleY:Cs,scale:e=>(Ps(e)+Cs(e))/2,rotateX:e=>Oo(it(Math.atan2(e[6],e[5]))),rotateY:e=>Oo(it(Math.atan2(-e[2],e[0]))),rotateZ:Vs,rotate:Vs,skewX:e=>it(Math.atan(e[4])),skewY:e=>it(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function sn(e){return e.includes("scale")?1:0}function an(e,t){if(!e||e==="none")return sn(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),n,o;if(r)n=uu,o=r;else{let a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=cu,o=a}if(!o)return sn(t);let s=n[t],i=o[1].split(",").map(fu);return typeof s=="function"?s(i):i[s]}var Es=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return an(r,t)};function fu(e){return parseFloat(e.trim())}var Ce=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xe=new Set([...Ce,"pathRotation"]);var Bo=e=>e===Ve||e===S,mu=new Set(["x","y","z"]),du=Ce.filter(e=>!mu.has(e));function As(e){let t=[];return du.forEach(r=>{let n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}var Be={width:({x:e},{paddingLeft:t="0",paddingRight:r="0",boxSizing:n})=>{let o=e.max-e.min;return n==="border-box"?o:o-parseFloat(t)-parseFloat(r)},height:({y:e},{paddingTop:t="0",paddingBottom:r="0",boxSizing:n})=>{let o=e.max-e.min;return n==="border-box"?o:o-parseFloat(t)-parseFloat(r)},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})=>an(t,"x"),y:(e,{transform:t})=>an(t,"y")};Be.translateX=Be.x;Be.translateY=Be.y;var st=new Set,Fo=!1,No=!1,jo=!1;function Ms(){if(No){let e=Array.from(st).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{let o=As(n);o.length&&(r.set(n,o),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();let o=r.get(n);o&&o.forEach(([s,i])=>{var a;(a=n.getValue(s))==null||a.set(i)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}No=!1,Fo=!1,st.forEach(e=>e.complete(jo)),st.clear()}function Ds(){st.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(No=!0)})}function ks(){jo=!0,Ds(),Ms(),jo=!1}var Ye=class{constructor(t,r,n,o,s,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(st.add(this),Fo||(Fo=!0,A.read(Ds),A.resolveKeyframes(Ms))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:n,motionValue:o}=this;if(t[0]===null){let s=o==null?void 0:o.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(n&&r){let a=n.readValue(r,i);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}Ss(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),st.delete(this)}cancel(){this.state==="scheduled"&&(st.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var Rs=e=>e.startsWith("--");function ln(e,t,r){Rs(t)?e.style.setProperty(t,r):e.style[t]=r}var Ls={};function cn(e,t){let r=qt(e);return()=>{var n;return(n=Ls[t])!=null?n:r()}}var Is=cn(()=>window.ScrollTimeline!==void 0,"scrollTimeline");var un=cn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing");var at=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;var zo={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:at([0,.65,.55,1]),circOut:at([.55,0,1,.45]),backIn:at([.31,.01,.66,-.59]),backOut:at([.33,1.53,.69,.99])};function Go(e,t){if(e)return typeof e=="function"?un()?rn(e,t):"ease-out":or(e)?at(e):Array.isArray(e)?e.map(r=>Go(r,t)||zo.easeOut):zo[e]}function Os(e,t,r,{delay:n=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:c}={},u=void 0){let l={[t]:r};c&&(l.offset=c);let f=Go(a,o);Array.isArray(f)&&(l.easing=f);let m={delay:n,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"};return u&&(m.pseudoElement=u),e.animate(l,m)}function fn(e){return typeof e=="function"&&"applyToOptions"in e}function Bs({type:e,...t}){var r,n;return fn(e)&&un()?e.applyToOptions(t):((r=t.duration)!=null||(t.duration=300),(n=t.ease)!=null||(t.ease="easeOut"),t)}var Dt=class extends $e{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;let{element:r,name:n,keyframes:o,pseudoElement:s,allowFlatten:i=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=i,this.options=t,ue(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let u=Bs(t);this.animation=Os(r,n,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let l=_e(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),ln(r,n,l),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var r,n,o;let t=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((o=(n=this.animation).commitStyles)==null||o.call(n))}get duration(){var r,n;let t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return Q(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Q(t)}get time(){return Q(Number(this.animation.currentTime)||0)}set time(t){let r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=H(t),r&&this.animation.pause()}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(){var t;return(t=this.manualStartTime)!=null?t:Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:r,rangeEnd:n,observe:o}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Is()?(this.animation.timeline=t,r&&(this.animation.rangeStart=r),n&&(this.animation.rangeEnd=n),z):o(this)}};var Fs={anticipate:Qt,backInOut:Jt,circInOut:rr};function pu(e){return e in Fs}function Ns(e){typeof e.ease=="string"&&pu(e.ease)&&(e.ease=Fs[e.ease])}var Wo=10,mn=class extends Dt{constructor(t){Ns(t),on(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:r,onUpdate:n,onComplete:o,element:s,...i}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let a=new Oe({...i,autoplay:!1}),c=Math.max(Wo,G.now()-this.startTime),u=Y(0,Wo,c-Wo),l=a.sample(c).value,{name:f}=this.options;s&&f&&ln(s,f,l),r.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}};var Uo=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(X.test(e)||e==="0")&&!e.startsWith("url("));function hu(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function js(e,t,r,n){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let s=e[e.length-1],i=Uo(o,t),a=Uo(s,t);return Re(i===a,`You are trying to animate ${t} from "${o}" to "${s}". "${i?s:o}" is not an animatable value.`,"value-not-animatable"),!i||!a?!1:hu(e)||(r==="spring"||fn(r))&&n}function fr(e){e.duration=0,e.type="keyframes"}var dn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);var gu=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function zs(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&gu.test(e[t]))return!0;return!1}var xu=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),yu=qt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Gs(e){var f;let{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:s,type:i,keyframes:a}=e,c=(f=t==null?void 0:t.owner)==null?void 0:f.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:u,transformTemplate:l}=t.owner.getProps();return yu()&&r&&(dn.has(r)||xu.has(r)&&zs(a))&&(r!=="transform"||!l)&&!u&&!n&&o!=="mirror"&&s!==0&&i!=="inertia"}var vu=40,pn=class extends $e{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",keyframes:a,name:c,motionValue:u,element:l,...f}){var h;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=G.now();let m={autoplay:t,delay:r,type:n,repeat:o,repeatDelay:s,repeatType:i,name:c,motionValue:u,element:l,...f},d=(l==null?void 0:l.KeyframeResolver)||Ye;this.keyframeResolver=new d(a,(g,x,v)=>this.onKeyframesResolved(g,x,m,!v),c,u,l),(h=this.keyframeResolver)==null||h.scheduleResolve()}onKeyframesResolved(t,r,n,o){var v,w;this.keyframeResolver=void 0;let{name:s,type:i,velocity:a,delay:c,isHandoff:u,onUpdate:l}=n;this.resolvedAt=G.now();let f=!0;js(t,s,i,a)||(f=!1,(ie.instantAnimations||!c)&&(l==null||l(_e(t,n,r))),t[0]=t[t.length-1],fr(n),n.repeat=0);let d={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>vu?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},h=f&&!u&&Gs(d),g=(w=(v=d.motionValue)==null?void 0:v.owner)==null?void 0:w.current,x;if(h)try{x=new mn({...d,element:g})}catch(b){x=new Oe(d)}else x=new Oe(d);x.finished.then(()=>{this.notifyFinished()}).catch(z),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),ks()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}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()}};function hn(e,t,r,n=0,o=1){let s=Array.from(e).sort((u,l)=>u.sortNodePosition(l)).indexOf(t),i=e.size,a=(i-1)*n;return typeof r=="function"?r(s,i):o===1?s*n:a-s*n}var Ws=30,bu=e=>!isNaN(parseFloat(e)),Us={current:void 0},Ho=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var s;let o=G.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(let i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=G.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=bu(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Le);let n=this.events[t].add(r);return t==="change"?()=>{n(),A.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&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 Us.current&&Us.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=G.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ws)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,Ws);return Zt(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),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,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Te(e,t){return new Ho(e,t)}function gn(e,t){if(e!=null&&e.inherit&&t){let{inherit:r,...n}=e;return{...t,...n}}return e}function kt(e,t){var n,o;let r=(o=(n=e==null?void 0:e[t])!=null?n:e==null?void 0:e.default)!=null?o:e;return r!==e?gn(r,e):r}var wu={type:"spring",stiffness:500,damping:25,restSpeed:10},Tu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Su={type:"keyframes",duration:.8},Vu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Hs=(e,{keyframes:t})=>t.length>2?Su:xe.has(e)?e.startsWith("scale")?Tu(t[1]):wu:Vu;var Pu=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Ks(e){for(let t in e)if(!Pu.has(t))return!0;return!1}var lt=(e,t,r,n={},o,s)=>i=>{let a=kt(n,e)||{},c=a.delay||n.delay||0,{elapsed:u=0}=n;u=u-H(c);let l={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};Ks(a)||Object.assign(l,Hs(e,l)),l.duration&&(l.duration=H(l.duration)),l.repeatDelay&&(l.repeatDelay=H(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let f=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(fr(l),l.delay===0&&(f=!0)),(ie.instantAnimations||ie.skipAnimations||o!=null&&o.shouldSkipAnimations||a.skipAnimations)&&(f=!0,fr(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){let m=_e(l.keyframes,a);if(m!==void 0){A.update(()=>{l.onUpdate(m),l.onComplete()});return}}return a.isSync?new Oe(l):new pn(l)};var Cu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Eu(e){let t=Cu.exec(e);if(!t)return[,];let[,r,n,o]=t;return[`--${r!=null?r:n}`,o]}var Au=4;function Ko(e,t,r=1){ue(r<=Au,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,o]=Eu(e);if(!n)return;let s=window.getComputedStyle(t).getPropertyValue(n);if(s){let i=s.trim();return $t(i)?parseFloat(i):i}return Vt(o)?Ko(o,t,r+1):o}function _s(e){let t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function ct(e,t,r,n){if(typeof t=="function"){let[o,s]=_s(n);t=t(r!==void 0?r:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,s]=_s(n);t=t(r!==void 0?r:e.custom,o,s)}return t}function de(e,t,r){let n=e.getProps();return ct(n,t,r!==void 0?r:n.custom,e)}var xn=new Set(["width","height","top","left","right","bottom",...Ce]);var mr=e=>Array.isArray(e);function Mu(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Te(r))}function Du(e){return mr(e)?e[e.length-1]||0:e}function $s(e,t){let r=de(e,t),{transitionEnd:n={},transition:o={},...s}=r||{};s={...s,...n};for(let i in s){let a=Du(s[i]);Mu(e,i,a)}}var I=e=>!!(e&&e.getVelocity);function Ys(e){return!!(I(e)&&e.add)}function Rt(e,t){let r=e.getValue("willChange");if(Ys(r))return r.add(t);if(!r&&ie.WillChange){let n=new ie.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function Lt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Xs="framerAppearId",dr="data-"+Lt(Xs);function yn(e){return e.props[dr]}function ku({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function vn(e,t,{delay:r=0,transitionOverride:n,type:o}={}){var h;let{transition:s,transitionEnd:i,...a}=t,c=e.getDefaultTransition();s=s?gn(s,c):c;let u=s==null?void 0:s.reduceMotion,l=s==null?void 0:s.skipAnimations;n&&(s=n);let f=[],m=o&&e.animationState&&e.animationState.getState()[o],d=s==null?void 0:s.path;d&&d.animateVisualElement(e,a,s,r,f);for(let g in a){let x=e.getValue(g,(h=e.latestValues[g])!=null?h:null),v=a[g];if(v===void 0||m&&ku(m,g))continue;let w={delay:r,...kt(s||{},g)};l&&(w.skipAnimations=!0);let b=x.get();if(b!==void 0&&!x.isAnimating()&&!Array.isArray(v)&&v===b&&!w.velocity){A.update(()=>x.set(v));continue}let y=!1;if(window.MotionHandoffAnimation){let M=yn(e);if(M){let V=window.MotionHandoffAnimation(M,g,A);V!==null&&(w.startTime=V,y=!0)}}Rt(e,g);let T=u!=null?u:e.shouldReduceMotion;x.start(lt(g,x,v,T&&xn.has(g)?{type:!1}:w,e,y));let P=x.animation;P&&f.push(P)}if(i){let g=()=>A.update(()=>{i&&$s(e,i)});f.length?Promise.all(f).then(g):g()}return f}function bn(e,t,r={}){var c;let n=de(e,t,r.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0),{transition:o=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(o=r.transitionOverride);let s=n?()=>Promise.all(vn(e,n,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:l=0,staggerChildren:f,staggerDirection:m}=o;return Ru(e,t,u,l,f,m,r)}:()=>Promise.resolve(),{when:a}=o;if(a){let[u,l]=a==="beforeChildren"?[s,i]:[i,s];return u().then(()=>l())}else return Promise.all([s(),i(r.delay)])}function Ru(e,t,r=0,n=0,o=0,s=1,i){let a=[];for(let c of e.variantChildren)c.notify("AnimationStart",t),a.push(bn(c,t,{...i,delay:r+(typeof n=="function"?0:n)+hn(e.variantChildren,c,n,o,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function qs(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){let o=t.map(s=>bn(e,s,r));n=Promise.all(o)}else if(typeof t=="string")n=bn(e,t,r);else{let o=typeof t=="function"?de(e,t,r.custom):t;n=Promise.all(vn(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}var Zs={test:e=>e==="auto",parse:e=>e};var wn=e=>t=>t.test(e);var _o=[Ve,S,ne,ge,Eo,Co,Zs],$o=e=>_o.find(wn(e));function Js(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Xt(e):!0}var Lu=new Set(["brightness","contrast","saturate","opacity"]);function Iu(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(Pt)||[];if(!n)return e;let o=r.replace(n,""),s=Lu.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+o+")"}var Ou=/\b([a-z-]*)\(.*?\)/gu,pr={...X,getAnimatableNone:e=>{let t=e.match(Ou);return t?t.map(Iu).join(" "):e}};var hr={...X,getAnimatableNone:e=>{let t=X.parse(e);return X.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}};var Yo={...Ve,transform:Math.round};var Qs={rotate:ge,pathRotation:ge,rotateX:ge,rotateY:ge,rotateZ:ge,scale:ar,scaleX:ar,scaleY:ar,scaleZ:ar,skew:ge,skewX:ge,skewY:ge,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:Ie,originX:Jr,originY:Jr,originZ:S};var ut={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,inset:S,insetBlock:S,insetBlockStart:S,insetBlockEnd:S,insetInline:S,insetInlineStart:S,insetInlineEnd:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockStart:S,paddingBlockEnd:S,paddingInline:S,paddingInlineStart:S,paddingInlineEnd:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockStart:S,marginBlockEnd:S,marginInline:S,marginInlineStart:S,marginInlineEnd:S,fontSize:S,backgroundPositionX:S,backgroundPositionY:S,...Qs,zIndex:Yo,fillOpacity:Ie,strokeOpacity:Ie,numOctaves:Yo};var Bu={...ut,color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:pr,WebkitFilter:pr,mask:hr,WebkitMask:hr},Tn=e=>Bu[e];var Fu=new Set([pr,hr]);function Sn(e,t){let r=Tn(e);return Fu.has(r)||(r=X),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var Nu=new Set(["auto","none","0"]);function ea(e,t,r){let n=0,o;for(;n<e.length&&!o;){let s=e[n];typeof s=="string"&&!Nu.has(s)&&Ke(s).values.length&&(o=e[n]),n++}if(o&&r)for(let s of t)e[s]=Sn(r,o)}var Vn=class extends Ye{constructor(t,r,n,o,s){super(t,r,n,o,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let f=t[l];if(typeof f=="string"&&(f=f.trim(),Vt(f))){let m=Ko(f,r.current);m!==void 0&&(t[l]=m),l===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!xn.has(n)||t.length!==2)return;let[o,s]=t,i=$o(o),a=$o(s),c=Vo(o),u=Vo(s);if(c!==u&&Be[n]){this.needsMeasurement=!0;return}if(i!==a)if(Bo(i)&&Bo(a))for(let l=0;l<t.length;l++){let f=t[l];typeof f=="string"&&(t[l]=parseFloat(f))}else Be[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,n=[];for(let o=0;o<t.length;o++)(t[o]===null||Js(t[o]))&&n.push(o);n.length&&ea(t,n,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Be[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let o=r[r.length-1];o!==void 0&&t.getValue(n,o).jump(o,!1)}measureEndState(){var a;let{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;let o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);let s=n.length-1,i=n[s];n[s]=Be[r](t.measureViewportBox(),window.getComputedStyle(t.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}};var gr=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Pn(e,t,r){var n;if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let s=(n=r==null?void 0:r[e])!=null?n:o.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(o=>o!=null)}var xr=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ta(e){return Yt(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var{schedule:ft,cancel:ju}=Yr(queueMicrotask,!1);var ye={x:!1,y:!1};function Cn(){return ye.x||ye.y}function Xo(e){return e==="x"||e==="y"?ye[e]?null:(ye[e]=!0,()=>{ye[e]=!1}):ye.x||ye.y?null:(ye.x=ye.y=!0,()=>{ye.x=ye.y=!1})}function En(e,t){let r=Pn(e),n=new AbortController,o={passive:!0,...t,signal:n.signal};return[r,o,()=>n.abort()]}function zu(e){return!(e.pointerType==="touch"||Cn())}function qo(e,t,r={}){let[n,o,s]=En(e,r);return n.forEach(i=>{let a=!1,c=!1,u,l=()=>{i.removeEventListener("pointerleave",h)},f=x=>{u&&(u(x),u=void 0),l()},m=x=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,f(x))},d=()=>{a=!0,window.addEventListener("pointerup",m,o),window.addEventListener("pointercancel",m,o)},h=x=>{if(x.pointerType!=="touch"){if(a){c=!0;return}f(x)}},g=x=>{if(!zu(x))return;c=!1;let v=t(i,x);typeof v=="function"&&(u=v,i.addEventListener("pointerleave",h,o))};i.addEventListener("pointerenter",g,o),i.addEventListener("pointerdown",d,o)}),s}var Zo=(e,t)=>t?e===t?!0:Zo(e,t.parentElement):!1;var mt=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var Gu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Jo(e){return Gu.has(e.tagName)||e.isContentEditable===!0}var Wu=new Set(["INPUT","SELECT","TEXTAREA"]);function Qo(e){return Wu.has(e.tagName)||e.isContentEditable===!0}var It=new WeakSet;function ra(e){return t=>{t.key==="Enter"&&e(t)}}function ei(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var na=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=ra(()=>{if(It.has(r))return;ei(r,"down");let o=ra(()=>{ei(r,"up")}),s=()=>ei(r,"cancel");r.addEventListener("keyup",o,t),r.addEventListener("blur",s,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function oa(e){return mt(e)&&!Cn()}var ia=new WeakSet;function ti(e,t,r={}){let[n,o,s]=En(e,r),i=a=>{let c=a.currentTarget;if(!oa(a)||ia.has(a))return;It.add(c),r.stopPropagation&&ia.add(a);let u=t(c,a),l={...o,capture:!0},f=(h,g)=>{window.removeEventListener("pointerup",m,l),window.removeEventListener("pointercancel",d,l),It.has(c)&&It.delete(c),oa(h)&&typeof u=="function"&&u(h,{success:g})},m=h=>{f(h,c===window||c===document||r.useGlobalTarget||Zo(c,h.target))},d=h=>{f(h,!1)};window.addEventListener("pointerup",m,l),window.addEventListener("pointercancel",d,l)};return n.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),ta(a)&&(a.addEventListener("focus",u=>na(u,o)),!Jo(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Ot(e){return Yt(e)&&"ownerSVGElement"in e}var An=new WeakMap,Xe,sa=(e,t,r)=>(n,o)=>o&&o[0]?o[0][e+"Size"]:Ot(n)&&"getBBox"in n?n.getBBox()[t]:n[r],Uu=sa("inline","width","offsetWidth"),Hu=sa("block","height","offsetHeight");function Ku({target:e,borderBoxSize:t}){var r;(r=An.get(e))==null||r.forEach(n=>{n(e,{get width(){return Uu(e,t)},get height(){return Hu(e,t)}})})}function _u(e){e.forEach(Ku)}function $u(){typeof ResizeObserver!="undefined"&&(Xe=new ResizeObserver(_u))}function aa(e,t){Xe||$u();let r=Pn(e);return r.forEach(n=>{let o=An.get(n);o||(o=new Set,An.set(n,o)),o.add(t),Xe==null||Xe.observe(n)}),()=>{r.forEach(n=>{let o=An.get(n);o==null||o.delete(t),o!=null&&o.size||Xe==null||Xe.unobserve(n)})}}var Mn=new Set,Bt;function Yu(){Bt=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Mn.forEach(t=>t(e))},window.addEventListener("resize",Bt)}function la(e){return Mn.add(e),Bt||Yu(),()=>{Mn.delete(e),!Mn.size&&typeof Bt=="function"&&(window.removeEventListener("resize",Bt),Bt=void 0)}}function Dn(e,t){return typeof e=="function"?la(e):aa(e,t)}var dt={value:null,addProjectionMetrics:null};function ca(e){return Ot(e)&&e.tagName==="svg"}var Xu=[..._o,B,X],ua=e=>Xu.find(wn(e));var ri=()=>({translate:0,scale:1,origin:0,originPoint:0}),qe=()=>({x:ri(),y:ri()}),ni=()=>({min:0,max:0}),F=()=>({x:ni(),y:ni()});var fa=new WeakMap;function Fe(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ee(e){return typeof e=="string"||Array.isArray(e)}var kn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yr=["initial",...kn];function Ze(e){return Fe(e.animate)||yr.some(t=>Ee(e[t]))}function vr(e){return!!(Ze(e)||e.variants)}function ma(e,t,r){for(let n in t){let o=t[n],s=r[n];if(I(o))e.addValue(n,o);else if(I(s))e.addValue(n,Te(o,{owner:e}));else if(s!==o)if(e.hasValue(n)){let i=e.getValue(n);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{let i=e.getStaticValue(n);e.addValue(n,Te(i!==void 0?i:o,{owner:e}))}}for(let n in r)t[n]===void 0&&e.removeValue(n);return t}var br={current:null},Rn={current:!1};var qu=typeof window!="undefined";function da(){if(Rn.current=!0,!!qu)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>br.current=e.matches;e.addEventListener("change",t),t()}else br.current=!1}var pa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ln={};function Tr(e){Ln=e}function oi(){return Ln}var wr=class{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:o,skipAnimations:s,blockInitialAnimation:i,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ye,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let d=G.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,A.render(this.render,!1,!0))};let{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=r.initial?{...u}:{},this.renderState=l,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!i,this.isControllingVariants=Ze(r),this.isVariantNode=vr(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:f,...m}=this.scrapeMotionValuesFromProps(r,{},this);for(let d in m){let h=m[d];u[d]!==void 0&&I(h)&&h.set(u[d])}}mount(t){var r,n,o;if(this.hasBeenMounted)for(let s in this.initialValues)(r=this.values.get(s))==null||r.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,fa.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,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Rn.current||da(),this.shouldReduceMotion=br.current),this.shouldSkipAnimations=(n=this.skipAnimationsConfig)!=null?n:!1,(o=this.parent)==null||o.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),fe(this.notifyUpdate),fe(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(let r in this.events)this.events[r].clear();for(let r in this.features){let n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){var r;this.children.add(t),(r=this.enteringChildren)!=null||(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),r.accelerate&&dn.has(t)&&this.current instanceof HTMLElement){let{factory:i,keyframes:a,times:c,ease:u,duration:l}=r.accelerate,f=new Dt({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:H(l)}),m=i(f);this.valueSubscriptions.set(t,()=>{m(),f.cancel()});return}let n=xe.has(t);n&&this.onBindTransform&&this.onBindTransform();let o=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&A.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),s;typeof window!="undefined"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{o(),s&&s()})}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 Ln){let r=Ln[t];if(!r)continue;let{isEnabled:n,Feature:o}=r;if(!this.features[t]&&o&&n(this.props)&&(this.features[t]=new o(this)),this.features[t]){let s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):F()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<pa.length;n++){let o=pa[n];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=ma(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){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=Te(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){var o;let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(o=this.getBaseTargetFromProps(this.props,t))!=null?o:this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&($t(n)||Xt(n))?n=parseFloat(n):!ua(n)&&X.test(r)&&(n=Sn(t,r)),this.setBaseTarget(t,I(n)?n.get():n)),I(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var s;let{initial:r}=this.props,n;if(typeof r=="string"||typeof r=="object"){let i=ct(this.props,r,(s=this.presenceContext)==null?void 0:s.custom);i&&(n=i[t])}if(r&&n!==void 0)return n;let o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!I(o)?o:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Le),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){ft.render(this.render)}};var Ft=class extends wr{constructor(){super(...arguments),this.KeyframeResolver=Vn}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){let n=t.style;return n?n[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;I(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};var q=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};function Sr({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function ii({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function si(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function ai(e){return e===void 0||e===1}function In({scale:e,scaleX:t,scaleY:r}){return!ai(e)||!ai(t)||!ai(r)}function Ne(e){return In(e)||li(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function li(e){return ha(e.x)||ha(e.y)}function ha(e){return e&&e!=="0%"}function Vr(e,t,r){let n=e-r,o=t*n;return r+o}function ga(e,t,r,n,o){return o!==void 0&&(e=Vr(e,o,n)),Vr(e,r,n)+t}function ci(e,t=0,r=1,n,o){e.min=ga(e.min,t,r,n,o),e.max=ga(e.max,t,r,n,o)}function ui(e,{x:t,y:r}){ci(e.x,t.translate,t.scale,t.originPoint),ci(e.y,r.translate,r.scale,r.originPoint)}var xa=.999999999999,ya=1.0000000000001;function wa(e,t,r,n=!1){var a;let o=r.length;if(!o)return;t.x=t.y=1;let s,i;for(let c=0;c<o;c++){s=r[c],i=s.projectionDelta;let{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(ve(e.x,-s.scroll.offset.x),ve(e.y,-s.scroll.offset.y)),i&&(t.x*=i.x.scale,t.y*=i.y.scale,ui(e,i)),n&&Ne(s.latestValues)&&Pr(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<ya&&t.x>xa&&(t.x=1),t.y<ya&&t.y>xa&&(t.y=1)}function ve(e,t){e.min+=t,e.max+=t}function va(e,t,r,n,o=.5){let s=D(e.min,e.max,o);ci(e,t,r,s,n)}function ba(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Pr(e,t,r){let n=r!=null?r:e;va(e.x,ba(t.x,n.x),t.scaleX,t.scale,t.originX),va(e.y,ba(t.y,n.y),t.scaleY,t.scale,t.originY)}function On(e,t){return Sr(si(e.getBoundingClientRect(),t))}function fi(e,t,r){let n=On(e,r),{scroll:o}=t;return o&&(ve(n.x,o.offset.x),ve(n.y,o.offset.y)),n}var Zu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ju=Ce.length;function Ta(e,t,r){let n="",o=!0;for(let i=0;i<Ju;i++){let a=Ce[i],c=e[a];if(c===void 0)continue;let u=!0;if(typeof c=="number")u=c===(a.startsWith("scale")?1:0);else{let l=parseFloat(c);u=a.startsWith("scale")?l===1:l===0}if(!u||r){let l=xr(c,ut[a]);if(!u){o=!1;let f=Zu[a]||a;n+=`${f}(${l}) `}r&&(t[a]=l)}}let s=e.pathRotation;return s&&(o=!1,n+=`rotate(${xr(s,ut.pathRotation)}) `),n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}function pt(e,t,r){let{style:n,vars:o,transformOrigin:s}=e,i=!1,a=!1;for(let c in t){let u=t[c];if(xe.has(c)){i=!0;continue}else if(qr(c)){o[c]=u;continue}else{let l=xr(u,ut[c]);c.startsWith("origin")?(a=!0,s[c]=l):n[c]=l}}if(t.transform||(i||r?n.transform=Ta(t,e.transform,r):n.transform&&(n.transform="none")),a){let{originX:c="50%",originY:u="50%",originZ:l=0}=s;n.transformOrigin=`${c} ${u} ${l}`}}function Bn(e,{style:t,vars:r},n,o){let s=e.style,i;for(i in t)s[i]=t[i];o==null||o.applyProjectionStyles(s,n);for(i in r)s.setProperty(i,r[i])}function Sa(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Nt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(S.test(e))e=parseFloat(e);else return e;let r=Sa(e,t.target.x),n=Sa(e,t.target.y);return`${r}% ${n}%`}};var Va={correct:(e,{treeScale:t,projectionDelta:r})=>{let n=e,o=X.parse(e);if(o.length>5)return n;let s=X.createTransformer(e),i=typeof o[0]!="number"?1:0,a=r.x.scale*t.x,c=r.y.scale*t.y;o[0+i]/=a,o[1+i]/=c;let u=D(a,c,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}};var Cr={borderRadius:{...Nt,applyTo:[...gr]},borderTopLeftRadius:Nt,borderTopRightRadius:Nt,borderBottomLeftRadius:Nt,borderBottomRightRadius:Nt,boxShadow:Va};function Er(e,{layout:t,layoutId:r}){return xe.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Cr[e]||e==="opacity")}function ht(e,t,r){var i;let n=e.style,o=t==null?void 0:t.style,s={};if(!n)return s;for(let a in n)(I(n[a])||o&&I(o[a])||Er(a,e)||((i=r==null?void 0:r.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(s[a]=n[a]);return s}function Qu(e){return window.getComputedStyle(e)}var Ar=class extends Ft{constructor(){super(...arguments),this.type="html",this.renderInstance=Bn}mount(t){ue(!!t.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,r){var n;if(xe.has(r))return(n=this.projection)!=null&&n.isProjecting?sn(r):Es(t,r);{let o=Qu(t),s=(qr(r)?o.getPropertyValue(r):o[r])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:r}){return On(t,r)}build(t,r,n){pt(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return ht(t,r,n)}};var ef={offset:"stroke-dashoffset",array:"stroke-dasharray"},tf={offset:"strokeDashoffset",array:"strokeDasharray"};function Pa(e,t,r=1,n=0,o=!0){e.pathLength=1;let s=o?ef:tf;e[s.offset]=`${-n}`,e[s.array]=`${t} ${r}`}var rf=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Mr(e,{attrX:t,attrY:r,attrScale:n,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},c,u,l){var d,h;if(pt(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:m}=e;f.transform&&(m.transform=f.transform,delete f.transform),(m.transform||f.transformOrigin)&&(m.transformOrigin=(d=f.transformOrigin)!=null?d:"50% 50%",delete f.transformOrigin),m.transform&&(m.transformBox=(h=l==null?void 0:l.transformBox)!=null?h:"fill-box",delete f.transformBox);for(let g of rf)f[g]!==void 0&&(m[g]=f[g],delete f[g]);t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),n!==void 0&&(f.scale=n),o!==void 0&&Pa(f,o,s,i,!1)}var Fn=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"]);var Dr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ca(e,t,r,n){Bn(e,t,void 0,n);for(let o in t.attrs)e.setAttribute(Fn.has(o)?o:Lt(o),t.attrs[o])}function kr(e,t,r){let n=ht(e,t,r);for(let o in e)if(I(e[o])||I(t[o])){let s=Ce.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;n[s]=e[o]}return n}var Rr=class extends Ft{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=F}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(xe.has(r)){let n=Tn(r);return n&&n.default||0}return r=Fn.has(r)?r:Lt(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return kr(t,r,n)}build(t,r,n){Mr(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,o){Ca(t,r,n,o)}mount(t){this.isSVGTag=Dr(t.tagName),super.mount(t)}};var nf=yr.length;function mi(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?mi(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<nf;r++){let n=yr[r],o=e.props[n];(Ee(o)||o===!1)&&(t[n]=o)}return t}function di(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}var of=[...kn].reverse(),sf=kn.length;function af(e){return t=>Promise.all(t.map(({animation:r,options:n})=>qs(e,r,n)))}function pi(e){let t=af(e),r=Ea(),n=!0,o=!1,s=u=>(l,f)=>{var d;let m=de(e,f,u==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);if(m){let{transition:h,transitionEnd:g,...x}=m;l={...l,...x,...g}}return l};function i(u){t=u(e)}function a(u){let{props:l}=e,f=mi(e.parent)||{},m=[],d=new Set,h={},g=1/0;for(let v=0;v<sf;v++){let w=of[v],b=r[w],y=l[w]!==void 0?l[w]:f[w],T=Ee(y),P=w===u?b.isActive:null;P===!1&&(g=v);let M=y===f[w]&&y!==l[w]&&T;if(M&&(n||o)&&e.manuallyAnimateOnMount&&(M=!1),b.protectedKeys={...h},!b.isActive&&P===null||!y&&!b.prevProp||Fe(y)||typeof y=="boolean")continue;if(w==="exit"&&b.isActive&&P!==!0){b.prevResolvedValues&&(h={...h,...b.prevResolvedValues});continue}let V=Aa(b.prevProp,y),O=V||w===u&&b.isActive&&!M&&T||v>g&&T,C=!1,R=Array.isArray(y)?y:[y],_=R.reduce(s(w),{});P===!1&&(_={});let{prevResolvedValues:ae={}}=b,Z={...ae,..._},E=$=>{O=!0,d.has($)&&(C=!0,d.delete($)),b.needsAnimating[$]=!0;let le=e.getValue($);le&&(le.liveStyle=!1)};for(let $ in Z){let le=_[$],J=ae[$];if(h.hasOwnProperty($))continue;let ke=!1;mr(le)&&mr(J)?ke=!di(le,J)||V:ke=le!==J,ke?le!=null?E($):d.add($):le!==void 0&&d.has($)?E($):b.protectedKeys[$]=!0}b.prevProp=y,b.prevResolvedValues=_,b.isActive&&(h={...h,..._}),(n||o)&&e.blockInitialAnimation&&(O=!1);let L=M&&V;O&&(!L||C)&&m.push(...R.map($=>{let le={type:w};if(typeof $=="string"&&(n||o)&&!L&&e.manuallyAnimateOnMount&&e.parent){let{parent:J}=e,ke=de(J,$);if(J.enteringChildren&&ke){let{delayChildren:Br}=ke.transition||{};le.delay=hn(J.enteringChildren,e,Br)}}return{animation:$,options:le}}))}if(d.size){let v={};if(typeof l.initial!="boolean"){let w=de(e,Array.isArray(l.initial)?l.initial[0]:l.initial);w&&w.transition&&(v.transition=w.transition)}d.forEach(w=>{let b=e.getBaseTarget(w),y=e.getValue(w);y&&(y.liveStyle=!0),v[w]=b!=null?b:null}),m.push({animation:v})}let x=!!m.length;return n&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(x=!1),n=!1,o=!1,x?t(m):Promise.resolve()}function c(u,l){var m;if(r[u].isActive===l)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(d=>{var h;return(h=d.animationState)==null?void 0:h.setActive(u,l)}),r[u].isActive=l;let f=a(u);for(let d in r)r[d].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:i,getState:()=>r,reset:()=>{r=Ea(),o=!0}}}function Aa(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!di(t,e):!1}function gt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ea(){return{animate:gt(!0),whileInView:gt(),whileHover:gt(),whileTap:gt(),whileDrag:gt(),whileFocus:gt(),exit:gt()}}function Nn(e,t){e.min=t.min,e.max=t.max}function be(e,t){Nn(e.x,t.x),Nn(e.y,t.y)}function hi(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Ma=1e-4,lf=1-Ma,cf=1+Ma,Da=.01,uf=0-Da,ff=0+Da;function K(e){return e.max-e.min}function vi(e,t,r){return Math.abs(e-t)<=r}function gi(e,t,r,n=.5){e.origin=n,e.originPoint=D(t.min,t.max,e.origin),e.scale=K(r)/K(t),e.translate=D(r.min,r.max,e.origin)-e.originPoint,(e.scale>=lf&&e.scale<=cf||isNaN(e.scale))&&(e.scale=1),(e.translate>=uf&&e.translate<=ff||isNaN(e.translate))&&(e.translate=0)}function xt(e,t,r,n){gi(e.x,t.x,r.x,n?n.originX:void 0),gi(e.y,t.y,r.y,n?n.originY:void 0)}function xi(e,t,r,n=0){let o=n?D(r.min,r.max,n):r.min;e.min=o+t.min,e.max=e.min+K(t)}function bi(e,t,r,n){xi(e.x,t.x,r.x,n==null?void 0:n.x),xi(e.y,t.y,r.y,n==null?void 0:n.y)}function yi(e,t,r,n=0){let o=n?D(r.min,r.max,n):r.min;e.min=t.min-o,e.max=e.min+K(t)}function jt(e,t,r,n){yi(e.x,t.x,r.x,n==null?void 0:n.x),yi(e.y,t.y,r.y,n==null?void 0:n.y)}function ka(e,t,r,n,o){return e-=t,e=Vr(e,1/r,n),o!==void 0&&(e=Vr(e,1/o,n)),e}function mf(e,t=0,r=1,n=.5,o,s=e,i=e){if(ne.test(t)&&(t=parseFloat(t),t=D(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=D(s.min,s.max,n);e===s&&(a-=t),e.min=ka(e.min,t,r,a,o),e.max=ka(e.max,t,r,a,o)}function Ra(e,t,[r,n,o],s,i){mf(e,t[r],t[n],t[o],t.scale,s,i)}var df=["x","scaleX","originX"],pf=["y","scaleY","originY"];function wi(e,t,r,n){Ra(e.x,t,df,r?r.x:void 0,n?n.x:void 0),Ra(e.y,t,pf,r?r.y:void 0,n?n.y:void 0)}function La(e){return e.translate===0&&e.scale===1}function Ti(e){return La(e.x)&&La(e.y)}function Ia(e,t){return e.min===t.min&&e.max===t.max}function Ba(e,t){return Ia(e.x,t.x)&&Ia(e.y,t.y)}function Oa(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Si(e,t){return Oa(e.x,t.x)&&Oa(e.y,t.y)}function Vi(e){return K(e.x)/K(e.y)}function Pi(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pe(e){return[e("x"),e("y")]}function Fa(e,t,r){let n="",o=e.x.translate/t.x,s=e.y.translate/t.y,i=(r==null?void 0:r.z)||0;if((o||s||i)&&(n=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:l,pathRotation:f,rotateX:m,rotateY:d,skewX:h,skewY:g}=r;u&&(n=`perspective(${u}px) ${n}`),l&&(n+=`rotate(${l}deg) `),f&&(n+=`rotate(${f}deg) `),m&&(n+=`rotateX(${m}deg) `),d&&(n+=`rotateY(${d}deg) `),h&&(n+=`skewX(${h}deg) `),g&&(n+=`skewY(${g}deg) `)}let a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(n+=`scale(${a}, ${c})`),n||"none"}var hf=gr.length,Na=e=>typeof e=="string"?parseFloat(e):e,ja=e=>typeof e=="number"||S.test(e);function Ga(e,t,r,n,o,s){var i,a,c,u;o?(e.opacity=D(0,(i=r.opacity)!=null?i:1,gf(n)),e.opacityExit=D((a=t.opacity)!=null?a:1,0,xf(n))):s&&(e.opacity=D((c=t.opacity)!=null?c:1,(u=r.opacity)!=null?u:1,n));for(let l=0;l<hf;l++){let f=gr[l],m=za(t,f),d=za(r,f);if(m===void 0&&d===void 0)continue;m||(m=0),d||(d=0),m===0||d===0||ja(m)===ja(d)?(e[f]=Math.max(D(Na(m),Na(d),n),0),(ne.test(d)||ne.test(m))&&(e[f]+="%")):e[f]=d}(t.rotate||r.rotate)&&(e.rotate=D(t.rotate||0,r.rotate||0,n))}function za(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var gf=Wa(0,.5,tr),xf=Wa(.5,.95,z);function Wa(e,t,r){return n=>n<e?0:n>t?1:r(Se(e,t,n))}function Ua(e,t,r){let n=I(e)?e:Te(e);return n.start(lt("",n,t,r)),n.animation}function Ae(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}var Ha=(e,t)=>e.depth-t.depth;var jn=class{constructor(){this.children=[],this.isDirty=!1}add(t){nt(this.children,t),this.isDirty=!0}remove(t){Ge(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ha),this.isDirty=!1,this.children.forEach(t)}};function Ka(e,t){let r=G.now(),n=({timestamp:o})=>{let s=o-r;s>=t&&(fe(n),e(s-t))};return A.setup(n,!0),()=>fe(n)}function yt(e){return I(e)?e.get():e}var zn=class{constructor(){this.members=[]}add(t){nt(this.members,t);for(let r=this.members.length-1;r>=0;r--){let n=this.members[r];if(n===t||n===this.lead||n===this.prevLead)continue;let o=n.instance;(!o||o.isConnected===!1)&&!n.snapshot&&(Ge(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(Ge(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){var r;for(let n=this.members.indexOf(t)-1;n>=0;n--){let o=this.members[n];if(o.isPresent!==!1&&((r=o.instance)==null?void 0:r.isConnected)!==!1)return this.promote(o),!0}return!1}promote(t,r){var o;let n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();let{layoutDependency:s}=n.options,{layoutDependency:i}=t.options;(s===void 0||s!==i)&&(t.resumeFrom=n,r&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),(o=t.root)!=null&&o.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var r,n,o,s,i;(n=(r=t.options).onExitComplete)==null||n.call(r),(i=(o=t.resumingFrom)==null?void 0:(s=o.options).onExitComplete)==null||i.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}};var vt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var bt={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ci=["","X","Y","Z"],yf=1e3,vf=0;function Ei(e,t,r,n){let{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function el(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=yn(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",A,!(o||s))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&el(n)}function Gn({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=vf++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,dt.value&&(bt.nodes=bt.calculatedTargetDeltas=bt.calculatedProjections=0),this.nodes.forEach(Tf),this.nodes.forEach(Af),this.nodes.forEach(Mf),this.nodes.forEach(Sf),dt.addProjectionMetrics&&dt.addProjectionMetrics(bt)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new jn)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Le),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){let c=this.eventHandlers.get(i);c&&c.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Ot(i)&&!ca(i),this.instance=i;let{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let l,f=0,m=()=>this.root.updateBlockedByResize=!1;A.read(()=>{f=window.innerWidth}),e(i,()=>{let d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,l&&l(),l=Ka(m,250),vt.hasAnimatedSinceResize&&(vt.hasAnimatedSinceResize=!1,this.nodes.forEach(Ya)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let h=this.options.transition||u.getDefaultTransition()||If,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!Si(this.targetLayout,d),w=!f&&m;if(this.options.layoutRoot||this.resumeFrom||w||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let b={...kt(h,"layout"),onPlay:g,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(l,w,b.path)}else f||Ya(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),fe(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Df),this.animationId++)}getTransformTemplate(){let{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&el(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){let f=this.path[l];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}let{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Pf),this.nodes.forEach(_a);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach($a);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Cf),this.nodes.forEach(Ef),this.nodes.forEach(bf),this.nodes.forEach(wf)):this.nodes.forEach($a),this.clearAllSnapshots();let a=G.now();U.delta=Y(0,1e3/60,a-U.timestamp),U.timestamp=a,U.isProcessing=!0,sr.update.process(U),sr.preRender.process(U),sr.render.process(U),U.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ft.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Vf),this.sharedNodes.forEach(kf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,A.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){A.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!K(this.snapshot.measuredBox.x)&&!K(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();let i=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=F()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a&&this.instance){let c=n(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:c,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;let i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Ti(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||Ne(this.latestValues)||l)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){let a=this.measurePageBox(),c=this.removeElementScroll(a);return i&&(c=this.removeTransform(c)),Of(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;let{visualElement:i}=this.options;if(!i)return F();let a=i.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Bf))){let{scroll:l}=this.root;l&&(ve(a.x,l.offset.x),ve(a.y,l.offset.y))}return a}removeElementScroll(i){var c;let a=F();if(be(a,i),(c=this.scroll)!=null&&c.wasRoot)return a;for(let u=0;u<this.path.length;u++){let l=this.path[u],{scroll:f,options:m}=l;l!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&be(a,i),ve(a.x,f.offset.x),ve(a.y,f.offset.y))}return a}applyTransform(i,a=!1,c){var l,f;let u=c||F();be(u,i);for(let m=0;m<this.path.length;m++){let d=this.path[m];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(ve(u.x,-d.scroll.offset.x),ve(u.y,-d.scroll.offset.y)),Ne(d.latestValues)&&Pr(u,d.latestValues,(l=d.layout)==null?void 0:l.layoutBox)}return Ne(this.latestValues)&&Pr(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var c;let a=F();be(a,i);for(let u=0;u<this.path.length;u++){let l=this.path[u];if(!Ne(l.latestValues))continue;let f;l.instance&&(In(l.latestValues)&&l.updateSnapshot(),f=F(),be(f,l.measurePageBox())),wi(a,l.latestValues,(c=l.snapshot)==null?void 0:c.layoutBox,f)}return Ne(this.latestValues)&&wi(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==U.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var d;let a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);let c=!!this.resumingFrom||this!==a;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:l,layoutId:f}=this.options;if(!this.layout||!(l||f))return;this.resolvedRelativeTargetAt=U.timestamp;let m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=F(),this.targetWithTransforms=F()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bi(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):be(this.target,this.layout.layoutBox),ui(this.target,this.targetDelta)):be(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0),dt.value&&bt.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||In(this.parent.latestValues)||li(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(i,a,c){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),jt(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),be(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var h;let i=this.getLead(),a=!!this.resumingFrom||this!==i,c=!0;if((this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===U.timestamp&&(c=!1),c)return;let{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;be(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;wa(this.layoutCorrected,this.treeScale,this.path,a),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=F());let{target:d}=i;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(hi(this.prevProjectionDelta.x,this.projectionDelta.x),hi(this.prevProjectionDelta.y,this.projectionDelta.y)),xt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Pi(this.projectionDelta.x,this.prevProjectionDelta.x)||!Pi(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d)),dt.value&&bt.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),i){let c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qe(),this.projectionDelta=qe(),this.projectionDeltaWithTransform=qe()}setAnimationOrigin(i,a=!1,c){let u=this.snapshot,l=u?u.latestValues:{},f={...this.latestValues},m=qe();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let d=F(),h=u?u.source:void 0,g=this.layout?this.layout.source:void 0,x=h!==g,v=this.getStack(),w=!v||v.members.length<=1,b=!!(x&&!w&&this.options.crossfade===!0&&!this.path.some(Lf));this.animationProgress=0;let y,T=c==null?void 0:c.interpolateProjection(i);this.mixTargetDelta=P=>{let M=P/1e3,V=T==null?void 0:T(M);V?(m.x.translate=V.x,m.x.scale=D(i.x.scale,1,M),m.x.origin=i.x.origin,m.x.originPoint=i.x.originPoint,m.y.translate=V.y,m.y.scale=D(i.y.scale,1,M),m.y.origin=i.y.origin,m.y.originPoint=i.y.originPoint):(Xa(m.x,i.x,M),Xa(m.y,i.y,M)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jt(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Rf(this.relativeTarget,this.relativeTargetOrigin,d,M),y&&Ba(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=F()),be(y,this.relativeTarget)),x&&(this.animationValues=f,Ga(f,l,this.latestValues,M,b,w)),V&&V.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=V.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var a,c,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(fe(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=A.update(()=>{vt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Te(0)),this.motionValue.jump(0,!1),this.currentAnimation=Ua(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:l=>{this.mixTargetDelta(l),i.onUpdate&&i.onUpdate(l)},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(yf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let i=this.getLead(),{targetWithTransforms:a,target:c,layout:u,latestValues:l}=i;if(!(!a||!c||!u)){if(this!==i&&this.layout&&u&&tl(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||F();let f=K(this.layout.layoutBox.x);c.x.min=i.target.x.min,c.x.max=c.x.min+f;let m=K(this.layout.layoutBox.y);c.y.min=i.target.y.min,c.y.max=c.y.min+m}be(a,c),Pr(a,l),xt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new zn),this.sharedNodes.get(i).add(a);let u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){let i=this.getStack();return i?i.lead===this:!0}getLead(){var a;let{layoutId:i}=this.options;return i?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;let{layoutId:i}=this.options;return i?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){let{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:c}={}){let u=this.getStack();u&&u.promote(this,c),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){let i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){let{visualElement:i}=this.options;if(!i)return;let a=!1,{latestValues:c}=i;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;let u={};c.z&&Ei("z",i,u,this.animationValues);for(let l=0;l<Ci.length;l++)Ei(`rotate${Ci[l]}`,i,u,this.animationValues),Ei(`skew${Ci[l]}`,i,u,this.animationValues);i.render();for(let l in u)i.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);i.scheduleRender()}applyProjectionStyles(i,a){var h,g;if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}let c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=yt(a==null?void 0:a.pointerEvents)||"",i.transform=c?c(this.latestValues,""):"none";return}let u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=yt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Ne(this.latestValues)&&(i.transform=c?c({},""):"none",this.hasProjected=!1);return}i.visibility="";let l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Fa(this.projectionDeltaWithTransform,this.treeScale,l);c&&(f=c(l,f)),i.transform=f;let{x:m,y:d}=this.projectionDelta;i.transformOrigin=`${m.origin*100}% ${d.origin*100}% 0`,u.animationValues?i.opacity=u===this?(g=(h=l.opacity)!=null?h:this.latestValues.opacity)!=null?g:1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:i.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(let x in Cr){if(l[x]===void 0)continue;let{correct:v,applyTo:w,isCSSVariable:b}=Cr[x],y=f==="none"?l[x]:v(l[x],u);if(w){let T=w.length;for(let P=0;P<T;P++)i[w[P]]=y}else b?this.options.visualElement.renderState.vars[x]=y:i[x]=y}this.options.layoutId&&(i.pointerEvents=u===this?yt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(_a),this.root.sharedNodes.clear()}}}function bf(e){e.updateLayout()}function wf(e){var r;let t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:n,measuredBox:o}=e.layout,{animationType:s}=e.options,i=t.source!==e.layout.source;if(s==="size")pe(f=>{let m=i?t.measuredBox[f]:t.layoutBox[f],d=K(m);m.min=n[f].min,m.max=m.min+d});else if(s==="x"||s==="y"){let f=s==="x"?"y":"x";Nn(i?t.measuredBox[f]:t.layoutBox[f],n[f])}else tl(s,t.layoutBox,n)&&pe(f=>{let m=i?t.measuredBox[f]:t.layoutBox[f],d=K(n[f]);m.max=m.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+d)});let a=qe();xt(a,n,t.layoutBox);let c=qe();i?xt(c,e.applyTransform(o,!0),t.measuredBox):xt(c,n,t.layoutBox);let u=!Ti(a),l=!1;if(!e.resumeFrom){let f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){let{snapshot:m,layout:d}=f;if(m&&d){let h=e.options.layoutAnchor||void 0,g=F();jt(g,t.layoutBox,m.layoutBox,h);let x=F();jt(x,n,d.layoutBox,h),Si(g,x)||(l=!0),f.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Tf(e){dt.value&&bt.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Sf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Vf(e){e.clearSnapshot()}function _a(e){e.clearMeasurements()}function Pf(e){e.isLayoutDirty=!0,e.updateLayout()}function $a(e){e.isLayoutDirty=!1}function Cf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Ef(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ya(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Af(e){e.resolveTargetDelta()}function Mf(e){e.calcProjection()}function Df(e){e.resetSkewAndRotation()}function kf(e){e.removeLeadSnapshot()}function Xa(e,t,r){e.translate=D(t.translate,0,r),e.scale=D(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function qa(e,t,r,n){e.min=D(t.min,r.min,n),e.max=D(t.max,r.max,n)}function Rf(e,t,r,n){qa(e.x,t.x,r.x,n),qa(e.y,t.y,r.y,n)}function Lf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var If={duration:.45,ease:[.4,0,.1,1]},Za=e=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ja=Za("applewebkit/")&&!Za("chrome/")?Math.round:z;function Qa(e){e.min=Ja(e.min),e.max=Ja(e.max)}function Of(e){Qa(e.x),Qa(e.y)}function tl(e,t,r){return e==="position"||e==="preserve-aspect"&&!vi(Vi(t),Vi(r),.2)}function Bf(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}var rl=Gn({attachResizeListener:(e,t)=>Ae(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0});var Wn={current:void 0},Lr=Gn({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Wn.current){let e=new rl({});e.mount(window),e.setOptions({layoutScroll:!0}),Wn.current=e}return Wn.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var nl=require("react"),Un=(0,nl.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Je=require("react");function ol(e=!0){let t=(0,Je.useContext)(Tt);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:n,register:o}=t,s=(0,Je.useId)();(0,Je.useEffect)(()=>{if(e)return o(s)},[e]);let i=(0,Je.useCallback)(()=>e&&n&&n(s),[s,n,e]);return!r&&n?[!1,i]:[!0]}var il=require("react"),Hn=(0,il.createContext)({strict:!1});var sl={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"]},al=!1;function Ff(){if(al)return;let e={};for(let t in sl)e[t]={isEnabled:r=>sl[t].some(n=>!!r[n])};Tr(e),al=!0}function Kn(){return Ff(),oi()}function ll(e){let t=Kn();for(let r in e)t[r]={...t[r],...e[r]};Tr(t)}var Nf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Ir(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Nf.has(e)}var cl=e=>!Ir(e);function jf(e){typeof e=="function"&&(cl=t=>t.startsWith("on")?!Ir(t):e(t))}try{jf(require("@emotion/is-prop-valid").default)}catch(e){}function ul(e,t,r){let n={};for(let o in e)o==="values"&&typeof e.values=="object"||I(e[o])||(cl(o)||r===!0&&Ir(o)||!t&&!Ir(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}var qn=require("react/jsx-runtime");var Ut=require("react");var fl=require("react"),Qe=(0,fl.createContext)({});var _n=require("react");function ml(e,t){if(Ze(e)){let{initial:r,animate:n}=e;return{initial:r===!1||Ee(r)?r:void 0,animate:Ee(n)?n:void 0}}return e.inherit!==!1?t:{}}function pl(e){let{initial:t,animate:r}=ml(e,(0,_n.useContext)(Qe));return(0,_n.useMemo)(()=>({initial:t,animate:r}),[dl(t),dl(r)])}function dl(e){return Array.isArray(e)?e.join(" "):e}var Wt=require("react");var hl=require("react");var zt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ai(e,t,r){for(let n in t)!I(t[n])&&!Er(n,r)&&(e[n]=t[n])}function zf({transformTemplate:e},t){return(0,hl.useMemo)(()=>{let r=zt();return pt(r,t,e),Object.assign({},r.vars,r.style)},[t])}function Gf(e,t){let r=e.style||{},n={};return Ai(n,r,e),Object.assign(n,zf(e,t)),n}function gl(e,t){let r={},n=Gf(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}var xl=require("react");var $n=()=>({...zt(),attrs:{}});function yl(e,t,r,n){let o=(0,xl.useMemo)(()=>{let s=$n();return Mr(s,t,Dr(n),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let s={};Ai(s,e.style,e),o.style={...s,...o.style}}return o}var vl=["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 Gt(e){return typeof e!="string"||e.includes("-")?!1:!!(vl.indexOf(e)>-1||/[A-Z]/u.test(e))}function bl(e,t,r,{latestValues:n},o,s=!1,i){let c=((i!=null?i:Gt(e))?yl:gl)(t,n,o,e),u=ul(t,typeof e=="string",s),l=e!==Wt.Fragment?{...u,...c,ref:r}:{},{children:f}=t,m=(0,Wt.useMemo)(()=>I(f)?f.get():f,[f]);return(0,Wt.createElement)(e,{...l,children:m})}var Mi=require("react");function Wf({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,o){return{latestValues:Uf(r,n,o,e),renderState:t()}}function Uf(e,t,r,n){let o={},s=n(e,{});for(let m in s)o[m]=yt(s[m]);let{initial:i,animate:a}=e,c=Ze(e),u=vr(e);t&&u&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let l=r?r.initial===!1:!1;l=l||i===!1;let f=l?a:i;if(f&&typeof f!="boolean"&&!Fe(f)){let m=Array.isArray(f)?f:[f];for(let d=0;d<m.length;d++){let h=ct(e,m[d]);if(h){let{transitionEnd:g,transition:x,...v}=h;for(let w in v){let b=v[w];if(Array.isArray(b)){let y=l?b.length-1:0;b=b[y]}b!==null&&(o[w]=b)}for(let w in g)o[w]=g[w]}}}return o}var Yn=e=>(t,r)=>{let n=(0,Mi.useContext)(Qe),o=(0,Mi.useContext)(Tt),s=()=>Wf(e,t,n,o);return r?s():Zi(s)};var wl=Yn({scrapeMotionValuesFromProps:ht,createRenderState:zt});var Tl=Yn({scrapeMotionValuesFromProps:kr,createRenderState:$n});var Sl=Symbol.for("motionComponentSymbol");var wt=require("react");function Vl(e,t,r){let n=(0,wt.useRef)(r);(0,wt.useInsertionEffect)(()=>{n.current=r});let o=(0,wt.useRef)(null);return(0,wt.useCallback)(s=>{var a;s&&((a=e.onMount)==null||a.call(e,s)),t&&(s?t.mount(s):t.unmount());let i=n.current;if(typeof i=="function")if(s){let c=i(s);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s)},[t])}var se=require("react");var Pl=require("react"),Xn=(0,Pl.createContext)({});function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Cl(e,t,r,n,o,s){var b,y;let{visualElement:i}=(0,se.useContext)(Qe),a=(0,se.useContext)(Hn),c=(0,se.useContext)(Tt),u=(0,se.useContext)(Un),l=u.reducedMotion,f=u.skipAnimations,m=(0,se.useRef)(null),d=(0,se.useRef)(!1);n=n||a.renderer,!m.current&&n&&(m.current=n(e,{visualState:t,parent:i,props:r,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:f,isSVG:s}),d.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let h=m.current,g=(0,se.useContext)(Xn);h&&!h.projection&&o&&(h.type==="html"||h.type==="svg")&&Hf(m.current,r,o,g);let x=(0,se.useRef)(!1);(0,se.useInsertionEffect)(()=>{h&&x.current&&h.update(r,c)});let v=r[dr],w=(0,se.useRef)(!!v&&typeof window!="undefined"&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,v))&&((y=window.MotionHasOptimisedAnimation)==null?void 0:y.call(window,v)));return Qi(()=>{d.current=!0,h&&(x.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),w.current&&h.animationState&&h.animationState.animateChanges())}),(0,se.useEffect)(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,v)}),w.current=!1),h.enteringChildren=void 0)}),h}function Hf(e,t,r,n){let{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:l,layoutCrossfade:f}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:El(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&et(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:l})}function El(e){if(e)return e.options.allowProjection!==!1?e.projection:El(e.parent)}function Zn(e,{forwardMotionProps:t=!1,type:r}={},n,o){var u,l;n&&ll(n);let s=r?r==="svg":Gt(e),i=s?Tl:wl;function a(f,m){let d,h={...(0,Ut.useContext)(Un),...f,layoutId:Kf(f)},{isStatic:g}=h,x=pl(f),v=i(f,g);if(!g&&typeof window!="undefined"){_f(h,n);let w=$f(h);d=w.MeasureLayout,x.visualElement=Cl(e,v,h,o,w.ProjectionNode,s)}return(0,qn.jsxs)(Qe.Provider,{value:x,children:[d&&x.visualElement?(0,qn.jsx)(d,{visualElement:x.visualElement,...h}):null,bl(e,f,Vl(v,x.visualElement,m),v,g,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${(l=(u=e.displayName)!=null?u:e.name)!=null?l:""})`}`;let c=(0,Ut.forwardRef)(a);return c[Sl]=e,c}function Kf({layoutId:e}){let t=(0,Ut.useContext)(Wr).id;return t&&e!==void 0?t+"-"+e:e}function _f(e,t){let r=(0,Ut.useContext)(Hn).strict}function $f(e){let t=Kn(),{drag:r,layout:n}=t;if(!r&&!n)return{};let o={...r,...n};return{MeasureLayout:r!=null&&r.isEnabled(e)||n!=null&&n.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function Al(e,t){if(typeof Proxy=="undefined")return Zn;let r=new Map,n=(s,i)=>Zn(s,i,e,t),o=(s,i)=>n(s,i);return new Proxy(o,{get:(s,i)=>i==="create"?n:(r.has(i)||r.set(i,Zn(i,void 0,e,t)),r.get(i))})}var Ml=require("react");var Dl=(e,t)=>{var n;return((n=t.isSVG)!=null?n:Gt(e))?new Rr(t):new Ar(t,{allowProjection:e!==Ml.Fragment})};var Jn=class extends q{constructor(t){super(t),t.animationState||(t.animationState=pi(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();Fe(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}};var Yf=0,Qn=class extends q{constructor(){super(...arguments),this.id=Yf++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&n===!1){if(this.isExitComplete){let{initial:i,custom:a}=this.node.getProps();if(typeof i=="string"||typeof i=="object"&&i!==null&&!Array.isArray(i)){let c=de(this.node,i,a);if(c){let{transition:u,transitionEnd:l,...f}=c;for(let m in f)(s=this.node.getValue(m))==null||s.jump(f[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let o=this.node.animationState.setActive("exit",!t);r&&!t&&o.then(()=>{this.isExitComplete=!0,r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var kl={animation:{Feature:Jn},exit:{Feature:Qn}};function je(e){return{point:{x:e.pageX,y:e.pageY}}}var Rl=e=>t=>mt(t)&&e(t,je(t));function tt(e,t,r,n){return Ae(e,t,Rl(r),n)}var eo=({current:e})=>e?e.ownerDocument.defaultView:null;var Ll=(e,t)=>Math.abs(e-t);function Il(e,t){let r=Ll(e.x,t.x),n=Ll(e.y,t.y);return Math.sqrt(r**2+n**2)}var Ol=new Set(["auto","scroll"]),Ht=class{constructor(t,r,{transformPagePoint:n,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=to(this.lastRawMoveEventInfo,this.transformPagePoint));let h=Di(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=Il(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;let{point:v}=h,{timestamp:w}=U;this.history.push({...v,timestamp:w});let{onStart:b,onMove:y}=this.handlers;g||(b&&b(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,h)},this.handlePointerMove=(h,g)=>{this.lastMoveEvent=h,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=to(g,this.transformPagePoint),A.update(this.updatePoint,!0)},this.handlePointerUp=(h,g)=>{this.end();let{onEnd:x,onSessionEnd:v,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let b=Di(h.type==="pointercancel"?this.lastMoveEventInfo:to(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(h,b),v&&v(h,b)},!mt(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=i,this.contextWindow=o||window;let c=je(t),u=to(c,this.transformPagePoint),{point:l}=u,{timestamp:f}=U;this.history=[{...l,timestamp:f}];let{onSessionStart:m}=r;m&&m(t,Di(u,this.history));let d={passive:!0,capture:!0};this.removeListeners=we(tt(this.contextWindow,"pointermove",this.handlePointerMove,d),tt(this.contextWindow,"pointerup",this.handlePointerUp,d),tt(this.contextWindow,"pointercancel",this.handlePointerUp,d)),a&&this.startScrollTracking(a)}startScrollTracking(t){let r=t.parentElement;for(;r;){let n=getComputedStyle(r);(Ol.has(n.overflowX)||Ol.has(n.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){let r=this.scrollPositions.get(t);if(!r)return;let n=t===window,o=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-r.x,y:o.y-r.y};s.x===0&&s.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),A.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),fe(this.updatePoint)}};function to(e,t){return t?{point:t(e.point)}:e}function Bl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Di({point:e},t){return{point:e,delta:Bl(e,Fl(t)),offset:Bl(e,Xf(t)),velocity:qf(t,.1)}}function Xf(e){return e[0]}function Fl(e){return e[e.length-1]}function qf(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,o=Fl(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>H(t)));)r--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&o.timestamp-n.timestamp>H(t)*2&&(n=e[1]);let s=Q(o.timestamp-n.timestamp);if(s===0)return{x:0,y:0};let i={x:(o.x-n.x)/s,y:(o.y-n.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Wl(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?D(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?D(r,e,n.max):Math.min(e,r)),e}function Nl(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function Ul(e,{top:t,left:r,bottom:n,right:o}){return{x:Nl(e.x,r,o),y:Nl(e.y,t,n)}}function jl(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function Hl(e,t){return{x:jl(e.x,t.x),y:jl(e.y,t.y)}}function Kl(e,t){let r=.5,n=K(e),o=K(t);return o>n?r=Se(t.min,t.max-n,e.min):n>o&&(r=Se(e.min,e.max-o,t.min)),Y(0,1,r)}function _l(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var ro=.35;function $l(e=ro){return e===!1?e=0:e===!0&&(e=ro),{x:zl(e,"left","right"),y:zl(e,"top","bottom")}}function zl(e,t,r){return{min:Gl(e,t),max:Gl(e,r)}}function Gl(e,t){return typeof e=="number"?e:e[t]||0}var Zf=new WeakMap,oo=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=F(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){let{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;let s=f=>{r&&this.snapToCursor(je(f).point),this.stopAnimation()},i=(f,m)=>{let{drag:d,dragPropagation:h,onDragStart:g}=this.getProps();if(d&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Xo(d),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pe(v=>{let w=this.getAxisMotionValue(v).get()||0;if(ne.test(w)){let{projection:b}=this.visualElement;if(b&&b.layout){let y=b.layout.layoutBox[v];y&&(w=K(y)*(parseFloat(w)/100))}}this.originPoint[v]=w}),g&&A.update(()=>g(f,m),!1,!0),Rt(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;let{dragPropagation:d,dragDirectionLock:h,onDirectionLock:g,onDrag:x}=this.getProps();if(!d&&!this.openDragLock)return;let{offset:v}=m;if(h&&this.currentDirection===null){this.currentDirection=Qf(v),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,v),this.updateAxis("y",m.point,v),this.visualElement.render(),x&&A.update(()=>x(f,m),!1,!0)},c=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m,this.stop(f,m),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{let{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Ht(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:eo(this.visualElement),element:this.visualElement.current})}stop(t,r){let n=t||this.latestPointerEvent,o=r||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!n)return;let{velocity:i}=o;this.startAnimation(i);let{onDragEnd:a}=this.getProps();a&&A.postRender(()=>a(n,o))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,r,n){let{drag:o}=this.getProps();if(!n||!no(t,o,this.currentDirection))return;let s=this.getAxisMotionValue(t),i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=Wl(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;let{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&et(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=Ul(n.layoutBox,t):this.constraints=!1,this.elastic=$l(r),o!==this.constraints&&!et(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&pe(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=_l(n.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!et(t))return!1;let n=t.current;ue(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());let s=fi(n,o.root,this.visualElement.getTransformPagePoint()),i=Hl(o.layout.layoutBox,s);if(r){let a=r(ii(i));this.hasMutatedConstraints=!!a,a&&(i=Sr(a))}return i}startAnimation(t){let{drag:r,dragMomentum:n,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=pe(l=>{if(!no(l,r,this.currentDirection))return;let f=c&&c[l]||{};(i===!0||i===l)&&(f={min:0,max:0});let m=o?200:1e6,d=o?40:1e7,h={type:"inertia",velocity:n?t[l]:0,bounceStiffness:m,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(l,h)});return Promise.all(u).then(a)}startAxisValueAnimation(t,r){let n=this.getAxisMotionValue(t);return Rt(this.visualElement,t),n.start(lt(t,n,0,r,this.visualElement,!1))}stopAnimation(){pe(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var s;let r=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps()[r];return o||this.visualElement.getValue(t,(s=this.visualElement.latestValues[t])!=null?s:0)}snapToCursor(t){pe(r=>{let{drag:n}=this.getProps();if(!no(r,n,this.currentDirection))return;let{projection:o}=this.visualElement,s=this.getAxisMotionValue(r);if(o&&o.layout){let{min:i,max:a}=o.layout.layoutBox[r],c=s.get()||0;s.set(t[r]-D(i,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!et(r)||!n||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};pe(i=>{let a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){let c=a.get();o[i]=Kl({min:c,max:c},this.constraints[i])}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),pe(i=>{if(!no(i,t,null))return;let a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(D(c,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Zf.set(this.visualElement,this);let t=this.visualElement.current,r=tt(t,"pointerdown",u=>{let{drag:l,dragListener:f=!0}=this.getProps(),m=u.target,d=m!==t&&Qo(m);l&&f&&!d&&this.start(u)}),n,o=()=>{let{dragConstraints:u}=this.getProps();et(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),n||(n=Jf(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,i=s.addEventListener("measure",o);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),A.read(o);let a=Ae(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(pe(f=>{let m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=u[f].translate,m.set(m.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),r(),i(),c&&c(),n&&n()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=ro,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}};function Yl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Jf(e,t,r){let n=Dn(e,Yl(r)),o=Dn(t,Yl(r));return()=>{n(),o()}}function no(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Qf(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var io=class extends q{constructor(t){super(t),this.removeGroupControls=z,this.removeListeners=z,this.controls=new oo(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||z}update(){let{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};var ki=e=>(t,r)=>{e&&A.update(()=>e(t,r),!1,!0)},so=class extends q{constructor(){super(...arguments),this.removePointerDownListener=z}onPointerDown(t){this.session=new Ht(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eo(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:o}=this.node.getProps();return{onSessionStart:ki(t),onStart:ki(r),onMove:ki(n),onEnd:(s,i)=>{delete this.session,o&&A.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=tt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var Xl=require("react/jsx-runtime");var Or=require("react");var Ri=!1,Li=class extends Or.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:o}=this.props,{projection:s}=t;s&&(r.group&&r.group.add(s),n&&n.register&&o&&n.register(s),Ri&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),vt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:n,drag:o,isPresent:s}=this.props,{projection:i}=n;return i&&(i.isPresent=s,t.layoutDependency!==r&&i.setOptions({...i.options,layoutDependency:r}),Ri=!0,o||t.layoutDependency!==r||r===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||A.postRender(()=>{let a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:t,layoutAnchor:r}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=r,n.root.didUpdate(),ft.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:o}=t;Ri=!0,o&&(o.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(o),n&&n.deregister&&n.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function ao(e){let[t,r]=ol(),n=(0,Or.useContext)(Wr);return(0,Xl.jsx)(Li,{...e,layoutGroup:n,switchLayoutGroup:(0,Or.useContext)(Xn),isPresent:t,safeToRemove:r})}var ql={pan:{Feature:so},drag:{Feature:io,ProjectionNode:Lr,MeasureLayout:ao}};function Zl(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");let o="onHover"+r,s=n[o];s&&A.postRender(()=>s(t,je(t)))}var lo=class extends q{mount(){let{current:t}=this.node;t&&(this.unmount=qo(t,(r,n)=>(Zl(this.node,n,"Start"),o=>Zl(this.node,o,"End"))))}unmount(){}};var co=class extends q{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(r){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=we(Ae(this.node.current,"focus",()=>this.onFocus()),Ae(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Jl(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");let o="onTap"+(r==="End"?"":r),s=n[o];s&&A.postRender(()=>s(t,je(t)))}var uo=class extends q{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:r,propagate:n}=this.node.props;this.unmount=ti(t,(o,s)=>(Jl(this.node,s,"Start"),(i,{success:a})=>Jl(this.node,i,a?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}};var Oi=new WeakMap,Ii=new WeakMap,em=e=>{let t=Oi.get(e.target);t&&t(e)},tm=e=>{e.forEach(em)};function rm({root:e,...t}){let r=e||document;Ii.has(r)||Ii.set(r,{});let n=Ii.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(tm,{root:e,...t})),n[o]}function Ql(e,t,r){let n=rm(t);return Oi.set(e,r),n.observe(e),()=>{Oi.delete(e),n.unobserve(e)}}var nm={some:0,all:1},fo=class extends q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);let{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:o="some",once:s}=t,i={root:r?r.current:void 0,rootMargin:n,threshold:typeof o=="number"?o:nm[o]},a=u=>{let{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);let{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),d=l?f:m;d&&d(u)};this.stopObserver=Ql(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver=="undefined")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(om(t,r))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}};function om({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var ec={inView:{Feature:fo},tap:{Feature:uo},focus:{Feature:co},hover:{Feature:lo}};var tc={layout:{ProjectionNode:Lr,MeasureLayout:ao}};var rc={...kl,...ec,...ql,...tc};var Bi=Al(rc,Dl);var Fi=Bi;var p=require("react"),Ui=require("react-dom"),zi=new Set,Gi={open:!1,status:null,busy:!1,ballPos:null,guideVisible:!1,guideDismissed:!1};function N(e){Gi=Object.assign({},Gi,e),zi.forEach(function(t){t()})}function sm(e){return zi.add(e),function(){zi.delete(e)}}function am(){return Gi}function Hi(){return p.useSyncExternalStore(sm,am)}var nc="dshcs-setup-error-banner";function lm(e){try{if(typeof document=="undefined"||document.getElementById(nc)!=null)return;var t=document.createElement("div");t.id=nc,t.setAttribute("role","alert"),t.style.cssText="position:fixed;top:0;left:0;right:0;z-index:2147483999;display:flex;align-items:flex-start;gap:10px;padding:10px 14px;font:13px/1.5 system-ui,sans-serif;color:#7d1a1a;background:#fff1f0;border-bottom:1px solid #f0c4c2;box-shadow:0 4px 16px rgba(0,0,0,.12)";var r=document.createElement("div");r.style.cssText="flex:1;min-width:0",r.innerHTML='<strong>Code Server \u73AF\u5883\u5B89\u88C5\u5931\u8D25</strong><br><span style="color:#8a3c3c">'+oc(e.error!=null?e.error:"\u5B89\u88C5\u811A\u672C\u9519\u8BEF")+"</span>"+(e.at!=null?'<br><span style="color:#b07a7a;font-size:11px">'+oc(e.at)+"</span>":"")+'<br><span style="color:#6a6a6a">\u53EF\u5728\u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server \u2192 \u73AF\u5883\u68C0\u6D4B/\u5B89\u88C5\u73AF\u5883 \u91CD\u8BD5\u3002</span>';var n=document.createElement("button");n.type="button",n.style.cssText="flex:none;font:inherit;cursor:pointer;border:1px solid #d9b0ae;background:#fff;border-radius:6px;padding:4px 10px;color:#7d1a1a",n.textContent="\u91CD\u65B0\u5B89\u88C5",n.onclick=function(){n.disabled=!0,n.textContent="\u5B89\u88C5\u4E2D\u2026",te("/code-server/setup",{}).then(function(i){i!=null&&i.ok===!0?(n.textContent="\u5DF2\u5728\u540E\u53F0\u5B89\u88C5\u2026",setTimeout(function(){te("/code-server/status").then(function(a){a!=null&&a.setup!=null&&a.setup.running!==!0&&a.setup.ok===!0?t.remove():(n.disabled=!1,n.textContent="\u91CD\u65B0\u5B89\u88C5")})},4e3)):(n.disabled=!1,n.textContent="\u91CD\u65B0\u5B89\u88C5")}).catch(function(){n.disabled=!1,n.textContent="\u91CD\u65B0\u5B89\u88C5"});var s=function(){te("/code-server/status").then(function(i){if(!(i==null||i.setup==null)){if(i.setup.running===!0){setTimeout(s,2e3);return}i.setup.ok===!0?(t.remove(),N({status:i})):(n.disabled=!1,n.textContent="\u91CD\u65B0\u5B89\u88C5")}})};setTimeout(s,3e3)};var o=document.createElement("button");o.type="button",o.setAttribute("aria-label","\u5173\u95ED"),o.style.cssText="flex:none;font:inherit;cursor:pointer;border:none;background:none;color:#8a3c3c;font-size:16px;line-height:1;padding:2px 6px",o.textContent="\xD7",o.onclick=function(){t.remove()},t.appendChild(r),t.appendChild(n),t.appendChild(o),document.body.appendChild(t)}catch(s){console.error("[code-server] banner failed:",s!=null&&s.message!=null?s.message:String(s))}}function oc(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}async function te(e,t){var r={method:t===void 0?"GET":"POST",headers:{}};t!==void 0&&(r.headers["content-type"]="application/json",r.body=JSON.stringify(t));var n=await fetch(e,r),o=await n.text(),s=null;try{s=o===""?null:JSON.parse(o)}catch(i){s=null}return n.ok?s!==null?s:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+n.status+(s!==null&&s.error!==void 0?": "+s.error:"")}}function ac(e,t){try{var r=e(function(f){return f}),n=t===null?null:typeof t=="function"?t(function(f){return f}):null,o=r!=null?r.current:void 0;if(o!==void 0&&r!=null&&r.byId!=null){var s=r.byId[o];if(s!=null&&typeof s.cwd=="string"&&s.cwd!=="")return s.cwd}var i=n!=null&&Array.isArray(n.items)?n.items:[];if(o!==void 0)for(var a=0;a<i.length;a++){var c=i[a];if(c.sessionIds!=null&&c.sessionIds.indexOf(o)!==-1&&typeof c.path=="string"&&c.path!=="")return c.path}var u=n!=null?n.recentWorkspaceId:void 0;if(u!==void 0){for(var l=0;l<i.length;l++)if(i[l].workspaceId===u&&typeof i[l].path=="string"&&i[l].path!=="")return i[l].path}if(i.length>0&&typeof i[0].path=="string"&&i[0].path!=="")return i[0].path}catch(f){}}function cm(e,t){if(e==null||typeof e.url!="string"||e.url==="")return null;var r=typeof t=="string"&&t!==""?t:e!=null&&e.cwd!=null?e.cwd:null;if(r==null||r==="")return e.url;var n=r.replace(/\\/g,"/"),o=n;return(/^[A-Za-z]:\//.test(n)||n.charCodeAt(0)!==47)&&(o="/"+n),e.url+"?folder="+encodeURIComponent(o)}var um=["nw","n","ne","w","e","sw","s","se"],ee=12,fm=720,mm=520,lc=360,cc=260,ic=24;function Wi(e){if(e===!1)return 0;try{if(typeof document=="undefined")return 0;var t=document.querySelectorAll("[data-composer-seat]");if(t===null||t.length===0)return 0;for(var r=Number.POSITIVE_INFINITY,n=0,o=0;o<t.length;o++){var s=t[o].getBoundingClientRect();s===null||s.width<=0||(s.top<r&&(r=s.top),s.bottom>n&&(n=s.bottom))}if(!isFinite(r)||n<=0)return 0;var i=window.innerHeight;return i-n>24?0:Math.min(Math.max(1,i-r+8),420)}catch(a){return 0}}function Me(){return{width:Math.max(1,window.innerWidth),height:Math.max(1,window.innerHeight)}}function xo(e,t){return{width:Math.max(1,e.width-ee*2),height:Math.max(1,e.height-ee*2-t)}}function rt(e,t,r){return Math.min(r,Math.max(t,e))}function Kt(e,t,r){let n=xo(t,r),o=rt(e.width,Math.min(lc,n.width),n.width),s=rt(e.height,Math.min(cc,n.height),n.height);return{x:rt(e.x,ee,Math.max(ee,t.width-ee-o)),y:rt(e.y,ee,Math.max(ee,t.height-ee-r-s)),width:o,height:s}}function dm(e,t,r){let n=xo(t,r),o=Math.min(fm,n.width),s=Math.min(mm,n.height),i=pm(),a=i>0?i-8:t.height-ee-r;return Kt({x:t.width-ee-o-e*ic,y:Math.max(ee,a-s-e*ic),width:o,height:s},t,r)}function pm(){try{if(typeof document=="undefined")return-1;var e=document.querySelectorAll("[data-composer-seat]");if(e===null||e.length===0)return-1;for(var t=Number.POSITIVE_INFINITY,r=0;r<e.length;r++){var n=e[r].getBoundingClientRect();n!==null&&n.width>0&&n.top<t&&(t=n.top)}return isFinite(t)?t:-1}catch(o){return-1}}function hm(e,t,r,n,o){return Kt({...e,x:e.x+t,y:e.y+r},n,o)}function gm(e,t,r,n,o,s){let i=Kt(e,o,s),a=xo(o,s),c=Math.min(lc,a.width),u=Math.min(cc,a.height),l=o.height-ee-s,f=i.x,m=i.x+i.width,d=i.y,h=i.y+i.height;return t.includes("w")&&(f=rt(i.x+r,ee,m-c)),t.includes("e")&&(m=rt(m+r,f+c,o.width-ee)),t.includes("n")&&(d=rt(i.y+n,ee,h-u)),t.includes("s")&&(h=rt(h+n,d+u,l)),{x:f,y:d,width:m-f,height:h-d}}function mo(e,t){let r=xo(e,t);return{x:ee,y:ee,width:r.width,height:r.height}}var xm='.dshcs-root{position:fixed;inset:0;z-index:2147483000;pointer-events:none}.dshcs-win{--dshcs-accent:#5b6cff;pointer-events:auto;position:fixed;isolation:isolate;z-index:2147483000;display:flex;flex-direction:column;min-width:1px;min-height:1px;overflow:hidden;color:var(--dsw-alias-label-primary,#172033);background:var(--dsw-alias-bg-base,#fff);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;box-shadow:0 1px 2px rgba(13,22,38,.08),0 18px 48px rgba(13,22,38,.2),0 0 0 1px rgba(255,255,255,.4) inset;transition:border-color .16s ease,box-shadow .16s ease}.dshcs-win:hover{border-color:color-mix(in srgb,var(--dshcs-accent) 28%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 2px 5px rgba(13,22,38,.1),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-win[data-interaction]{transition:none;user-select:none}.dshcs-win[data-interaction]::after{content:"";position:absolute;inset:0;z-index:18;background:transparent}.dshcs-win-max{border-radius:14px;z-index:2147483001;box-shadow:0 1px 2px rgba(13,22,38,.06),0 8px 24px rgba(13,22,38,.12)}.dshcs-win-max:hover{box-shadow:0 1px 2px rgba(13,22,38,.06),0 10px 28px rgba(13,22,38,.14)}.dshcs-win-snap{border-color:color-mix(in srgb,var(--dshcs-accent) 70%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 26%,transparent),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-snapghost{position:fixed;left:0;top:0;z-index:2147483000;pointer-events:none;display:grid;place-items:center;border:1.5px solid color-mix(in srgb,var(--dshcs-accent,#5b6cff) 85%,transparent);background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 11%,transparent);border-radius:12px;box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent,#5b6cff) 20%,transparent),0 10px 34px rgba(13,22,38,.14)}.dshcs-snapghint{position:absolute;top:12px;left:50%;transform:translateX(-50%);padding:5px 14px;border-radius:999px;background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 92%,#172033);color:#fff;font-size:12px;font-weight:650;letter-spacing:.02em;white-space:nowrap;box-shadow:0 6px 18px rgba(13,22,38,.3)}.dshcs-drag{position:absolute;top:0;left:0;right:0;height:14px;z-index:26;cursor:grab;touch-action:none;user-select:none}.dshcs-win[data-interaction=move] .dshcs-drag{cursor:grabbing}.dshcs-win-max .dshcs-drag{cursor:default}.dshcs-drag:hover{background:color-mix(in srgb,var(--dsw-alias-label-primary,#172033) 5%,transparent)}.dshcs-artbtn{appearance:none;display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:6px;color:var(--dsw-alias-label-secondary,#566174);background:color-mix(in srgb,var(--dsw-alias-bg-base,#fff) 60%,transparent);cursor:pointer;transition:color .12s ease,background .12s ease,border-color .12s ease;vertical-align:middle}.dshcs-artbtn:hover{color:var(--dsw-alias-label-primary,#172033);border-color:color-mix(in srgb,var(--dshcs-accent) 40%,var(--dsw-alias-border-l2,#dfe3eb));background:color-mix(in srgb,var(--dshcs-accent) 8%,transparent)}.dshcs-artbtn:active{transform:scale(.94)}.dshcs-artbtn:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent) 65%,transparent);outline-offset:1px}.dshcs-artifacts{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:6px 8px;margin-top:16px;font-size:13px;line-height:22px;position:relative}.dshcs-artlabel{color:var(--dsw-alias-label-tertiary,#7d8798);grid-area:1/1}.dshcs-artrow{flex-wrap:nowrap;grid-area:1/2;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.dshcs-artitem{display:inline-flex;align-items:center;gap:4px;flex:none;min-width:0}.dshcs-artfile{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-interactive-bg-hover);max-width:320px;color:var(--dsw-alias-label-secondary,#566174);font:inherit;cursor:pointer;border:none;border-radius:6px;margin:0;padding:0 8px;overflow:hidden}.dshcs-artfile:hover{color:var(--dsw-alias-label-primary,#172033);text-decoration:underline}.dshcs-artfile:focus-visible{box-shadow:inset 0 0 0 2px var(--dsw-alias-border-l3);outline:none}.dshcs-artmore{white-space:nowrap;color:var(--dsw-alias-label-tertiary,#7d8798);flex:none}.dshcs-body{position:relative;display:flex;flex:1;min-width:0;min-height:0;flex-direction:column;background:var(--dsw-alias-bg-base,#fff)}.dshcs-body[hidden]{display:none}.dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-win-hidden{pointer-events:none!important}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-resize{position:absolute;z-index:24;display:block;touch-action:none}.dshcs-resize-n,.dshcs-resize-s{left:16px;right:16px;height:10px;cursor:ns-resize}.dshcs-resize-n{top:0}.dshcs-resize-s{bottom:0}.dshcs-resize-w,.dshcs-resize-e{top:16px;bottom:16px;width:10px;cursor:ew-resize}.dshcs-resize-w{left:0}.dshcs-resize-e{right:0}.dshcs-resize-nw,.dshcs-resize-ne,.dshcs-resize-sw,.dshcs-resize-se{width:18px;height:18px}.dshcs-resize-nw{left:0;top:0;cursor:nwse-resize}.dshcs-resize-ne{right:0;top:0;cursor:nesw-resize}.dshcs-resize-sw{left:0;bottom:0;cursor:nesw-resize}.dshcs-resize-se{right:0;bottom:0;cursor:nwse-resize}.dshcs-resize-se::after{content:"";position:absolute;right:4px;bottom:4px;width:7px;height:7px;border-right:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-bottom:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-radius:0 0 2px}.dshcs-ball{position:fixed;width:38px;height:38px;padding:0;border:1px solid color-mix(in srgb,var(--dsw-alias-border-l2,#dfe3eb) 80%,transparent);border-radius:50%;display:grid;place-items:center;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;z-index:2147483002;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2,#f2f4f8) 88%,transparent);backdrop-filter:blur(8px) saturate(1.2);box-shadow:0 8px 20px rgba(13,22,38,.18),0 1px 2px rgba(13,22,38,.1);transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}.dshcs-ball img,.dshcs-ball svg{-webkit-user-drag:none;user-drag:none}.dshcs-ball[data-dragging]{cursor:grabbing;transform:scale(1.06);box-shadow:0 14px 28px rgba(13,22,38,.28),0 2px 6px rgba(13,22,38,.16)}.dshcs-ball:hover{transform:scale(1.06);box-shadow:0 10px 24px rgba(13,22,38,.22),0 1px 2px rgba(13,22,38,.1)}.dshcs-ball:active{transform:scale(.94)}.dshcs-ball:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent) 65%,transparent);outline-offset:2px}.dshcs-ball-open{background:color-mix(in srgb,var(--dshcs-accent) 14%,var(--dsw-alias-bg-layer-2,#f2f4f8));border-color:color-mix(in srgb,var(--dshcs-accent) 55%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 22%,transparent),0 0 20px color-mix(in srgb,var(--dshcs-accent) 38%,transparent),0 8px 20px rgba(13,22,38,.16);transform:scale(1.08)}.dshcs-ball-dot{position:absolute;top:-2px;right:-2px;width:9px;height:9px;border-radius:50%;background:#20a66a;border:2px solid var(--dsw-alias-bg-base,#fff)}.dshcs-ball-dot[data-status=starting]{background:#d78b25}.dshcs-ball-dot[data-status=error]{background:#f85149}.dshcs-ball-dot[data-status=idle]{background:#7d8798}.dshcs-ball-dot[data-status=running]::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid currentColor;opacity:.3;animation:dshcs-pulse 2s ease-out infinite}@keyframes dshcs-pulse{0%{transform:scale(.7);opacity:.35}70%,100%{transform:scale(1.65);opacity:0}}',sc="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(sc)+"]")===null&&(po=document.createElement("style"),po.setAttribute("data-dshcs",sc),po.textContent=xm,document.head.appendChild(po));var po;function ym(e){var[t,r]=p.useState(!1),n=p.useRef(e.url);return p.useEffect(function(){n.current!==e.url&&(n.current=e.url,r(!1))},[e.url]),e.url!=null&&t!==!0?p.createElement("img",{src:e.url,key:"img-"+e.url,alt:"","aria-hidden":!0,draggable:!1,onError:function(){r(!0)},style:{width:20,height:20,display:"block",objectFit:"contain",borderRadius:3,WebkitUserDrag:"none",userSelect:"none"}}):p.createElement("svg",{viewBox:"0 0 18 18","aria-hidden":!0,style:{width:17,height:17}},p.createElement("rect",{x:"3",y:"3",width:"12",height:"12",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:1.4}),p.createElement("path",{d:"M3 7h12M7 3v12",fill:"none",stroke:"currentColor",strokeWidth:1.4}))}var ze=38,De=8,uc="dshcs-ball-pos";function ho(e){var t=Math.max(De,window.innerWidth-De-ze),r=Math.max(De,window.innerHeight-De-ze);return{x:Math.min(t,Math.max(De,e.x)),y:Math.min(r,Math.max(De,e.y))}}function vm(){try{var e=window.localStorage.getItem(uc);if(e==null)return null;var t=JSON.parse(e);if(t!=null&&typeof t.x=="number"&&typeof t.y=="number"&&isFinite(t.x)&&isFinite(t.y))return ho(t)}catch(r){}return null}function bm(e){try{window.localStorage.setItem(uc,JSON.stringify(e))}catch(t){}}function wm(e){var t=Hi(),r=t.status,n=r!=null?r.env:null,o=r!=null&&r.running===!0,s=o?"running":r!=null&&r.status==="starting"?"starting":r!=null&&r.status==="error"?"error":"idle",i=Wi(r!=null?r.reserveComposer:!0),a=t.open===!0,c="/code-server/icon.svg",[u,l]=p.useState(vm),[f,m]=p.useState(!1),d=p.useRef(null),h=p.useRef(!1);if(p.useEffect(function(){var y=function(){l(function(T){return T==null?T:ho(T)})};return window.addEventListener("resize",y),function(){window.removeEventListener("resize",y)}},[]),p.useEffect(function(){var y=u!=null?u:(function(){var T=Wi(r!=null?r.reserveComposer:!0);return{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(T>0?T+10:18)}})();N({ballPos:ho(y)})},[u,r]),n!=null&&n.ok!==!0)return null;var g=function(y){if(y.button===0){var T=y.currentTarget,P=T.getBoundingClientRect();d.current={pointerId:y.pointerId,dx:y.clientX-P.left,dy:y.clientY-P.top,moved:!1},h.current=!1,m(!0);try{T.setPointerCapture(y.pointerId)}catch(M){}}},x=function(y){var T=d.current;if(!(T==null||y.pointerId!==T.pointerId)){var P=y.clientX-T.dx,M=y.clientY-T.dy;(Math.abs(P-(u!=null?u.x:0))>2||Math.abs(M-(u!=null?u.y:0))>2)&&(T.moved=!0),l(ho({x:P,y:M}))}},v=function(){var y=d.current;d.current=null,m(!1),y!=null&&y.moved===!0&&(h.current=!0),y!=null&&y.moved===!0&&l(function(T){return T!=null&&bm(T),T})},w=function(){if(h.current===!0){h.current=!1;return}if(r!=null&&r.windowedOpen===!0){var y=ac(e&&e.useSessions,e&&e.useWorkspaces),T=function(P){var M=cm(P,y);M!=null&&typeof window.open=="function"&&window.open(M,"_blank","noopener")};if(r.running===!0){T(r);return}if(t.busy===!0)return;N({busy:!0}),te("/code-server/start",typeof y=="string"?{cwd:y}:{}).then(function(P){N({status:P,busy:!1}),T(P)}).catch(function(){N({busy:!1})});return}N({open:!a})},b=u!=null?{left:u.x,top:u.y}:{right:14,bottom:i>0?i+10:18};return Ui.createPortal(p.createElement("button",{type:"button",className:"dshcs-ball"+(a?" dshcs-ball-open":""),style:b,"data-dragging":f===!0?"":void 0,title:r!=null&&r.windowedOpen===!0?"\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)","aria-label":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server","aria-expanded":a,onPointerDown:g,onPointerMove:x,onPointerUp:v,onPointerCancel:v,onDragStart:function(y){y&&y.preventDefault&&y.preventDefault()},onClick:w},p.createElement(ym,{url:c}),p.createElement("span",{className:"dshcs-ball-dot","data-status":s,"aria-hidden":!0})),document.body)}function Tm(e){var t=Hi(),r=t.status,n=r!=null&&r.ok===!0&&r.running===!0,o=r!=null&&r.status==="starting",s=r!=null&&r.ok===!1,i=ac(e&&e.useSessions,e&&e.useWorkspaces),a=p.useRef(void 0),[c,u]=p.useState(0),l=Wi(r!=null?r.reserveComposer:!0),[f,m]=p.useState(!1),[d,h]=p.useState(null),[g,x]=p.useState(function(){return dm(0,Me(),l)}),v=p.useRef(g),w=p.useRef(function(){});v.current=g,p.useEffect(function(){var k=function(){x(function(re){return f?mo(Me(),l):Kt(re,Me(),l)})};return window.addEventListener("resize",k),function(){window.removeEventListener("resize",k)}},[f,l]),p.useEffect(function(){x(function(k){return Kt(k,Me(),l)})},[l]),p.useEffect(function(){return function(){w.current()}},[]);var b=12,y=4,[T,P]=p.useState(!1),M=p.useRef(null),V=function(k,re){if(k.button===0){k.preventDefault(),k.stopPropagation(),w.current();var ce=k.currentTarget.ownerDocument.defaultView;if(ce!==null){var he=k.pointerId,Nr=k.currentTarget,Ki=f,_t=Ki?mo(Me(),l):v.current,gc=_t.width>0?(k.clientX-_t.x)/_t.width:0,xc=Math.min(14,Math.max(0,k.clientY-_t.y)),j={pointerId:he,origin:{x:k.clientX,y:k.clientY},start:_t,ratio:gc,grabY:xc,wasMaximized:Ki,restored:!1,snapped:!1,moved:!1};M.current=j,h(re);try{Nr.setPointerCapture(he)}catch(me){}var _i=function(me){if(me.pointerId===he){if(re!=="move"){x(gm(j.start,re,me.clientX-j.origin.x,me.clientY-j.origin.y,Me(),l));return}var Yi=me.clientX-j.origin.x,zr=me.clientY-j.origin.y;if(Math.abs(Yi)+Math.abs(zr)>3&&(j.moved=!0),j.wasMaximized&&!j.restored){if(zr<y)return;var yo=v.current,Gr={x:me.clientX-yo.width*Math.min(.9,Math.max(.1,j.ratio)),y:me.clientY-j.grabY,width:yo.width,height:yo.height};Gr=Kt(Gr,Me(),l),j.restored=!0,j.start=Gr,j.origin={x:me.clientX,y:me.clientY},m(!1),x(Gr);return}var yc=j.start.y+zr,vc=hm(j.start,Yi,zr,Me(),l);x(vc);var vo=yc<=b;vo!==j.snapped&&(j.snapped=vo,P(vo))}},$i=function(){ce.removeEventListener("pointermove",_i),ce.removeEventListener("pointerup",jr),ce.removeEventListener("pointercancel",jr),w.current=function(){},M.current=null;try{Nr.releasePointerCapture(he)}catch(me){}},jr=function(me){me.pointerId===he&&($i(),h(null),(!j.wasMaximized||j.restored===!0)&&(j.snapped===!0&&j.moved===!0&&m(!0),j.snapped===!0&&P(!1)))};w.current=$i,ce.addEventListener("pointermove",_i),ce.addEventListener("pointerup",jr),ce.addEventListener("pointercancel",jr)}}},O=function(){m(function(k){return!k})},C=function(k){k.target.closest("[data-window-control]")===null&&V(k,"move")},R=function(k){k.target.closest("[data-window-control]")===null&&O()};p.useEffect(function(){if(!t.open)return;var k=!1;async function re(){N({busy:!0});var ce=await te("/code-server/status");if(!k){if(ce!=null&&ce.ok===!0&&ce.running===!0){N({status:ce,busy:!1});return}var he=await te("/code-server/start",typeof i=="string"?{cwd:i}:{});k||N({status:he,busy:!1})}}return re(),function(){k=!0}},[t.open]),p.useEffect(function(){if(typeof i!="string"||i===""||a.current===i)return;var k=a.current!==void 0&&a.current!==i;a.current=i;var re=!1;async function ce(){N({busy:!0});var he=await te("/code-server/start",{cwd:i});re||(N({status:he,busy:!1}),k&&he!=null&&he.ok===!0&&he.running===!0&&u(function(Nr){return Nr+1}))}return ce(),function(){re=!0}},[i]),p.useEffect(function(){t.open||(a.current=void 0)},[t.open]),p.useEffect(function(){var k=window.setInterval(function(){te("/code-server/status").then(function(re){N({status:re})})},3e3);return function(){window.clearInterval(k)}},[]),p.useEffect(function(){if(!t.open)return;function k(re){re.key==="Escape"&&N({open:!1})}return window.addEventListener("keydown",k),function(){window.removeEventListener("keydown",k)}},[t.open]);var _=r!=null&&typeof r.url=="string"?r.url:null,ae=n&&r!=null&&typeof r.cwd=="string"&&r.cwd!==""?r.cwd:null,Z=null;if(ae!==null){var E=ae.replace(/\\/g,"/");Z=E,(/^[A-Za-z]:\//.test(E)||E.charCodeAt(0)!==47)&&(Z="/"+E)}var L=_!==null?_+(Z!==null?"?folder="+encodeURIComponent(Z):""):null,oe;if(n&&L!==null)oe=p.createElement("iframe",{key:c,className:"dshcs-frame",src:L,title:"code-server",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock"});else if(o||r!=null&&r.status==="starting")oe=p.createElement(p.Fragment,null,p.createElement("iframe",{key:c,className:"dshcs-frame",src:"about:blank",title:"code-server",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock"}),p.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026"));else{var $=s&&r!=null&&r.error?r.error:"code-server \u672A\u8FD0\u884C";oe=p.createElement("div",{className:"dshcs-empty"},p.createElement("div",{className:"dshcs-emptybox"},p.createElement("div",null,s?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),p.createElement("pre",{className:"dshcs-error"},$),p.createElement("p",{className:"dshcs-hint"},"\u5B89\u88C5\u547D\u4EE4(Windows \u539F\u751F):npm install -g code-server@latest(\u9700\u914D\u5957\u6700\u65B0\u7248 node-gyp \u4E0E VS Spectre \u7F13\u89E3\u5E93);\u6216\u5728 cordis.patch.yml \u7684 code-server config \u4E2D\u8BBE\u7F6E bin \u6307\u5411\u5DF2\u5B89\u88C5\u4F4D\u7F6E\u3002\u7AEF\u53E3 "+(r!=null?r.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E\u3002")))}var le=["dshcs-win",f?"dshcs-win-max":"",T?"dshcs-win-snap":"",t.open===!1?"dshcs-win-hidden":""].filter(Boolean).join(" "),J=f?mo(Me(),l):g,ke=t.ballPos!=null?t.ballPos:{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(l>0?l+10:18)},Br={x:ke.x+ze/2,y:ke.y+ze/2},fc=Math.max(.05,ze/Math.max(J.width,J.height)),mc=t.open===!1?{x:Br.x-J.width/2,y:Br.y-J.height/2,width:J.width,height:J.height,scale:fc,borderRadius:19,opacity:0}:{x:J.x,y:J.y,width:J.width,height:J.height,scale:1,borderRadius:12,opacity:1},dc=d!==null?{duration:0}:{type:"spring",stiffness:340,damping:38,mass:.9,opacity:{type:"spring",stiffness:420,damping:40,mass:.8},borderRadius:{duration:.2}},pc=p.createElement(Fi.section,{className:le,style:t.open===!1?{left:0,top:0,pointerEvents:"none"}:{left:0,top:0},animate:mc,initial:!1,transition:dc,"data-interaction":d!==null?d:void 0,role:"dialog","aria-label":"Code Server"},p.createElement("span",{className:"dshcs-drag",title:"\u62D6\u52A8\u79FB\u52A8 / \u53CC\u51FB\u6700\u5927\u5316",onPointerDown:C,onDoubleClick:R}),p.createElement("div",{className:"dshcs-body"},oe),f?null:um.map(function(k){return p.createElement("span",{key:k,className:"dshcs-resize dshcs-resize-"+k,"data-direction":k,onPointerDown:function(re){V(re,k)}})})),Fr=mo(Me(),l),hc=p.createElement(Fi.div,{className:"dshcs-snapghost",initial:!1,animate:{opacity:T===!0?1:0,x:Fr.x,y:Fr.y,width:Fr.width,height:Fr.height},transition:T===!0?{type:"spring",stiffness:500,damping:44,mass:.9}:{duration:.14}},p.createElement("span",{className:"dshcs-snapghint"},"\u677E\u5F00\u4EE5\u6700\u5927\u5316"));return Ui.createPortal(p.createElement(p.Fragment,null,pc,hc),document.body)}var Sm=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",Vm="dsh-code-server/Card.module.css";function Pm(e,t){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var r=document.createElement("style");r.dataset.plugin="dsh-code-server",r.dataset.pluginCss=e,r.textContent=t,document.head.appendChild(r)}}Pm(Vm,Sm);function Cm(e){return p.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},p.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function go(e){return p.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function Ni(e){return p.createElement("label",{className:"dshcs-check"},p.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(t){e.onChange(t.target.checked)}}),p.createElement("span",{className:"dshcs-hint"},e.children))}function ji(e){var t=[];return e.overridden===!0&&(t.push(p.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),t.push(p.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),t.length===0?null:p.createElement("span",{className:"dshcs-badges"},...t)}function Em(e){var[t,r]=p.useState(!1),n=e.state;if(n==null||n.available!==!0)return null;var o=e.title,s=n.dirty!==!0||n.invalid===!0||n.saving===!0;return p.createElement("li",{className:"dshcs-card"+(t?" dshcs-cardOpen":"")},p.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":t,onClick:function(){r(!t)}},p.createElement("span",{className:"dshcs-cardHeadText"},p.createElement("span",{className:"dshcs-cardName"},o),p.createElement("span",{className:"dshcs-cardDescription"},e.description)),n.dirty===!0?p.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,p.createElement(Cm,{className:"dshcs-cardChevron"+(t?" dshcs-cardChevronOpen":"")})),t===!0?p.createElement("div",{className:"dshcs-cardBody"},n.writable!==!0?p.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,p.createElement("div",{className:"dshcs-cardFooter"},n.failed===!0?p.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,p.createElement(go,{disabled:n.dirty!==!0||n.saving===!0,onClick:e.onDiscard},e.discardLabel),p.createElement(go,{variant:"primary",disabled:s,onClick:e.onSave},n.saving===!0?e.savingLabel:e.saveLabel))):null)}function Am(e){var t=Hi();if(t.guideVisible!==!0)return null;var r=e.scope,[n,o]=p.useState(!1);function s(){N({guideVisible:!1})}function i(){try{r!=null&&typeof r.set=="function"&&r.set("installGuideDismissed",!0)}catch(c){}N({guideVisible:!1,guideDismissed:!0})}function a(){o(!0),te("/code-server/setup",{}).then(function(c){if(c==null||c.ok!==!0){o(!1),window.alert(c!=null&&c.error?c.error:"\u542F\u52A8\u5B89\u88C5\u5931\u8D25");return}var u=function(){te("/code-server/status").then(function(l){if(l==null||l.setup==null){o(!1);return}if(l.setup.running===!0){setTimeout(u,2e3);return}o(!1),N({status:l}),l.setup.ok===!0&&N({guideVisible:!1})}).catch(function(){o(!1)})};setTimeout(u,3e3)}).catch(function(){o(!1)})}return Ui.createPortal(p.createElement("div",{style:{position:"fixed",inset:0,zIndex:2147483998,display:"grid",placeItems:"center",background:"rgba(13,22,38,.35)"},role:"dialog","aria-modal":!0,"aria-label":"\u5B89\u88C5 Code Server \u73AF\u5883"},p.createElement("div",{style:{width:"min(520px, 92vw)",background:"var(--dsw-alias-bg-base,#fff)",borderRadius:14,padding:"20px 22px",boxShadow:"0 24px 64px rgba(13,22,38,.3)",border:"1px solid var(--dsw-alias-border-l2,#dfe3eb)",font:"13px/1.6 system-ui,sans-serif",color:"var(--dsw-alias-label-primary,#172033)"}},p.createElement("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10}},p.createElement("img",{src:"/code-server/icon.svg",alt:"",style:{width:26,height:26,objectFit:"contain"}}),p.createElement("strong",{style:{fontSize:15}},"\u5B89\u88C5 Code Server \u73AF\u5883"),p.createElement("span",{style:{flex:1}}),p.createElement("button",{type:"button",onClick:s,"aria-label":"\u5173\u95ED",style:{border:"none",background:"none",cursor:"pointer",fontSize:16,color:"var(--dsw-alias-label-tertiary,#7d8798)",padding:"2px 6px"}},"\xD7")),p.createElement("div",{style:{color:"var(--dsw-alias-label-secondary,#566174)",marginBottom:12}},"code-server(VS Code \u7F51\u9875\u7248)\u73AF\u5883\u5B89\u88C5\u4E0E\u4F7F\u7528\u6307\u5F15\u3002\u6BCF\u6B21\u542F\u52A8 DSH \u540E\u4F1A\u5F39\u51FA\u672C\u7A97\u53E3;\u70B9\u51FB\u300C\u4E0D\u518D\u63D0\u793A\u300D\u6216\u5230 \u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server \u52FE\u9009\u53EF\u6C38\u4E45\u5173\u95ED\u3002\u5B89\u88C5\u8FC7\u7A0B:\u5728 profile \u76EE\u5F55\u4E0B\u81EA\u52A8\u6784\u5EFA code-server(\u542B\u539F\u751F\u6A21\u5757,\u9700 C++ \u5DE5\u5177\u94FE)\u3002"),p.createElement("div",{style:{display:"flex",gap:10,justifyContent:"flex-end",flexWrap:"wrap"}},p.createElement("button",{type:"button",onClick:i,style:Dm},n?"\u5B89\u88C5\u4E2D\u2026":"\u4E0D\u518D\u63D0\u793A(\u6C38\u4E45\u5173\u95ED)"),p.createElement("button",{type:"button",onClick:a,disabled:n,style:Mm},n?"\u5B89\u88C5\u4E2D\u2026":"\u5F00\u59CB\u5B89\u88C5")))),document.body)}var Mm="appearance:none;font:inherit;font-size:13px;cursor:pointer;border:1px solid #5b6cff;background:#5b6cff;color:#fff;border-radius:7px;padding:7px 16px",Dm="appearance:none;font:inherit;font-size:13px;cursor:pointer;border:1px solid var(--dsw-alias-border-l2,#dfe3eb);background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-secondary,#566174);border-radius:7px;padding:7px 14px";function km(e){try{let R=function(){te("/code-server/status").then(function(E){E!=null&&typeof E=="object"&&N({status:E})}).catch(function(){})};var t=e.scope,[r,n]=p.useState(function(){return t!==void 0?t.getSnapshot():null}),[o,s]=p.useState(null),[i,a]=p.useState(!1),[c,u]=p.useState(!1);if(p.useEffect(function(){if(t===void 0||typeof t.subscribe!="function")return;function E(){try{n(t.getSnapshot())}catch(oe){}}var L=t.subscribe(E);return function(){typeof L=="function"&&L()}},[t]),t===void 0)return console.error("[code-server] card scope missing"),null;if(r==null||r.status!=="ready")return r!=null&&r.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",r.status),null;var l=r.value!==void 0&&r.value!==null?r.value:{},f=r.user,m={reserveComposer:l.reserveComposer!==!1,windowedOpen:l.windowedOpen===!0,installGuideDismissed:l.installGuideDismissed===!0},d=f!=null&&Object.prototype.hasOwnProperty.call(f,"reserveComposer"),h=f!=null&&Object.prototype.hasOwnProperty.call(f,"windowedOpen"),g=f!=null&&Object.prototype.hasOwnProperty.call(f,"installGuideDismissed"),x=o!==null&&(o.reserveComposer!==m.reserveComposer||o.windowedOpen!==m.windowedOpen||o.installGuideDismissed!==m.installGuideDismissed),v=!x||i,w={available:!0,writable:r.writable,dirty:x,invalid:!1,saving:i,failed:c,reserveComposer:{text:o!==null?o.reserveComposer:m.reserveComposer,overridden:d}};async function _(){if(x&&!i){a(!0),u(!1);try{var E=o!==null?o:m;await e.scope.set("reserveComposer",E.reserveComposer===!0),await e.scope.set("windowedOpen",E.windowedOpen===!0),await e.scope.set("installGuideDismissed",E.installGuideDismissed===!0),s(null),R()}catch(L){u(!0)}a(!1)}}async function ae(){if(!(i||r.writable!==!0)){a(!0),u(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("reserveComposer"),await e.scope.unset("windowedOpen"),await e.scope.unset("installGuideDismissed")):(await e.scope.set("reserveComposer",l.reserveComposer===void 0||l.reserveComposer===null?!0:l.reserveComposer),await e.scope.set("windowedOpen",l.windowedOpen===!0),await e.scope.set("installGuideDismissed",!1)),s(null),R()}catch(E){u(!0)}a(!1)}}var[b,y]=p.useState(null),[T,P]=p.useState(!1),[M,V]=p.useState(null),O=p.useRef(!0);p.useEffect(function(){return O.current=!0,function(){O.current=!1}},[]);async function Z(){if(T)return;P(!0),V(null);var E=await te("/code-server/setup",{});if(E==null||E.ok!==!0){V(E!=null&&E.error?E.error:"\u542F\u52A8\u5B89\u88C5\u5931\u8D25"),P(!1);return}V("\u73AF\u5883\u5B89\u88C5\u5DF2\u5728\u540E\u53F0\u5F00\u59CB,\u5B8C\u6210\u540E\u81EA\u52A8\u5237\u65B0\u2026");function L(){O.current===!0&&te("/code-server/status").then(function(oe){if(O.current===!0){if(oe==null||oe.setup==null){P(!1);return}if(oe.setup.running===!0){setTimeout(L,2e3);return}P(!1),y(oe.env!=null?oe.env:{error:"status \u672A\u8FD4\u56DE env"}),V(oe.setup.ok===!0?"\u73AF\u5883\u5B89\u88C5\u5B8C\u6210":`\u73AF\u5883\u5B89\u88C5\u5931\u8D25:
3
+ `+(oe.setup.logTail!=null?oe.setup.logTail.slice(-600):"(\u65E0\u65E5\u5FD7)"))}})}L()}var C=p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u73AF\u5883\u68C0\u6D4B"),p.createElement("span",{className:"dshcs-badges"},p.createElement(go,{variant:"primary",disabled:T,onClick:async function(){P(!0),V(null);var E=await te("/code-server/status");y(E!=null&&E.env!=null?E.env:{error:"status \u672A\u8FD4\u56DE env"}),P(!1)}},"\u68C0\u6D4B\u73AF\u5883"),p.createElement(go,{disabled:T,onClick:function(){Z()}},T?"\u5B89\u88C5\u4E2D\u2026":"\u5B89\u88C5\u73AF\u5883"))),b!=null?p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},b.error!=null?p.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+b.error):p.createElement("span",null,"\u72B6\u6001: "+(b.ok===!0?"\u2705 \u5C31\u7EEA":"\u274C \u4E0D\u901A\u8FC7")+(b.entry!=null?" \xB7 \u5165\u53E3: "+b.entry:" \xB7 \u5165\u53E3\u7F3A\u5931")+" \xB7 native: "+(b.native===!0?"\u2705":"\u274C")+" \xB7 VS Code \u5185\u90E8\u4F9D\u8D56: "+(b.vscodeInner===!0?"\u2705":"\u274C"))):p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},'\u70B9\u51FB"\u68C0\u6D4B\u73AF\u5883"\u67E5\u770B code-server \u5B89\u88C5\u72B6\u6001'),M!=null?p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},M):null,p.createElement("div",{className:"dshcs-hint",style:{marginTop:10,color:"var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary))"}},"\u5B89\u88C5\u4F4D\u7F6E: "+(b!=null&&b.entry!=null?b.entry:"(profile)\\.code-server-app(\u5F85\u5B89\u88C5\u540E\u53EF\u67E5\u770B)")+`
4
+ \u5378\u8F7D: \u5148\u624B\u52A8\u5220\u9664 .code-server-app \u76EE\u5F55,\u518D dsh plugin --profile web remove dsh-code-server-app`));return p.createElement(Em,{title:"Code Server",description:"\u7A97\u53E3\u884C\u4E3A:\u4FDD\u7559\u8F93\u5165\u6846\u4E0A\u65B9\u7A7A\u95F4 / \u7A97\u53E3\u5316(\u65B0\u6807\u7B7E\u9875)\u6253\u5F00",state:w,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:_,onDiscard:function(){s(null),u(!1)}},p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u4FDD\u7559\u8F93\u5165\u6846\u4E0A\u65B9\u7A7A\u95F4"),d===!0?p.createElement(ji,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){ae()}}):null),p.createElement(Ni,{checked:o!==null?o.reserveComposer:m.reserveComposer,disabled:r.writable!==!0,onChange:function(E){s(function(L){return Object.assign({},L!==null?L:m,{reserveComposer:E===!0})}),u(!1)}},"\u5F00\u542F\u65F6\u7A97\u53E3\u521D\u59CB/\u7F29\u653E/\u6700\u5927\u5316\u6B62\u4E8E\u8F93\u5165\u6846\u4E0A\u65B9;\u5173\u95ED\u540E\u5141\u8BB8\u76D6\u4F4F\u8F93\u5165\u6846(\u6700\u5927\u5316\u5230\u89C6\u53E3\u5E95)")),p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"),h===!0?p.createElement(ji,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){ae()}}):null),p.createElement(Ni,{checked:o!==null?o.windowedOpen:m.windowedOpen,disabled:r.writable!==!0,onChange:function(E){s(function(L){return Object.assign({},L!==null?L:m,{windowedOpen:E===!0})}),u(!1)}},"\u5F00\u542F\u540E\u70B9\u51FB\u60AC\u6D6E\u7403\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 code-server(\u81EA\u52A8\u542F\u52A8\u5E76\u8DDF\u968F\u5F53\u524D\u5DE5\u4F5C\u533A);\u5173\u95ED\u5219\u4F7F\u7528\u5185\u90E8\u6D6E\u52A8\u7A97\u53E3")),p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u5B89\u88C5\u6307\u5F15"),g===!0?p.createElement(ji,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){ae()}}):null),p.createElement(Ni,{checked:o!==null?o.installGuideDismissed:m.installGuideDismissed,disabled:r.writable!==!0,onChange:function(E){s(function(L){return Object.assign({},L!==null?L:m,{installGuideDismissed:E===!0})}),u(!1)}},"\u52FE\u9009=\u6C38\u4E45\u5173\u95ED\u5B89\u88C5\u6307\u5F15\u5F39\u7A97(\u6BCF\u6B21\u542F\u52A8\u4E0D\u518D\u5F39\u51FA);\u53D6\u6D88\u52FE\u9009=\u6062\u590D\u6BCF\u6B21\u542F\u52A8\u5F39\u51FA")),C)}catch(R){return console.error("[code-server] card render error:",R!=null&&R.message!==void 0?R.message:String(R)),null}}function Rm(e){var t=[];try{var r=e.turn.data.get("deliverables"),n=e.seq!=null?e.seq:Number.POSITIVE_INFINITY;if(r!=null&&Array.isArray(r.produced))for(var o={},s=0;s<r.produced.length;s++){var i=r.produced[s];i==null||typeof i.path!="string"||i.path===""||i.seq!=null&&i.seq>n||o[i.path]!==!0&&(o[i.path]=!0,t.push(i.path))}}catch(a){}return t}function Lm(e){var t=Rm(e);return t.length===0?null:t}function Im(e){return p.createElement("img",{src:"/code-server/icon.svg",alt:"","aria-hidden":!0,draggable:!1,style:{width:15,height:15,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Om(e){if(e==null||!Array.isArray(e.matched)||e.matched.length===0)return null;var t=e.matched;function r(o){var s=String(o).replace(/\\/g,"/"),i=s.lastIndexOf("/");return i>=0?s.slice(i+1):s}function n(o){N({open:!0}),te("/code-server/open-file",{file:o}).then(function(s){(s==null||s.ok!==!0)&&window.alert(s!=null&&s.error?s.error:"\u6253\u5F00\u5931\u8D25")}).catch(function(s){window.alert("\u6253\u5F00\u5931\u8D25: "+String(s))})}return p.createElement("div",{className:"dshcs-artifacts"},p.createElement("span",{className:"dshcs-artlabel"},"\u4EA7\u7269"),p.createElement("div",{className:"dshcs-artrow"},t.slice(0,6).map(function(o){return p.createElement("span",{key:o,className:"dshcs-artitem"},p.createElement("button",{type:"button",className:"dshcs-artfile",title:o,"aria-label":"\u6253\u5F00: "+o,onClick:function(){n(o)}},r(o)),p.createElement("button",{type:"button",className:"dshcs-artbtn",title:"\u5728 Code Server \u6253\u5F00: "+o,"aria-label":"\u5728 Code Server \u6253\u5F00: "+o,onClick:function(){n(o)}},p.createElement(Im,null)))}),t.length>6?p.createElement("span",{className:"dshcs-artmore"},"\u2026"):null))}function Bm(e){try{Fm(e)}catch(t){console.error("[code-server] apply failed:",t&&t.stack?t.stack:String(t));try{document.title="CS-ERR "+(t&&t.message||String(t))}catch(r){}}}function Fm(e){var t=e.get("slots");if(t===void 0){console.error("[code-server] slots service unavailable");return}te("/code-server/status").then(function(i){N({status:i}),i!=null&&typeof i=="object"&&i.lastSetupError!=null&&lm(i.lastSetupError)}).catch(function(){}),t.inject("shell.overlay",()=>t.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},i=>p.createElement(p.Fragment,null,p.createElement(wm,i),p.createElement(Tm,i))));try{t.inject("conversation.chat.turnTail",function(){return t.register({name:"conversation.chat.turnTail",priority:-9,id:"dshcs-open-file",select:Lm},Om)}),console.log("[code-server] turnTail artifacts buttons registered")}catch(i){console.warn("[code-server] turnTail register failed:",i!=null&&i.message!=null?i.message:String(i))}var r=e.settingsScope;if(r===void 0||typeof r.bind!="function"){console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}var n=r.bind({namespace:"code-server"});t.inject("settings.plugin.item",()=>t.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:n}}},km));try{var o=!1;try{var s=n.getSnapshot?n.getSnapshot():null;s!=null&&(s.user!=null&&s.user.installGuideDismissed===!0||s.value!=null&&s.value.installGuideDismissed===!0)&&(o=!0)}catch(i){}N({guideDismissed:o===!0}),o!==!0&&te("/code-server/status").then(function(i){N({status:i}),N({guideVisible:!0})}).catch(function(){N({guideVisible:!0})})}catch(i){console.warn("[code-server] guide check failed:",i!=null&&i.message!=null?i.message:String(i))}t.inject("shell.overlay",function(){return t.register({name:"shell.overlay",id:"code-server-guide",order:80,label:"Code Server Guide"},function(){return p.createElement(Am,{scope:n})})}),console.log("[code-server] client bundle registered (floating ball + window + settings card)")}var Nm=["slots","settingsScope"],jm="code-server";
5
5
  return module.exports;}});
6
6