dsh-code-server-app 0.1.27 → 0.1.31

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 bo=Object.defineProperty;var Tc=Object.getOwnPropertyDescriptor;var Sc=Object.getOwnPropertyNames;var Vc=Object.prototype.hasOwnProperty;var Cc=(e,t)=>{for(var r in t)bo(e,r,{get:t[r],enumerable:!0})},Pc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Sc(t))!Vc.call(e,o)&&o!==r&&bo(e,o,{get:()=>t[o],enumerable:!(n=Tc(t,o))||n.enumerable});return e};var Ec=e=>Pc(bo({},"__esModule",{value:!0}),e);var jm={};Cc(jm,{apply:()=>Om,inject:()=>Fm,name:()=>Nm});module.exports=Ec(jm);var Yi=require("react"),Wr=(0,Yi.createContext)({});var Xi=require("react");function qi(e){let t=(0,Xi.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ur=require("react");var Zi=typeof window!="undefined";var Ji=Zi?Ur.useLayoutEffect:Ur.useEffect;var Qi=require("react"),Tt=(0,Qi.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 j=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 U=e=>e*1e3,Q=e=>e/1e3;var Zt=(e,t)=>t?e*(1e3/t):0;var es=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Ac=1e-7,Mc=12;function Dc(e,t,r,n,o){let s,i,a=0;do i=t+(r-t)/2,s=es(i,n,o)-e,s>0?r=i:t=i;while(Math.abs(s)>Ac&&++a<Mc);return i}function We(e,t,r,n){if(e===t&&r===n)return j;let o=s=>Dc(s,0,1,e,r);return s=>s===0||s===1?s:es(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 ts={linear:j,easeIn:wo,easeInOut:nr,easeOut:To,circIn:er,circInOut:rr,circOut:tr,backIn:St,backInOut:Jt,backOut:_r,anticipate:Qt},kc=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(kc(e))return ue(ts[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),ts[e];return e};var ir=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function rs(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)&&(l.schedule(u),e()),u(i)}let l={schedule:(u,c=!1,f=!1)=>{let d=f&&n?t:r;return c&&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 c=t;t=r,r=c,t.forEach(a),t.clear(),n=!1,o&&(o=!1,l.process(u))}};return l}var Rc=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]=rs(s),b),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:f,preRender:m,render:d,postRender:p}=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,Rc),1)),o.timestamp=y,o.isProcessing=!0,a.process(o),l.process(o),u.process(o),c.process(o),f.process(o),m.process(o),d.process(o),p.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]=(C,M=!1,V=!1)=>(r||x(),T.schedule(C,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:W,steps:sr}=Yr(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:j,!0);var Xr;function Lc(){Xr=void 0}var z={now:()=>(Xr===void 0&&z.set(W.isProcessing||ie.useManualTiming?W.timestamp:performance.now()),Xr),set:e=>{Xr=e,queueMicrotask(Lc)}};var ns=e=>t=>typeof t=="string"&&t.startsWith(e),qr=ns("--"),Ic=ns("var(--"),Vt=e=>Ic(e)?Oc.test(e.split("/*")[0].trim()):!1,Oc=/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 Ct=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function os(e){return e==null}var is=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Pt=(e,t)=>r=>!!(typeof r=="string"&&is.test(r)&&r.startsWith(e)||t&&!os(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(Ct);return{[e]:parseFloat(o),[t]:parseFloat(s),[r]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}};var Bc=e=>Y(0,255,e),Co={...Ve,transform:e=>Math.round(Bc(e))},Ce={test:Pt("rgb","red"),parse:Zr("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Co.transform(e)+", "+Co.transform(t)+", "+Co.transform(r)+", "+Ue(Ie.transform(n))+")"};function Fc(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:Pt("#"),parse:Fc,transform:Ce.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"),Po=cr("vh"),Eo=cr("vw"),Jr={...ne,parse:e=>ne.parse(e)/100,transform:e=>ne.transform(e*100)};var He={test:Pt("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=>Ce.test(e)||lr.test(e)||He.test(e),parse:e=>Ce.test(e)?Ce.parse(e):He.test(e)?He.parse(e):lr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ce.transform(e):He.transform(e),getAnimatableNone:e=>{let t=B.parse(e);return t.alpha=0,B.transform(t)}};var ss=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Nc(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ct))==null?void 0:t.length)||0)+(((r=e.match(ss))==null?void 0:r.length)||0)>0}var ls="number",cs="color",jc="var",zc="var(",as="${}",Gc=/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(Gc,l=>(B.test(l)?(n.color.push(s),o.push(cs),r.push(B.parse(l))):l.startsWith(zc)?(n.var.push(s),o.push(jc),r.push(l)):(n.number.push(s),o.push(ls),r.push(parseFloat(l))),++s,as)).split(as);return{values:r,split:a,indexes:n,types:o}}function Wc(e){return Ke(e).values}function us({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===ls?o+=Ue(n[s]):i===cs?o+=B.transform(n[s]):o+=n[s]}return o}}function Uc(e){return us(Ke(e))}var Hc=e=>typeof e=="number"?0:B.test(e)?B.getAnimatableNone(e):e,Kc=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Hc(e);function _c(e){let t=Ke(e);return us(t)(t.values.map((n,o)=>Kc(n,t.split[o])))}var X={test:Nc,parse:Wc,createTransformer:Uc,getAnimatableNone:_c};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 fs({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,l=2*r-a;o=Ao(l,a,e+1/3),s=Ao(l,a,e),i=Ao(l,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)},$c=[lr,Ce,He],Yc=e=>$c.find(t=>t.test(e));function ms(e){let t=Yc(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=fs(r)),r}var Do=(e,t)=>{let r=ms(e),n=ms(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),Ce.transform(o))};var Qr=new Set(["none","hidden"]);function ds(e,t){return Qr.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function Xc(e,t){return r=>D(e,t,r)}function en(e){return typeof e=="number"?Xc:typeof e=="string"?Vt(e)?Et:B.test(e)?Do:Jc:Array.isArray(e)?ps:typeof e=="object"?B.test(e)?Do:qc:Et}function ps(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 qc(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 Zc(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]],l=(o=e.values[a])!=null?o:0;r[s]=l,n[i]++}return r}var Jc=(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?ds(e,t):we(ps(Zc(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 hs=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>A.update(t,r),stop:()=>fe(t),now:()=>W.isProcessing?W.timestamp:z.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 gs(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 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 Lo(e,t){return e*Math.sqrt(1-t*t)}var Qc=12;function eu(e,t,r){let n=r;for(let o=1;o<Qc;o++)n=n-e(n)/t(n);return n}var Ro=.001;function tu({duration:e=G.duration,bounce:t=G.bounce,velocity:r=G.velocity,mass:n=G.mass}){let o,s;Re(e<=U(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,Q(e)),i<1?(o=u=>{let c=u*i,f=c*e,m=c-r,d=Lo(u,i),p=Math.exp(-f);return Ro-m/d*p},s=u=>{let f=u*i*e,m=f*r+r,d=Math.pow(i,2)*Math.pow(u,2)*e,p=Math.exp(-f),g=Lo(Math.pow(u,2),i);return(-o(u)+Ro>0?-1:1)*((m-d)*p)/g}):(o=u=>{let c=Math.exp(-u*e),f=(u-r)*e+1;return-Ro+c*f},s=u=>{let c=Math.exp(-u*e),f=(r-u)*(e*e);return c*f});let a=5/e,l=eu(o,s,a);if(e=U(e),isNaN(l))return{stiffness:G.stiffness,damping:G.damping,duration:e};{let u=Math.pow(l,2)*n;return{stiffness:u,damping:i*2*Math.sqrt(n*u),duration:e}}}var ru=["duration","bounce"],nu=["stiffness","damping","mass"];function xs(e,t){return t.some(r=>e[r]!==void 0)}function ou(e){let t={velocity:G.velocity,stiffness:G.stiffness,damping:G.damping,mass:G.mass,isResolvedFromDuration:!1,...e};if(!xs(e,nu)&&xs(e,ru))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:G.mass,stiffness:o,damping:s}}else{let r=tu({...e,velocity:0});t={...t,...r,mass:G.mass},t.isResolvedFromDuration=!0}return t}function Mt(e=G.visualDuration,t=G.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:l,damping:u,mass:c,duration:f,velocity:m,isResolvedFromDuration:d}=ou({...r,velocity:-Q(r.velocity||0)}),p=m||0,g=u/(2*Math.sqrt(l*c)),x=i-s,v=Q(Math.sqrt(l/c)),w=Math.abs(x)<5;n||(n=w?G.restSpeed.granular:G.restSpeed.default),o||(o=w?G.restDelta.granular:G.restDelta.default);let b,y,T,C,M,V;if(g<1)T=Lo(v,g),C=(p+g*v*x)/T,b=P=>{let R=Math.exp(-g*v*P);return i-R*(C*Math.sin(T*P)+x*Math.cos(T*P))},M=g*v*C+x*T,V=g*v*x-C*T,y=P=>Math.exp(-g*v*P)*(M*Math.sin(T*P)+V*Math.cos(T*P));else if(g===1){b=R=>i-Math.exp(-v*R)*(x+(p+v*x)*R);let P=p+v*x;y=R=>Math.exp(-v*R)*(v*P*R-p)}else{let P=v*Math.sqrt(g*g-1);b=Z=>{let E=Math.exp(-g*v*Z),L=Math.min(P*Z,300);return i-E*((p+g*v*x)*Math.sinh(L)+P*x*Math.cosh(L))/P};let R=(p+g*v*x)/P,_=g*v*R-x*P,ae=g*v*x-R*P;y=Z=>{let E=Math.exp(-g*v*Z),L=Math.min(P*Z,300);return E*(_*Math.sinh(L)+ae*Math.cosh(L))}}let O={calculatedDuration:d&&f||null,velocity:P=>U(y(P)),next:P=>{if(!d&&g<1){let _=Math.exp(-g*v*P),ae=Math.sin(T*P),Z=Math.cos(T*P),E=i-_*(C*ae+x*Z),L=U(_*(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(P);if(d)a.done=P>=f;else{let _=U(y(P));a.done=Math.abs(_)<=n&&Math.abs(i-R)<=o}return a.value=a.done?i:R,a},toString:()=>{let P=Math.min(At(O),2e4),R=rn(_=>O.next(P*_).value,P,30);return P+"ms "+R},toTransition:()=>{}};return O}Mt.applyToOptions=e=>{let t=gs(e,100,Mt);return e.ease=t.ease,e.duration=U(t.duration),e.type="keyframes",e};var iu=5;function nn(e,t,r){let n=Math.max(t-iu,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:l,restDelta:u=.5,restSpeed:c}){let f=e[0],m={done:!1,value:f},d=V=>a!==void 0&&V<a||l!==void 0&&V>l,p=V=>a===void 0?l:l===void 0||Math.abs(a-V)<Math.abs(l-V)?a:l,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),P=b(V);m.done=Math.abs(O)<=u,m.value=m.done?v:P},T,C,M=V=>{d(m.value)&&(T=V,C=Mt({keyframes:[m.value,p(m.value)],velocity:nn(b,V,m.value),damping:o,stiffness:s,restDelta:u,restSpeed:c}))};return M(0),{calculatedDuration:null,next:V=>{let O=!1;return!C&&T===void 0&&(O=!0,y(V),M(V)),T!==void 0&&V>=T?C.next(V-T):(!O&&y(V),m)}}}function su(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 l=Array.isArray(t)?t[i]||j:t;a=we(l,a)}n.push(a)}return n}function ys(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=su(t,n,o),l=a.length,u=c=>{if(i&&c<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(c<e[f+1]);f++);let m=Se(e[f],e[f+1],c);return a[f](m)};return r?c=>u(Y(e[0],e[s-1],c)):u}function vs(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 bs(e){let t=[0];return vs(t,e.length-1),t}function ws(e,t){return e.map(r=>r*t)}function au(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=ws(r&&r.length===t.length?r:bs(t),e),a=ys(i,t,{ease:Array.isArray(o)?o:au(t,o)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}var lu=e=>e!==null;function _e(e,{repeat:t,repeatType:r="loop"},n,o=1){let s=e.filter(lu),a=o<0||t&&r!=="loop"&&t%2===1?0:s.length-1;return!a||n===void 0?s[a]:n}var cu={decay:ur,inertia:ur,tween:ot,keyframes:ot,spring:Mt};function on(e){typeof e.type=="string"&&(e.type=cu[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 uu=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!==z.now()&&this.tick(z.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,l=r||ot;l!==ot&&typeof a[0]!="number"&&(this.mixKeyframes=we(uu,tn(a[0],a[1])),a=[0,100]);let u=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=At(u));let{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+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:l}=this;if(this.startTime===null)return n.next(0);let{delay:u=0,keyframes:c,repeat:f,repeatType:m,repeatDelay:d,type:p,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),P=V%1;!P&&V>=1&&(P=1),P===1&&O--,O=Math.min(O,f+1),!!(O%2)&&(m==="reverse"?(P=1-P,d&&(P-=d/a)):m==="mirror"&&(y=i)),b=Y(0,1,P)*a}let T;w?(this.delayState.value=c[0],T=this.delayState):T=y.next(b),s&&!w&&(T.value=s(T.value));let{done:C}=T;!w&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);let M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return M&&p!==ur&&(T.value=_e(c,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=U(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(z.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=Q(this.currentTime))}play(){var o,s;if(this.isStopped)return;let{driver:t=hs,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(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 Ts(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)},fu={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),Ss=Io,Vs=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Cs=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),mu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Vs,scaleY:Cs,scale:e=>(Vs(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:Ss,rotate:Ss,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=mu,o=r;else{let a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=fu,o=a}if(!o)return sn(t);let s=n[t],i=o[1].split(",").map(du);return typeof s=="function"?s(i):i[s]}var Ps=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return an(r,t)};function du(e){return parseFloat(e.trim())}var Pe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],xe=new Set([...Pe,"pathRotation"]);var Bo=e=>e===Ve||e===S,pu=new Set(["x","y","z"]),hu=Pe.filter(e=>!pu.has(e));function Es(e){let t=[];return hu.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 As(){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=Es(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 Ms(){st.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(No=!0)})}function Ds(){jo=!0,Ms(),As(),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(Ms),A.resolveKeyframes(As))):(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])}Ts(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 ks=e=>e.startsWith("--");function ln(e,t,r){ks(t)?e.style.setProperty(t,r):e.style[t]=r}var Rs={};function cn(e,t){let r=qt(e);return()=>{var n;return(n=Rs[t])!=null?n:r()}}var Ls=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 Is(e,t,r,{delay:n=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeOut",times:l}={},u=void 0){let c={[t]:r};l&&(c.offset=l);let f=Go(a,o);Array.isArray(f)&&(c.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(c,m)}function fn(e){return typeof e=="function"&&"applyToOptions"in e}function Os({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:l}=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=Os(t);this.animation=Is(r,n,o,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let c=_e(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),ln(r,n,c),this.animation.cancel()}l==null||l(),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=U(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&&Ls()?(this.animation.timeline=t,r&&(this.animation.rangeStart=r),n&&(this.animation.rangeEnd=n),j):o(this)}};var Bs={anticipate:Qt,backInOut:Jt,circInOut:rr};function gu(e){return e in Bs}function Fs(e){typeof e.ease=="string"&&gu(e.ease)&&(e.ease=Bs[e.ease])}var Wo=10,mn=class extends Dt{constructor(t){Fs(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}),l=Math.max(Wo,z.now()-this.startTime),u=Y(0,Wo,l-Wo),c=a.sample(l).value,{name:f}=this.options;s&&f&&ln(s,f,c),r.setWithVelocity(a.sample(Math.max(0,l-u)).value,c,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 xu(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 Ns(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:xu(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 yu=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function js(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&yu.test(e[t]))return!0;return!1}var vu=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),bu=qt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function zs(e){var f;let{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:s,type:i,keyframes:a}=e,l=(f=t==null?void 0:t.owner)==null?void 0:f.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;let{onUpdate:u,transformTemplate:c}=t.owner.getProps();return bu()&&r&&(dn.has(r)||vu.has(r)&&js(a))&&(r!=="transform"||!c)&&!u&&!n&&o!=="mirror"&&s!==0&&i!=="inertia"}var wu=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:l,motionValue:u,element:c,...f}){var p;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=z.now();let m={autoplay:t,delay:r,type:n,repeat:o,repeatDelay:s,repeatType:i,name:l,motionValue:u,element:c,...f},d=(c==null?void 0:c.KeyframeResolver)||Ye;this.keyframeResolver=new d(a,(g,x,v)=>this.onKeyframesResolved(g,x,m,!v),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(t,r,n,o){var v,w;this.keyframeResolver=void 0;let{name:s,type:i,velocity:a,delay:l,isHandoff:u,onUpdate:c}=n;this.resolvedAt=z.now();let f=!0;Ns(t,s,i,a)||(f=!1,(ie.instantAnimations||!l)&&(c==null||c(_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>wu?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},p=f&&!u&&zs(d),g=(w=(v=d.motionValue)==null?void 0:v.owner)==null?void 0:w.current,x;if(p)try{x=new mn({...d,element:g})}catch(b){x=new Oe(d)}else x=new Oe(d);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(),Ds()),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,c)=>u.sortNodePosition(c)).indexOf(t),i=e.size,a=(i-1)*n;return typeof r=="function"?r(s,i):o===1?s*n:a-s*n}var Gs=30,Tu=e=>!isNaN(parseFloat(e)),Ws={current:void 0},Ho=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var s;let o=z.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=z.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Tu(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 Ws.current&&Ws.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Gs)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,Gs);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 Su={type:"spring",stiffness:500,damping:25,restSpeed:10},Vu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Cu={type:"keyframes",duration:.8},Pu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Us=(e,{keyframes:t})=>t.length>2?Cu:xe.has(e)?e.startsWith("scale")?Vu(t[1]):Su:Pu;var Eu=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Hs(e){for(let t in e)if(!Eu.has(t))return!0;return!1}var lt=(e,t,r,n={},o,s)=>i=>{let a=kt(n,e)||{},l=a.delay||n.delay||0,{elapsed:u=0}=n;u=u-U(l);let c={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};Hs(a)||Object.assign(c,Us(e,c)),c.duration&&(c.duration=U(c.duration)),c.repeatDelay&&(c.repeatDelay=U(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(fr(c),c.delay===0&&(f=!0)),(ie.instantAnimations||ie.skipAnimations||o!=null&&o.shouldSkipAnimations||a.skipAnimations)&&(f=!0,fr(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){let m=_e(c.keyframes,a);if(m!==void 0){A.update(()=>{c.onUpdate(m),c.onComplete()});return}}return a.isSync?new Oe(c):new pn(c)};var Au=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Mu(e){let t=Au.exec(e);if(!t)return[,];let[,r,n,o]=t;return[`--${r!=null?r:n}`,o]}var Du=4;function Ko(e,t,r=1){ue(r<=Du,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,o]=Mu(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 Ks(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]=Ks(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]=Ks(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",...Pe]);var mr=e=>Array.isArray(e);function ku(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Te(r))}function Ru(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=Ru(s[i]);ku(e,i,a)}}var I=e=>!!(e&&e.getVelocity);function $s(e){return!!(I(e)&&e.add)}function Rt(e,t){let r=e.getValue("willChange");if($s(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 Ys="framerAppearId",dr="data-"+Lt(Ys);function yn(e){return e.props[dr]}function Lu({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 p;let{transition:s,transitionEnd:i,...a}=t,l=e.getDefaultTransition();s=s?gn(s,l):l;let u=s==null?void 0:s.reduceMotion,c=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,(p=e.latestValues[g])!=null?p:null),v=a[g];if(v===void 0||m&&Lu(m,g))continue;let w={delay:r,...kt(s||{},g)};c&&(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 C=x.animation;C&&f.push(C)}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 l;let n=de(e,t,r.type==="exit"?(l=e.presenceContext)==null?void 0:l.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:c=0,staggerChildren:f,staggerDirection:m}=o;return Iu(e,t,u,c,f,m,r)}:()=>Promise.resolve(),{when:a}=o;if(a){let[u,c]=a==="beforeChildren"?[s,i]:[i,s];return u().then(()=>c())}else return Promise.all([s(),i(r.delay)])}function Iu(e,t,r=0,n=0,o=0,s=1,i){let a=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),a.push(bn(l,t,{...i,delay:r+(typeof n=="function"?0:n)+hn(e.variantChildren,l,n,o,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function Xs(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 qs={test:e=>e==="auto",parse:e=>e};var wn=e=>t=>t.test(e);var _o=[Ve,S,ne,ge,Eo,Po,qs],$o=e=>_o.find(wn(e));function Zs(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Xt(e):!0}var Ou=new Set(["brightness","contrast","saturate","opacity"]);function Bu(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(Ct)||[];if(!n)return e;let o=r.replace(n,""),s=Ou.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+o+")"}var Fu=/\b([a-z-]*)\(.*?\)/gu,pr={...X,getAnimatableNone:e=>{let t=e.match(Fu);return t?t.map(Bu).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 Js={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,...Js,zIndex:Yo,fillOpacity:Ie,strokeOpacity:Ie,numOctaves:Yo};var Nu={...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=>Nu[e];var ju=new Set([pr,hr]);function Sn(e,t){let r=Tn(e);return ju.has(r)||(r=X),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var zu=new Set(["auto","none","0"]);function Qs(e,t,r){let n=0,o;for(;n<e.length&&!o;){let s=e[n];typeof s=="string"&&!zu.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 c=0;c<t.length;c++){let f=t[c];if(typeof f=="string"&&(f=f.trim(),Vt(f))){let m=Ko(f,r.current);m!==void 0&&(t[c]=m),c===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),l=Vo(o),u=Vo(s);if(l!==u&&Be[n]){this.needsMeasurement=!0;return}if(i!==a)if(Bo(i)&&Bo(a))for(let c=0;c<t.length;c++){let f=t[c];typeof f=="string"&&(t[c]=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||Zs(t[o]))&&n.push(o);n.length&&Qs(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(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var gr=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Cn(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 ea(e){return Yt(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var{schedule:ft,cancel:Gu}=Yr(queueMicrotask,!1);var ye={x:!1,y:!1};function Pn(){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=Cn(e),n=new AbortController,o={passive:!0,...t,signal:n.signal};return[r,o,()=>n.abort()]}function Wu(e){return!(e.pointerType==="touch"||Pn())}function qo(e,t,r={}){let[n,o,s]=En(e,r);return n.forEach(i=>{let a=!1,l=!1,u,c=()=>{i.removeEventListener("pointerleave",p)},f=x=>{u&&(u(x),u=void 0),c()},m=x=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),l&&(l=!1,f(x))},d=()=>{a=!0,window.addEventListener("pointerup",m,o),window.addEventListener("pointercancel",m,o)},p=x=>{if(x.pointerType!=="touch"){if(a){l=!0;return}f(x)}},g=x=>{if(!Wu(x))return;l=!1;let v=t(i,x);typeof v=="function"&&(u=v,i.addEventListener("pointerleave",p,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 Uu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Jo(e){return Uu.has(e.tagName)||e.isContentEditable===!0}var Hu=new Set(["INPUT","SELECT","TEXTAREA"]);function Qo(e){return Hu.has(e.tagName)||e.isContentEditable===!0}var It=new WeakSet;function ta(e){return t=>{t.key==="Enter"&&e(t)}}function ei(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var ra=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=ta(()=>{if(It.has(r))return;ei(r,"down");let o=ta(()=>{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 na(e){return mt(e)&&!Pn()}var oa=new WeakSet;function ti(e,t,r={}){let[n,o,s]=En(e,r),i=a=>{let l=a.currentTarget;if(!na(a)||oa.has(a))return;It.add(l),r.stopPropagation&&oa.add(a);let u=t(l,a),c={...o,capture:!0},f=(p,g)=>{window.removeEventListener("pointerup",m,c),window.removeEventListener("pointercancel",d,c),It.has(l)&&It.delete(l),na(p)&&typeof u=="function"&&u(p,{success:g})},m=p=>{f(p,l===window||l===document||r.useGlobalTarget||Zo(l,p.target))},d=p=>{f(p,!1)};window.addEventListener("pointerup",m,c),window.addEventListener("pointercancel",d,c)};return n.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",i,o),ea(a)&&(a.addEventListener("focus",u=>ra(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,ia=(e,t,r)=>(n,o)=>o&&o[0]?o[0][e+"Size"]:Ot(n)&&"getBBox"in n?n.getBBox()[t]:n[r],Ku=ia("inline","width","offsetWidth"),_u=ia("block","height","offsetHeight");function $u({target:e,borderBoxSize:t}){var r;(r=An.get(e))==null||r.forEach(n=>{n(e,{get width(){return Ku(e,t)},get height(){return _u(e,t)}})})}function Yu(e){e.forEach($u)}function Xu(){typeof ResizeObserver!="undefined"&&(Xe=new ResizeObserver(Yu))}function sa(e,t){Xe||Xu();let r=Cn(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 qu(){Bt=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Mn.forEach(t=>t(e))},window.addEventListener("resize",Bt)}function aa(e){return Mn.add(e),Bt||qu(),()=>{Mn.delete(e),!Mn.size&&typeof Bt=="function"&&(window.removeEventListener("resize",Bt),Bt=void 0)}}function Dn(e,t){return typeof e=="function"?aa(e):sa(e,t)}var dt={value:null,addProjectionMetrics:null};function la(e){return Ot(e)&&e.tagName==="svg"}var Zu=[..._o,B,X],ca=e=>Zu.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 ua=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 fa(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 Ju=typeof window!="undefined";function ma(){if(Rn.current=!0,!!Ju)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 da=["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},l={}){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=z.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,A.render(this.render,!1,!0))};let{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=r.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=s,this.options=l,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 p=m[d];u[d]!==void 0&&I(p)&&p.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,ua.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||ma(),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:l,ease:u,duration:c}=r.accelerate,f=new Dt({element:this.current,name:t,keyframes:a,times:l,ease:u,duration:U(c)}),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<da.length;n++){let o=da[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=fa(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):!ca(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 pa(e.x)||pa(e.y)}function pa(e){return e&&e!=="0%"}function Vr(e,t,r){let n=e-r,o=t*n;return r+o}function ha(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=ha(e.min,t,r,n,o),e.max=ha(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 ga=.999999999999,xa=1.0000000000001;function ba(e,t,r,n=!1){var a;let o=r.length;if(!o)return;t.x=t.y=1;let s,i;for(let l=0;l<o;l++){s=r[l],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)&&Cr(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<xa&&t.x>ga&&(t.x=1),t.y<xa&&t.y>ga&&(t.y=1)}function ve(e,t){e.min+=t,e.max+=t}function ya(e,t,r,n,o=.5){let s=D(e.min,e.max,o);ci(e,t,r,s,n)}function va(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Cr(e,t,r){let n=r!=null?r:e;ya(e.x,va(t.x,n.x),t.scaleX,t.scale,t.originX),ya(e.y,va(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 Qu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ef=Pe.length;function wa(e,t,r){let n="",o=!0;for(let i=0;i<ef;i++){let a=Pe[i],l=e[a];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(a.startsWith("scale")?1:0);else{let c=parseFloat(l);u=a.startsWith("scale")?c===1:c===0}if(!u||r){let c=xr(l,ut[a]);if(!u){o=!1;let f=Qu[a]||a;n+=`${f}(${c}) `}r&&(t[a]=c)}}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 l in t){let u=t[l];if(xe.has(l)){i=!0;continue}else if(qr(l)){o[l]=u;continue}else{let c=xr(u,ut[l]);l.startsWith("origin")?(a=!0,s[l]=c):n[l]=c}}if(t.transform||(i||r?n.transform=wa(t,e.transform,r):n.transform&&(n.transform="none")),a){let{originX:l="50%",originY:u="50%",originZ:c=0}=s;n.transformOrigin=`${l} ${u} ${c}`}}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 Ta(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=Ta(e,t.target.x),n=Ta(e,t.target.y);return`${r}% ${n}%`}};var Sa={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,l=r.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;let u=D(a,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=u),typeof o[3+i]=="number"&&(o[3+i]/=u),s(o)}};var Pr={borderRadius:{...Nt,applyTo:[...gr]},borderTopLeftRadius:Nt,borderTopRightRadius:Nt,borderBottomLeftRadius:Nt,borderBottomRightRadius:Nt,boxShadow:Sa};function Er(e,{layout:t,layoutId:r}){return xe.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Pr[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 tf(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):Ps(t,r);{let o=tf(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 rf={offset:"stroke-dashoffset",array:"stroke-dasharray"},nf={offset:"strokeDashoffset",array:"strokeDasharray"};function Va(e,t,r=1,n=0,o=!0){e.pathLength=1;let s=o?rf:nf;e[s.offset]=`${-n}`,e[s.array]=`${t} ${r}`}var of=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Mr(e,{attrX:t,attrY:r,attrScale:n,pathLength:o,pathSpacing:s=1,pathOffset:i=0,...a},l,u,c){var d,p;if(pt(e,a,u),l){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=(p=c==null?void 0:c.transformBox)!=null?p:"fill-box",delete f.transformBox);for(let g of of)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&&Va(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=Pe.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 sf=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<sf;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 af=[...kn].reverse(),lf=kn.length;function cf(e){return t=>Promise.all(t.map(({animation:r,options:n})=>Xs(e,r,n)))}function pi(e){let t=cf(e),r=Pa(),n=!0,o=!1,s=u=>(c,f)=>{var d;let m=de(e,f,u==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);if(m){let{transition:p,transitionEnd:g,...x}=m;c={...c,...x,...g}}return c};function i(u){t=u(e)}function a(u){let{props:c}=e,f=mi(e.parent)||{},m=[],d=new Set,p={},g=1/0;for(let v=0;v<lf;v++){let w=af[v],b=r[w],y=c[w]!==void 0?c[w]:f[w],T=Ee(y),C=w===u?b.isActive:null;C===!1&&(g=v);let M=y===f[w]&&y!==c[w]&&T;if(M&&(n||o)&&e.manuallyAnimateOnMount&&(M=!1),b.protectedKeys={...p},!b.isActive&&C===null||!y&&!b.prevProp||Fe(y)||typeof y=="boolean")continue;if(w==="exit"&&b.isActive&&C!==!0){b.prevResolvedValues&&(p={...p,...b.prevResolvedValues});continue}let V=Ea(b.prevProp,y),O=V||w===u&&b.isActive&&!M&&T||v>g&&T,P=!1,R=Array.isArray(y)?y:[y],_=R.reduce(s(w),{});C===!1&&(_={});let{prevResolvedValues:ae={}}=b,Z={...ae,..._},E=$=>{O=!0,d.has($)&&(P=!0,d.delete($)),b.needsAnimating[$]=!0;let le=e.getValue($);le&&(le.liveStyle=!1)};for(let $ in Z){let le=_[$],J=ae[$];if(p.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&&(p={...p,..._}),(n||o)&&e.blockInitialAnimation&&(O=!1);let L=M&&V;O&&(!L||P)&&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 c.initial!="boolean"){let w=de(e,Array.isArray(c.initial)?c.initial[0]:c.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&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),n=!1,o=!1,x?t(m):Promise.resolve()}function l(u,c){var m;if(r[u].isActive===c)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(d=>{var p;return(p=d.animationState)==null?void 0:p.setActive(u,c)}),r[u].isActive=c;let f=a(u);for(let d in r)r[d].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:i,getState:()=>r,reset:()=>{r=Pa(),o=!0}}}function Ea(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 Pa(){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 Aa=1e-4,uf=1-Aa,ff=1+Aa,Ma=.01,mf=0-Ma,df=0+Ma;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>=uf&&e.scale<=ff||isNaN(e.scale))&&(e.scale=1),(e.translate>=mf&&e.translate<=df||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 Da(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 pf(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=Da(e.min,t,r,a,o),e.max=Da(e.max,t,r,a,o)}function ka(e,t,[r,n,o],s,i){pf(e,t[r],t[n],t[o],t.scale,s,i)}var hf=["x","scaleX","originX"],gf=["y","scaleY","originY"];function wi(e,t,r,n){ka(e.x,t,hf,r?r.x:void 0,n?n.x:void 0),ka(e.y,t,gf,r?r.y:void 0,n?n.y:void 0)}function Ra(e){return e.translate===0&&e.scale===1}function Ti(e){return Ra(e.x)&&Ra(e.y)}function La(e,t){return e.min===t.min&&e.max===t.max}function Oa(e,t){return La(e.x,t.x)&&La(e.y,t.y)}function Ia(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Si(e,t){return Ia(e.x,t.x)&&Ia(e.y,t.y)}function Vi(e){return K(e.x)/K(e.y)}function Ci(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pe(e){return[e("x"),e("y")]}function Ba(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:c,pathRotation:f,rotateX:m,rotateY:d,skewX:p,skewY:g}=r;u&&(n=`perspective(${u}px) ${n}`),c&&(n+=`rotate(${c}deg) `),f&&(n+=`rotate(${f}deg) `),m&&(n+=`rotateX(${m}deg) `),d&&(n+=`rotateY(${d}deg) `),p&&(n+=`skewX(${p}deg) `),g&&(n+=`skewY(${g}deg) `)}let a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(n+=`scale(${a}, ${l})`),n||"none"}var xf=gr.length,Fa=e=>typeof e=="string"?parseFloat(e):e,Na=e=>typeof e=="number"||S.test(e);function za(e,t,r,n,o,s){var i,a,l,u;o?(e.opacity=D(0,(i=r.opacity)!=null?i:1,yf(n)),e.opacityExit=D((a=t.opacity)!=null?a:1,0,vf(n))):s&&(e.opacity=D((l=t.opacity)!=null?l:1,(u=r.opacity)!=null?u:1,n));for(let c=0;c<xf;c++){let f=gr[c],m=ja(t,f),d=ja(r,f);if(m===void 0&&d===void 0)continue;m||(m=0),d||(d=0),m===0||d===0||Na(m)===Na(d)?(e[f]=Math.max(D(Fa(m),Fa(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 ja(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var yf=Ga(0,.5,tr),vf=Ga(.5,.95,j);function Ga(e,t,r){return n=>n<e?0:n>t?1:r(Se(e,t,n))}function Wa(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 Ua=(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(Ua),this.isDirty=!1,this.children.forEach(t)}};function Ha(e,t){let r=z.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},Pi=["","X","Y","Z"],bf=1e3,wf=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 Qa(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&&Qa(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=wf++,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(Vf),this.nodes.forEach(Df),this.nodes.forEach(kf),this.nodes.forEach(Cf),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 l=0;l<this.path.length;l++)this.path[l].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 l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=Ot(i)&&!la(i),this.instance=i;let{layoutId:a,layout:l,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&&(l||a)&&(this.isLayoutDirty=!0),e){let c,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,c&&c(),c=Ha(m,250),vt.hasAnimatedSinceResize&&(vt.hasAnimatedSinceResize=!1,this.nodes.forEach($a)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let p=this.options.transition||u.getDefaultTransition()||Bf,{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(p,"layout"),onPlay:g,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(c,w,b.path)}else f||$a(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(Rf),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&&Qa(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){let f=this.path[c];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:l}=this.options;if(a===void 0&&!l)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 l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(Ef),this.nodes.forEach(Ka);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(_a);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Af),this.nodes.forEach(Mf),this.nodes.forEach(Tf),this.nodes.forEach(Sf)):this.nodes.forEach(_a),this.clearAllSnapshots();let a=z.now();W.delta=Y(0,1e3/60,a-W.timestamp),W.timestamp=a,W.isProcessing=!0,sr.update.process(W),sr.preRender.process(W),sr.render.process(W),W.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ft.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Pf),this.sharedNodes.forEach(Lf)}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 l=0;l<this.path.length;l++)this.path[l].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 l=n(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Ti(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;i&&this.instance&&(a||Ne(this.latestValues)||c)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){let a=this.measurePageBox(),l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),Ff(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,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(Nf))){let{scroll:c}=this.root;c&&(ve(a.x,c.offset.x),ve(a.y,c.offset.y))}return a}removeElementScroll(i){var l;let a=F();if(be(a,i),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){let c=this.path[u],{scroll:f,options:m}=c;c!==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,l){var c,f;let u=l||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)&&Cr(u,d.latestValues,(c=d.layout)==null?void 0:c.layoutBox)}return Ne(this.latestValues)&&Cr(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(i){var l;let a=F();be(a,i);for(let u=0;u<this.path.length;u++){let c=this.path[u];if(!Ne(c.latestValues))continue;let f;c.instance&&(In(c.latestValues)&&c.updateSnapshot(),f=F(),be(f,c.measurePageBox())),wi(a,c.latestValues,(l=c.snapshot)==null?void 0:l.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!==W.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 l=!!this.resumingFrom||this!==a;if(!(i||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:f}=this.options;if(!this.layout||!(c||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=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,l){this.relativeParent=i,this.linkedParentVersion=i.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),jt(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),be(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;let i=this.getLead(),a=!!this.resumingFrom||this!==i,l=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===W.timestamp&&(l=!1),l)return;let{layout:u,layoutId:c}=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||c))return;be(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;ba(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||!Ci(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ci(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 l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qe(),this.projectionDelta=qe(),this.projectionDeltaWithTransform=qe()}setAnimationOrigin(i,a=!1,l){let u=this.snapshot,c=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(),p=u?u.source:void 0,g=this.layout?this.layout.source:void 0,x=p!==g,v=this.getStack(),w=!v||v.members.length<=1,b=!!(x&&!w&&this.options.crossfade===!0&&!this.path.some(Of));this.animationProgress=0;let y,T=l==null?void 0:l.interpolateProjection(i);this.mixTargetDelta=C=>{let M=C/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):(Ya(m.x,i.x,M),Ya(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),If(this.relativeTarget,this.relativeTargetOrigin,d,M),y&&Oa(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=F()),be(y,this.relativeTarget)),x&&(this.animationValues=f,za(f,c,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,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.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=Wa(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),i.onUpdate&&i.onUpdate(c)},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(bf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let i=this.getLead(),{targetWithTransforms:a,target:l,layout:u,latestValues:c}=i;if(!(!a||!l||!u)){if(this!==i&&this.layout&&u&&el(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||F();let f=K(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+f;let m=K(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+m}be(a,l),Cr(a,c),xt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}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:l}={}){let u=this.getStack();u&&u.promote(this,l),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:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;let u={};l.z&&Ei("z",i,u,this.animationValues);for(let c=0;c<Pi.length;c++)Ei(`rotate${Pi[c]}`,i,u,this.animationValues),Ei(`skew${Pi[c]}`,i,u,this.animationValues);i.render();for(let c in u)i.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);i.scheduleRender()}applyProjectionStyles(i,a){var p,g;if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}let l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=yt(a==null?void 0:a.pointerEvents)||"",i.transform=l?l(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=l?l({},""):"none",this.hasProjected=!1);return}i.visibility="";let c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Ba(this.projectionDeltaWithTransform,this.treeScale,c);l&&(f=l(c,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=(p=c.opacity)!=null?p:this.latestValues.opacity)!=null?g:1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:i.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(let x in Pr){if(c[x]===void 0)continue;let{correct:v,applyTo:w,isCSSVariable:b}=Pr[x],y=f==="none"?c[x]:v(c[x],u);if(w){let T=w.length;for(let C=0;C<T;C++)i[w[C]]=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(Ka),this.root.sharedNodes.clear()}}}function Tf(e){e.updateLayout()}function Sf(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 el(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 l=qe();i?xt(l,e.applyTransform(o,!0),t.measuredBox):xt(l,n,t.layoutBox);let u=!Ti(a),c=!1;if(!e.resumeFrom){let f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){let{snapshot:m,layout:d}=f;if(m&&d){let p=e.options.layoutAnchor||void 0,g=F();jt(g,t.layoutBox,m.layoutBox,p);let x=F();jt(x,n,d.layoutBox,p),Si(g,x)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Vf(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 Cf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Pf(e){e.clearSnapshot()}function Ka(e){e.clearMeasurements()}function Ef(e){e.isLayoutDirty=!0,e.updateLayout()}function _a(e){e.isLayoutDirty=!1}function Af(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Mf(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function $a(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Df(e){e.resolveTargetDelta()}function kf(e){e.calcProjection()}function Rf(e){e.resetSkewAndRotation()}function Lf(e){e.removeLeadSnapshot()}function Ya(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 Xa(e,t,r,n){e.min=D(t.min,r.min,n),e.max=D(t.max,r.max,n)}function If(e,t,r,n){Xa(e.x,t.x,r.x,n),Xa(e.y,t.y,r.y,n)}function Of(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Bf={duration:.45,ease:[.4,0,.1,1]},qa=e=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Za=qa("applewebkit/")&&!qa("chrome/")?Math.round:j;function Ja(e){e.min=Za(e.min),e.max=Za(e.max)}function Ff(e){Ja(e.x),Ja(e.y)}function el(e,t,r){return e==="position"||e==="preserve-aspect"&&!vi(Vi(t),Vi(r),.2)}function Nf(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}var tl=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 tl({});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 rl=require("react"),Un=(0,rl.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Je=require("react");function nl(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 ol=require("react"),Hn=(0,ol.createContext)({strict:!1});var il={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"]},sl=!1;function jf(){if(sl)return;let e={};for(let t in il)e[t]={isEnabled:r=>il[t].some(n=>!!r[n])};Tr(e),sl=!0}function Kn(){return jf(),oi()}function al(e){let t=Kn();for(let r in e)t[r]={...t[r],...e[r]};Tr(t)}var zf=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")||zf.has(e)}var ll=e=>!Ir(e);function Gf(e){typeof e=="function"&&(ll=t=>t.startsWith("on")?!Ir(t):e(t))}try{Gf(require("@emotion/is-prop-valid").default)}catch(e){}function cl(e,t,r){let n={};for(let o in e)o==="values"&&typeof e.values=="object"||I(e[o])||(ll(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 ul=require("react"),Qe=(0,ul.createContext)({});var _n=require("react");function fl(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 dl(e){let{initial:t,animate:r}=fl(e,(0,_n.useContext)(Qe));return(0,_n.useMemo)(()=>({initial:t,animate:r}),[ml(t),ml(r)])}function ml(e){return Array.isArray(e)?e.join(" "):e}var Wt=require("react");var pl=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 Wf({transformTemplate:e},t){return(0,pl.useMemo)(()=>{let r=zt();return pt(r,t,e),Object.assign({},r.vars,r.style)},[t])}function Uf(e,t){let r=e.style||{},n={};return Ai(n,r,e),Object.assign(n,Wf(e,t)),n}function hl(e,t){let r={},n=Uf(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 gl=require("react");var $n=()=>({...zt(),attrs:{}});function xl(e,t,r,n){let o=(0,gl.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 yl=["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:!!(yl.indexOf(e)>-1||/[A-Z]/u.test(e))}function vl(e,t,r,{latestValues:n},o,s=!1,i){let l=((i!=null?i:Gt(e))?xl:hl)(t,n,o,e),u=cl(t,typeof e=="string",s),c=e!==Wt.Fragment?{...u,...l,ref:r}:{},{children:f}=t,m=(0,Wt.useMemo)(()=>I(f)?f.get():f,[f]);return(0,Wt.createElement)(e,{...c,children:m})}var Mi=require("react");function Hf({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,o){return{latestValues:Kf(r,n,o,e),renderState:t()}}function Kf(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,l=Ze(e),u=vr(e);t&&u&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let c=r?r.initial===!1:!1;c=c||i===!1;let f=c?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 p=ct(e,m[d]);if(p){let{transitionEnd:g,transition:x,...v}=p;for(let w in v){let b=v[w];if(Array.isArray(b)){let y=c?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=()=>Hf(e,t,n,o);return r?s():qi(s)};var bl=Yn({scrapeMotionValuesFromProps:ht,createRenderState:zt});var wl=Yn({scrapeMotionValuesFromProps:kr,createRenderState:$n});var Tl=Symbol.for("motionComponentSymbol");var wt=require("react");function Sl(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 l=i(s);typeof l=="function"&&(o.current=l)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s)},[t])}var se=require("react");var Vl=require("react"),Xn=(0,Vl.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),l=(0,se.useContext)(Tt),u=(0,se.useContext)(Un),c=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:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:f,isSVG:s}),d.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let p=m.current,g=(0,se.useContext)(Xn);p&&!p.projection&&o&&(p.type==="html"||p.type==="svg")&&_f(m.current,r,o,g);let x=(0,se.useRef)(!1);(0,se.useInsertionEffect)(()=>{p&&x.current&&p.update(r,l)});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 Ji(()=>{d.current=!0,p&&(x.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),w.current&&p.animationState&&p.animationState.animateChanges())}),(0,se.useEffect)(()=>{p&&(!w.current&&p.animationState&&p.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,v)}),w.current=!1),p.enteringChildren=void 0)}),p}function _f(e,t,r,n){let{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:f}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:Pl(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:l,layoutRoot:u,layoutAnchor:c})}function Pl(e){if(e)return e.options.allowProjection!==!1?e.projection:Pl(e.parent)}function Zn(e,{forwardMotionProps:t=!1,type:r}={},n,o){var u,c;n&&al(n);let s=r?r==="svg":Gt(e),i=s?wl:bl;function a(f,m){let d,p={...(0,Ut.useContext)(Un),...f,layoutId:$f(f)},{isStatic:g}=p,x=dl(f),v=i(f,g);if(!g&&typeof window!="undefined"){Yf(p,n);let w=Xf(p);d=w.MeasureLayout,x.visualElement=Cl(e,v,p,o,w.ProjectionNode,s)}return(0,qn.jsxs)(Qe.Provider,{value:x,children:[d&&x.visualElement?(0,qn.jsx)(d,{visualElement:x.visualElement,...p}):null,vl(e,f,Sl(v,x.visualElement,m),v,g,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${(c=(u=e.displayName)!=null?u:e.name)!=null?c:""})`}`;let l=(0,Ut.forwardRef)(a);return l[Tl]=e,l}function $f({layoutId:e}){let t=(0,Ut.useContext)(Wr).id;return t&&e!==void 0?t+"-"+e:e}function Yf(e,t){let r=(0,Ut.useContext)(Hn).strict}function Xf(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 El(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 Al=require("react");var Ml=(e,t)=>{var n;return((n=t.isSVG)!=null?n:Gt(e))?new Rr(t):new Ar(t,{allowProjection:e!==Al.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 qf=0,Qn=class extends q{constructor(){super(...arguments),this.id=qf++,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 l=de(this.node,i,a);if(l){let{transition:u,transitionEnd:c,...f}=l;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 Dl={animation:{Feature:Jn},exit:{Feature:Qn}};function je(e){return{point:{x:e.pageX,y:e.pageY}}}var kl=e=>t=>mt(t)&&e(t,je(t));function tt(e,t,r,n){return Ae(e,t,kl(r),n)}var eo=({current:e})=>e?e.ownerDocument.defaultView:null;var Rl=(e,t)=>Math.abs(e-t);function Ll(e,t){let r=Rl(e.x,t.x),n=Rl(e.y,t.y);return Math.sqrt(r**2+n**2)}var Il=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=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=to(this.lastRawMoveEventInfo,this.transformPagePoint));let p=Di(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=Ll(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;let{point:v}=p,{timestamp:w}=W;this.history.push({...v,timestamp:w});let{onStart:b,onMove:y}=this.handlers;g||(b&&b(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=to(g,this.transformPagePoint),A.update(this.updatePoint,!0)},this.handlePointerUp=(p,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(p.type==="pointercancel"?this.lastMoveEventInfo:to(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(p,b),v&&v(p,b)},!mt(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=i,this.contextWindow=o||window;let l=je(t),u=to(l,this.transformPagePoint),{point:c}=u,{timestamp:f}=W;this.history=[{...c,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);(Il.has(n.overflowX)||Il.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 Ol(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Di({point:e},t){return{point:e,delta:Ol(e,Bl(t)),offset:Ol(e,Zf(t)),velocity:Jf(t,.1)}}function Zf(e){return e[0]}function Bl(e){return e[e.length-1]}function Jf(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,o=Bl(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>U(t)));)r--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&o.timestamp-n.timestamp>U(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 Gl(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 Fl(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 Wl(e,{top:t,left:r,bottom:n,right:o}){return{x:Fl(e.x,r,o),y:Fl(e.y,t,n)}}function Nl(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 Ul(e,t){return{x:Nl(e.x,t.x),y:Nl(e.y,t.y)}}function Hl(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 Kl(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:jl(e,"left","right"),y:jl(e,"top","bottom")}}function jl(e,t,r){return{min:zl(e,t),max:zl(e,r)}}function zl(e,t){return typeof e=="number"?e:e[t]||0}var Qf=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:p,onDragStart:g}=this.getProps();if(d&&!p&&(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:p,onDirectionLock:g,onDrag:x}=this.getProps();if(!d&&!this.openDragLock)return;let{offset:v}=m;if(p&&this.currentDirection===null){this.currentDirection=tm(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)},l=(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:c}=this.getProps();this.panSession=new Ht(t,{onSessionStart:s,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,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=Gl(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=Wl(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]=Kl(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=Ul(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(),l=this.constraints||{},u=pe(c=>{if(!no(c,r,this.currentDirection))return;let f=l&&l[c]||{};(i===!0||i===c)&&(f={min:0,max:0});let m=o?200:1e6,d=o?40:1e7,p={type:"inertia",velocity:n?t[c]:0,bounceStiffness:m,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(c,p)});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],l=s.get()||0;s.set(t[r]-D(i,a,.5)+l)}})}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 l=a.get();o[i]=Hl({min:l,max:l},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:l,max:u}=this.constraints[i];a.set(D(l,u,o[i]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Qf.set(this.visualElement,this);let t=this.visualElement.current,r=tt(t,"pointerdown",u=>{let{drag:c,dragListener:f=!0}=this.getProps(),m=u.target,d=m!==t&&Qo(m);c&&f&&!d&&this.start(u)}),n,o=()=>{let{dragConstraints:u}=this.getProps();et(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),n||(n=em(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()),l=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(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(),l&&l(),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 $l(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function em(e,t,r){let n=Dn(e,$l(r)),o=Dn(t,$l(r));return()=>{n(),o()}}function no(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function tm(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=j,this.removeListeners=j,this.controls=new oo(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 ki=e=>(t,r)=>{e&&A.update(()=>e(t,r),!1,!0)},so=class extends q{constructor(){super(...arguments),this.removePointerDownListener=j}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 Yl=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]=nl(),n=(0,Or.useContext)(Wr);return(0,Yl.jsx)(Li,{...e,layoutGroup:n,switchLayoutGroup:(0,Or.useContext)(Xn),isPresent:t,safeToRemove:r})}var Xl={pan:{Feature:so},drag:{Feature:io,ProjectionNode:Lr,MeasureLayout:ao}};function ql(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)=>(ql(this.node,n,"Start"),o=>ql(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 Zl(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)=>(Zl(this.node,s,"Start"),(i,{success:a})=>Zl(this.node,i,a?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}};var Oi=new WeakMap,Ii=new WeakMap,rm=e=>{let t=Oi.get(e.target);t&&t(e)},nm=e=>{e.forEach(rm)};function om({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(nm,{root:e,...t})),n[o]}function Jl(e,t,r){let n=om(t);return Oi.set(e,r),n.observe(e),()=>{Oi.delete(e),n.unobserve(e)}}var im={some:0,all:1},fo=class extends q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.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:im[o]},a=u=>{let{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);let{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),d=c?f:m;d&&d(u)};this.stopObserver=Jl(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(sm(t,r))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}};function sm({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var Ql={inView:{Feature:fo},tap:{Feature:uo},focus:{Feature:co},hover:{Feature:lo}};var ec={layout:{ProjectionNode:Lr,MeasureLayout:ao}};var tc={...Dl,...Ql,...Xl,...ec};var Bi=El(tc,Ml);var Fi=Bi;var h=require("react"),ac=require("react-dom"),Gi=new Set,Wi={open:!1,status:null,busy:!1,ballPos:null,guideVisible:!1,guideDismissed:!1};function H(e){Wi=Object.assign({},Wi,e),Gi.forEach(function(t){t()})}function lm(e){return Gi.add(e),function(){Gi.delete(e)}}function cm(){return Wi}function lc(){return h.useSyncExternalStore(lm,cm)}var rc="dshcs-setup-error-banner";function um(e){try{if(typeof document=="undefined"||document.getElementById(rc)!=null)return;var t=document.createElement("div");t.id=rc,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">'+nc(e.error!=null?e.error:"\u5B89\u88C5\u811A\u672C\u9519\u8BEF")+"</span>"+(e.at!=null?'<br><span style="color:#b07a7a;font-size:11px">'+nc(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(),H({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 nc(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 cc(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 l=i[a];if(l.sessionIds!=null&&l.sessionIds.indexOf(o)!==-1&&typeof l.path=="string"&&l.path!=="")return l.path}var u=n!=null?n.recentWorkspaceId:void 0;if(u!==void 0){for(var c=0;c<i.length;c++)if(i[c].workspaceId===u&&typeof i[c].path=="string"&&i[c].path!=="")return i[c].path}if(i.length>0&&typeof i[0].path=="string"&&i[0].path!=="")return i[0].path}catch(f){}}function fm(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 mm=["nw","n","ne","w","e","sw","s","se"],ee=12,dm=720,pm=520,uc=360,fc=260,oc=24;function Ui(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(uc,n.width),n.width),s=rt(e.height,Math.min(fc,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 hm(e,t,r){let n=xo(t,r),o=Math.min(dm,n.width),s=Math.min(pm,n.height),i=gm(),a=i>0?i-8:t.height-ee-r;return Kt({x:t.width-ee-o-e*oc,y:Math.max(ee,a-s-e*oc),width:o,height:s},t,r)}function gm(){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 xm(e,t,r,n,o){return Kt({...e,x:e.x+t,y:e.y+r},n,o)}function ym(e,t,r,n,o,s){let i=Kt(e,o,s),a=xo(o,s),l=Math.min(uc,a.width),u=Math.min(fc,a.height),c=o.height-ee-s,f=i.x,m=i.x+i.width,d=i.y,p=i.y+i.height;return t.includes("w")&&(f=rt(i.x+r,ee,m-l)),t.includes("e")&&(m=rt(m+r,f+l,o.width-ee)),t.includes("n")&&(d=rt(i.y+n,ee,p-u)),t.includes("s")&&(p=rt(p+n,d+u,c)),{x:f,y:d,width:m-f,height:p-d}}function mo(e,t){let r=xo(e,t);return{x:ee,y:ee,width:r.width,height:r.height}}var vm='.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}}',ic="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(ic)+"]")===null&&(po=document.createElement("style"),po.setAttribute("data-dshcs",ic),po.textContent=vm,document.head.appendChild(po));var po;function bm(e){var[t,r]=h.useState(!1),n=h.useRef(e.url);return h.useEffect(function(){n.current!==e.url&&(n.current=e.url,r(!1))},[e.url]),e.url!=null&&t!==!0?h.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"}}):h.createElement("svg",{viewBox:"0 0 18 18","aria-hidden":!0,style:{width:17,height:17}},h.createElement("rect",{x:"3",y:"3",width:"12",height:"12",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:1.4}),h.createElement("path",{d:"M3 7h12M7 3v12",fill:"none",stroke:"currentColor",strokeWidth:1.4}))}var ze=38,De=8,mc="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 wm(){try{var e=window.localStorage.getItem(mc);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 Tm(e){try{window.localStorage.setItem(mc,JSON.stringify(e))}catch(t){}}function Sm(e){var t=lc(),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=Ui(r!=null?r.reserveComposer:!0),a=t.open===!0,l="/code-server/icon.svg",[u,c]=h.useState(wm),[f,m]=h.useState(!1),d=h.useRef(null),p=h.useRef(!1);if(h.useEffect(function(){var y=function(){c(function(T){return T==null?T:ho(T)})};return window.addEventListener("resize",y),function(){window.removeEventListener("resize",y)}},[]),h.useEffect(function(){var y=u!=null?u:(function(){var T=Ui(r!=null?r.reserveComposer:!0);return{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(T>0?T+10:18)}})();H({ballPos:ho(y)})},[u,r]),n!=null&&n.ok!==!0)return null;var g=function(y){if(y.button===0){var T=y.currentTarget,C=T.getBoundingClientRect();d.current={pointerId:y.pointerId,dx:y.clientX-C.left,dy:y.clientY-C.top,moved:!1},p.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 C=y.clientX-T.dx,M=y.clientY-T.dy;(Math.abs(C-(u!=null?u.x:0))>2||Math.abs(M-(u!=null?u.y:0))>2)&&(T.moved=!0),c(ho({x:C,y:M}))}},v=function(){var y=d.current;d.current=null,m(!1),y!=null&&y.moved===!0&&(p.current=!0),y!=null&&y.moved===!0&&c(function(T){return T!=null&&Tm(T),T})},w=function(){if(p.current===!0){p.current=!1;return}if(r!=null&&r.windowedOpen===!0){var y=cc(e&&e.useSessions,e&&e.useWorkspaces),T=function(C){var M=fm(C,y);M!=null&&typeof window.open=="function"&&window.open(M,"_blank","noopener")};if(r.running===!0){T(r);return}if(t.busy===!0)return;H({busy:!0}),te("/code-server/start",typeof y=="string"?{cwd:y}:{}).then(function(C){H({status:C,busy:!1}),T(C)}).catch(function(){H({busy:!1})});return}H({open:!a})},b=u!=null?{left:u.x,top:u.y}:{right:14,bottom:i>0?i+10:18};return ac.createPortal(h.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},h.createElement(bm,{url:l}),h.createElement("span",{className:"dshcs-ball-dot","data-status":s,"aria-hidden":!0})),document.body)}function Vm(e){var t=lc(),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=cc(e&&e.useSessions,e&&e.useWorkspaces),a=h.useRef(void 0),[l,u]=h.useState(0),c=Ui(r!=null?r.reserveComposer:!0),[f,m]=h.useState(!1),[d,p]=h.useState(null),[g,x]=h.useState(function(){return hm(0,Me(),c)}),v=h.useRef(g),w=h.useRef(function(){});v.current=g,h.useEffect(function(){var k=function(){x(function(re){return f?mo(Me(),c):Kt(re,Me(),c)})};return window.addEventListener("resize",k),function(){window.removeEventListener("resize",k)}},[f,c]),h.useEffect(function(){x(function(k){return Kt(k,Me(),c)})},[c]),h.useEffect(function(){return function(){w.current()}},[]);var b=12,y=4,[T,C]=h.useState(!1),M=h.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,Hi=f,_t=Hi?mo(Me(),c):v.current,yc=_t.width>0?(k.clientX-_t.x)/_t.width:0,vc=Math.min(14,Math.max(0,k.clientY-_t.y)),N={pointerId:he,origin:{x:k.clientX,y:k.clientY},start:_t,ratio:yc,grabY:vc,wasMaximized:Hi,restored:!1,snapped:!1,moved:!1};M.current=N,p(re);try{Nr.setPointerCapture(he)}catch(me){}var Ki=function(me){if(me.pointerId===he){if(re!=="move"){x(ym(N.start,re,me.clientX-N.origin.x,me.clientY-N.origin.y,Me(),c));return}var $i=me.clientX-N.origin.x,zr=me.clientY-N.origin.y;if(Math.abs($i)+Math.abs(zr)>3&&(N.moved=!0),N.wasMaximized&&!N.restored){if(zr<y)return;var yo=v.current,Gr={x:me.clientX-yo.width*Math.min(.9,Math.max(.1,N.ratio)),y:me.clientY-N.grabY,width:yo.width,height:yo.height};Gr=Kt(Gr,Me(),c),N.restored=!0,N.start=Gr,N.origin={x:me.clientX,y:me.clientY},m(!1),x(Gr);return}var bc=N.start.y+zr,wc=xm(N.start,$i,zr,Me(),c);x(wc);var vo=bc<=b;vo!==N.snapped&&(N.snapped=vo,C(vo))}},_i=function(){ce.removeEventListener("pointermove",Ki),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(),p(null),(!N.wasMaximized||N.restored===!0)&&(N.snapped===!0&&N.moved===!0&&m(!0),N.snapped===!0&&C(!1)))};w.current=_i,ce.addEventListener("pointermove",Ki),ce.addEventListener("pointerup",jr),ce.addEventListener("pointercancel",jr)}}},O=function(){m(function(k){return!k})},P=function(k){k.target.closest("[data-window-control]")===null&&V(k,"move")},R=function(k){k.target.closest("[data-window-control]")===null&&O()};h.useEffect(function(){if(!t.open)return;var k=!1;async function re(){H({busy:!0});var ce=await te("/code-server/status");if(!k){if(ce!=null&&ce.ok===!0&&ce.running===!0){H({status:ce,busy:!1});return}var he=await te("/code-server/start",typeof i=="string"?{cwd:i}:{});k||H({status:he,busy:!1})}}return re(),function(){k=!0}},[t.open]),h.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(){H({busy:!0});var he=await te("/code-server/start",{cwd:i});re||(H({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]),h.useEffect(function(){t.open||(a.current=void 0)},[t.open]),h.useEffect(function(){var k=window.setInterval(function(){te("/code-server/status").then(function(re){H({status:re})})},3e3);return function(){window.clearInterval(k)}},[]),h.useEffect(function(){if(!t.open)return;function k(re){re.key==="Escape"&&H({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=h.createElement("iframe",{key:l,className:"dshcs-frame",src:L,title:"code-server",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write",allow:"clipboard-read; clipboard-write"});else if(o||r!=null&&r.status==="starting")oe=h.createElement(h.Fragment,null,h.createElement("iframe",{key:l,className:"dshcs-frame",src:"about:blank",title:"code-server",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write",allow:"clipboard-read; clipboard-write"}),h.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=h.createElement("div",{className:"dshcs-empty"},h.createElement("div",{className:"dshcs-emptybox"},h.createElement("div",null,s?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),h.createElement("pre",{className:"dshcs-error"},$),h.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(),c):g,ke=t.ballPos!=null?t.ballPos:{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(c>0?c+10:18)},Br={x:ke.x+ze/2,y:ke.y+ze/2},dc=Math.max(.05,ze/Math.max(J.width,J.height)),pc=t.open===!1?{x:Br.x-J.width/2,y:Br.y-J.height/2,width:J.width,height:J.height,scale:dc,borderRadius:19,opacity:0}:{x:J.x,y:J.y,width:J.width,height:J.height,scale:1,borderRadius:12,opacity:1},hc=d!==null?{duration:0}:{type:"spring",stiffness:340,damping:38,mass:.9,opacity:{type:"spring",stiffness:420,damping:40,mass:.8},borderRadius:{duration:.2}},gc=h.createElement(Fi.section,{className:le,style:t.open===!1?{left:0,top:0,pointerEvents:"none"}:{left:0,top:0},animate:pc,initial:!1,transition:hc,"data-interaction":d!==null?d:void 0,role:"dialog","aria-label":"Code Server"},h.createElement("span",{className:"dshcs-drag",title:"\u62D6\u52A8\u79FB\u52A8 / \u53CC\u51FB\u6700\u5927\u5316",onPointerDown:P,onDoubleClick:R}),h.createElement("div",{className:"dshcs-body"},oe),f?null:mm.map(function(k){return h.createElement("span",{key:k,className:"dshcs-resize dshcs-resize-"+k,"data-direction":k,onPointerDown:function(re){V(re,k)}})})),Fr=mo(Me(),c),xc=h.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}},h.createElement("span",{className:"dshcs-snapghint"},"\u677E\u5F00\u4EE5\u6700\u5927\u5316"));return ac.createPortal(h.createElement(h.Fragment,null,gc,xc),document.body)}var Cm=".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}",Pm="dsh-code-server/Card.module.css";function Em(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)}}Em(Pm,Cm);function Am(e){return h.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},h.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 h.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 h.createElement("label",{className:"dshcs-check"},h.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(t){e.onChange(t.target.checked)}}),h.createElement("span",{className:"dshcs-hint"},e.children))}function ji(e){var t=[];return e.overridden===!0&&(t.push(h.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),t.push(h.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),t.length===0?null:h.createElement("span",{className:"dshcs-badges"},...t)}function Mm(e){var[t,r]=h.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 h.createElement("li",{className:"dshcs-card"+(t?" dshcs-cardOpen":"")},h.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":t,onClick:function(){r(!t)}},h.createElement("span",{className:"dshcs-cardHeadText"},h.createElement("span",{className:"dshcs-cardName"},o),h.createElement("span",{className:"dshcs-cardDescription"},e.description)),n.dirty===!0?h.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,h.createElement(Am,{className:"dshcs-cardChevron"+(t?" dshcs-cardChevronOpen":"")})),t===!0?h.createElement("div",{className:"dshcs-cardBody"},n.writable!==!0?h.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,h.createElement("div",{className:"dshcs-cardFooter"},n.failed===!0?h.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,h.createElement(go,{disabled:n.dirty!==!0||n.saving===!0,onClick:e.onDiscard},e.discardLabel),h.createElement(go,{variant:"primary",disabled:s,onClick:e.onSave},n.saving===!0?e.savingLabel:e.saveLabel))):null)}var zi="dshcs-guide-modal";function sc(e){try{let u=function(){var c=document.getElementById(zi);c!=null&&c.remove()};if(typeof document=="undefined"||document.getElementById(zi)!=null)return;var t=document.createElement("div");t.id=zi,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label","\u5B89\u88C5 Code Server \u73AF\u5883"),t.style.cssText="position:fixed;inset:0;z-index:2147483998;display:grid;place-items:center;background:rgba(13,22,38,.35)";var r=document.createElement("div");r.style.cssText="width:min(520px,92vw);background:var(--dsw-alias-bg-base,#fff);border-radius:14px;padding:20px 22px;box-shadow: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)";var n=document.createElement("div");n.style.cssText="display:flex;align-items:center;gap:10px;margin-bottom:10px",n.innerHTML='<img src="/code-server/icon.svg" alt="" style="width:26px;height:26px;object-fit:contain"><strong style="font-size:15px">\u5B89\u88C5 Code Server \u73AF\u5883</strong>';var o=document.createElement("button");o.type="button",o.setAttribute("aria-label","\u5173\u95ED"),o.textContent="\xD7",o.style.cssText="margin-left:auto;border:none;background:none;cursor:pointer;font-size:16px;color:var(--dsw-alias-label-tertiary,#7d8798);padding:2px 6px",o.onclick=function(){u()},n.appendChild(o);var s=document.createElement("div");s.style.cssText="color:var(--dsw-alias-label-secondary,#566174);margin-bottom:12px",s.textContent="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";var i=document.createElement("div");i.style.cssText="display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap";var a=document.createElement("button");a.type="button",a.textContent="\u4E0D\u518D\u63D0\u793A(\u6C38\u4E45\u5173\u95ED)",a.style.cssText="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",a.onclick=function(){try{e!=null&&typeof e.set=="function"&&e.set("installGuideDismissed",!0)}catch(c){}H({guideDismissed:!0}),u()};var l=document.createElement("button");l.type="button",l.textContent="\u5F00\u59CB\u5B89\u88C5",l.style.cssText="appearance:none;font:inherit;font-size:13px;cursor:pointer;border:1px solid #5b6cff;background:#5b6cff;color:#fff;border-radius:7px;padding:7px 16px",l.onclick=function(){l.disabled=!0,l.textContent="\u5B89\u88C5\u4E2D\u2026",te("/code-server/setup",{}).then(function(c){if(c==null||c.ok!==!0){l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5",window.alert(c!=null&&c.error?c.error:"\u542F\u52A8\u5B89\u88C5\u5931\u8D25");return}var f=function(){te("/code-server/status").then(function(m){if(m==null||m.setup==null){l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5";return}if(m.setup.running===!0){setTimeout(f,2e3);return}l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5",H({status:m}),m.setup.ok===!0&&u()}).catch(function(){l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5"})};setTimeout(f,3e3)}).catch(function(){l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5"})},i.appendChild(a),i.appendChild(l),r.appendChild(n),r.appendChild(s),r.appendChild(i),t.appendChild(r),document.body.appendChild(t)}catch(u){console.error("[code-server] guide modal failed:",u!=null&&u.message!=null?u.message:String(u))}}function Dm(e){try{let R=function(){te("/code-server/status").then(function(E){E!=null&&typeof E=="object"&&H({status:E})}).catch(function(){})};var t=e.scope,[r,n]=h.useState(function(){return t!==void 0?t.getSnapshot():null}),[o,s]=h.useState(null),[i,a]=h.useState(!1),[l,u]=h.useState(!1);if(h.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 c=r.value!==void 0&&r.value!==null?r.value:{},f=r.user,m={reserveComposer:c.reserveComposer!==!1,windowedOpen:c.windowedOpen===!0,installGuideDismissed:c.installGuideDismissed===!0},d=f!=null&&Object.prototype.hasOwnProperty.call(f,"reserveComposer"),p=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:l,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",c.reserveComposer===void 0||c.reserveComposer===null?!0:c.reserveComposer),await e.scope.set("windowedOpen",c.windowedOpen===!0),await e.scope.set("installGuideDismissed",!1)),s(null),R()}catch(E){u(!0)}a(!1)}}var[b,y]=h.useState(null),[T,C]=h.useState(!1),[M,V]=h.useState(null),O=h.useRef(!0);h.useEffect(function(){return O.current=!0,function(){O.current=!1}},[]);async function Z(){if(T)return;C(!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"),C(!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){C(!1);return}if(oe.setup.running===!0){setTimeout(L,2e3);return}C(!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 P=h.createElement("div",{className:"dshcs-field"},h.createElement("div",{className:"dshcs-fieldHead"},h.createElement("span",{className:"dshcs-fieldLabel"},"\u73AF\u5883\u68C0\u6D4B"),h.createElement("span",{className:"dshcs-badges"},h.createElement(go,{variant:"primary",disabled:T,onClick:async function(){C(!0),V(null);var E=await te("/code-server/status");y(E!=null&&E.env!=null?E.env:{error:"status \u672A\u8FD4\u56DE env"}),C(!1)}},"\u68C0\u6D4B\u73AF\u5883"),h.createElement(go,{disabled:T,onClick:function(){Z()}},T?"\u5B89\u88C5\u4E2D\u2026":"\u5B89\u88C5\u73AF\u5883"))),b!=null?h.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},b.error!=null?h.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+b.error):h.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"))):h.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},'\u70B9\u51FB"\u68C0\u6D4B\u73AF\u5883"\u67E5\u770B code-server \u5B89\u88C5\u72B6\u6001'),M!=null?h.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},M):null,h.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 h.createElement(Mm,{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)}},h.createElement("div",{className:"dshcs-field"},h.createElement("div",{className:"dshcs-fieldHead"},h.createElement("span",{className:"dshcs-fieldLabel"},"\u4FDD\u7559\u8F93\u5165\u6846\u4E0A\u65B9\u7A7A\u95F4"),d===!0?h.createElement(ji,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){ae()}}):null),h.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)")),h.createElement("div",{className:"dshcs-field"},h.createElement("div",{className:"dshcs-fieldHead"},h.createElement("span",{className:"dshcs-fieldLabel"},"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"),p===!0?h.createElement(ji,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){ae()}}):null),h.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")),h.createElement("div",{className:"dshcs-field"},h.createElement("div",{className:"dshcs-fieldHead"},h.createElement("span",{className:"dshcs-fieldLabel"},"\u5B89\u88C5\u6307\u5F15"),g===!0?h.createElement(ji,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){ae()}}):null),h.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")),P)}catch(R){return console.error("[code-server] card render error:",R!=null&&R.message!==void 0?R.message:String(R)),null}}function km(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 Rm(e){var t=km(e);return t.length===0?null:t}function Lm(e){return h.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 Im(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){H({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 h.createElement("div",{className:"dshcs-artifacts"},h.createElement("span",{className:"dshcs-artlabel"},"\u4EA7\u7269"),h.createElement("div",{className:"dshcs-artrow"},t.slice(0,6).map(function(o){return h.createElement("span",{key:o,className:"dshcs-artitem"},h.createElement("button",{type:"button",className:"dshcs-artfile",title:o,"aria-label":"\u6253\u5F00: "+o,onClick:function(){n(o)}},r(o)),h.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)}},h.createElement(Lm,null)))}),t.length>6?h.createElement("span",{className:"dshcs-artmore"},"\u2026"):null))}function Om(e){try{Bm(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 Bm(e){var t=e.get("slots");if(t===void 0){console.error("[code-server] slots service unavailable");return}var r=e.settingsScope,n=null;if(r!==void 0&&typeof r.bind=="function")n=r.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}te("/code-server/status").then(function(i){H({status:i}),i!=null&&typeof i=="object"&&i.lastSetupError!=null&&um(i.lastSetupError)}).catch(function(){}),t.inject("shell.overlay",()=>t.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},i=>h.createElement(h.Fragment,null,h.createElement(Sm,i),h.createElement(Vm,i))));try{t.inject("conversation.chat.turnTail",function(){return t.register({name:"conversation.chat.turnTail",priority:-9,id:"dshcs-open-file",select:Rm},Im)}),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))}t.inject("settings.plugin.item",()=>t.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:n}}},Dm));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){}H({guideDismissed:o===!0}),o!==!0&&te("/code-server/status").then(function(i){if(H({status:i}),i!=null&&i.installGuideDismissed===!0){H({guideDismissed:!0});return}sc(n)}).catch(function(){sc(n)})}catch(i){console.warn("[code-server] guide check failed:",i!=null&&i.message!=null?i.message:String(i))}console.log("[code-server] client bundle registered (floating ball + window + settings card)")}var Fm=["slots","settingsScope"],Nm="code-server";
2
+ var Ti=Object.defineProperty;var Ac=Object.getOwnPropertyDescriptor;var Mc=Object.getOwnPropertyNames;var Dc=Object.prototype.hasOwnProperty;var kc=(e,t)=>{for(var r in t)Ti(e,r,{get:t[r],enumerable:!0})},Rc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mc(t))!Dc.call(e,i)&&i!==r&&Ti(e,i,{get:()=>t[i],enumerable:!(n=Ac(t,i))||n.enumerable});return e};var Lc=e=>Rc(Ti({},"__esModule",{value:!0}),e);var _m={};kc(_m,{apply:()=>Wm,inject:()=>Hm,name:()=>Km});module.exports=Lc(_m);var Qo=require("react"),Hr=(0,Qo.createContext)({});var es=require("react");function ts(e){let t=(0,es.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Kr=require("react");var rs=typeof window!="undefined";var ns=rs?Kr.useLayoutEffect:Kr.useEffect;var is=require("react"),Tt=(0,is.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 Z=(e,t,r)=>r>t?t:r<e?e:r;var Re=()=>{},ce=()=>{};var oe={};var Yt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var Xt=e=>typeof e=="object"&&e!==null;var qt=e=>/^0[^.\s]+$/u.test(e);function Zt(e){let t;return()=>(t===void 0&&(t=e()),t)}var z=e=>e;var be=(...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 i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let s=0;s<i;s++){let o=this.subscriptions[s];o&&o(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var K=e=>e*1e3,te=e=>e/1e3;var Jt=(e,t)=>t?e*(1e3/t):0;var os=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Ic=1e-7,Oc=12;function Bc(e,t,r,n,i){let s,o,a=0;do o=t+(r-t)/2,s=os(o,n,i)-e,s>0?r=o:t=o;while(Math.abs(s)>Ic&&++a<Oc);return o}function We(e,t,r,n){if(e===t&&r===n)return z;let i=s=>Bc(s,0,1,e,r);return s=>s===0||s===1?s:os(i(s),t,n)}var _r=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var $r=e=>t=>1-e(1-t);var Yr=We(.33,1.53,.69,.99),St=$r(Yr),Qt=_r(St);var er=e=>e>=1?1:(e*=2)<1?.5*St(e):.5*(2-Math.pow(2,-10*(e-1)));var tr=e=>1-Math.sin(Math.acos(e)),rr=$r(tr),nr=_r(tr);var Si=We(.42,0,1,1),Ci=We(0,0,.58,1),ir=We(.42,0,.58,1);var Vi=e=>Array.isArray(e)&&typeof e[0]!="number";var or=e=>Array.isArray(e)&&typeof e[0]=="number";var ss={linear:z,easeIn:Si,easeInOut:ir,easeOut:Ci,circIn:tr,circInOut:nr,circOut:rr,backIn:St,backInOut:Qt,backOut:Yr,anticipate:er},Nc=e=>typeof e=="string",Xr=e=>{if(or(e)){ce(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,i]=e;return We(t,r,n,i)}else if(Nc(e))return ce(ss[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),ss[e];return e};var sr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function as(e){let t=new Set,r=new Set,n=!1,i=!1,s=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function a(u){s.has(u)&&(l.schedule(u),e()),u(o)}let l={schedule:(u,c=!1,f=!1)=>{let d=f&&n?t:r;return c&&s.add(u),d.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(o=u,n){i=!0;return}n=!0;let c=t;t=r,r=c,t.forEach(a),t.clear(),n=!1,i&&(i=!1,l.process(u))}};return l}var Fc=40;function qr(e,t){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=sr.reduce((w,v)=>(w[v]=as(s),w),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:f,preRender:m,render:d,postRender:h}=o,g=()=>{let w=oe.useManualTiming,v=w?i.timestamp:performance.now();r=!1,w||(i.delta=n?1e3/60:Math.max(Math.min(v-i.timestamp,Fc),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),f.process(i),m.process(i),d.process(i),h.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(g))},x=()=>{r=!0,n=!0,i.isProcessing||e(g)};return{schedule:sr.reduce((w,v)=>{let T=o[v];return w[v]=(P,A=!1,C=!1)=>(r||x(),T.schedule(P,A,C)),w},{}),cancel:w=>{for(let v=0;v<sr.length;v++)o[sr[v]].cancel(w)},state:i,steps:o}}var{schedule:E,cancel:ue,state:H,steps:ar}=qr(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:z,!0);var Zr;function jc(){Zr=void 0}var G={now:()=>(Zr===void 0&&G.set(H.isProcessing||oe.useManualTiming?H.timestamp:performance.now()),Zr),set:e=>{Zr=e,queueMicrotask(jc)}};var ls=e=>t=>typeof t=="string"&&t.startsWith(e),Jr=ls("--"),zc=ls("var(--"),Ct=e=>zc(e)?Gc.test(e.split("/*")[0].trim()):!1,Gc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ei(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var Ce={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ie={...Ce,transform:e=>Z(0,1,e)},lr={...Ce,default:1};var Ue=e=>Math.round(e*1e5)/1e5;var Vt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function cs(e){return e==null}var us=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Et=(e,t)=>r=>!!(typeof r=="string"&&us.test(r)&&r.startsWith(e)||t&&!cs(r)&&Object.prototype.hasOwnProperty.call(r,t)),Qr=(e,t,r)=>n=>{if(typeof n!="string")return n;let[i,s,o,a]=n.match(Vt);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var Wc=e=>Z(0,255,e),Pi={...Ce,transform:e=>Math.round(Wc(e))},Ve={test:Et("rgb","red"),parse:Qr("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Pi.transform(e)+", "+Pi.transform(t)+", "+Pi.transform(r)+", "+Ue(Ie.transform(n))+")"};function Uc(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var cr={test:Et("#"),parse:Uc,transform:Ve.transform};var ur=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),he=ur("deg"),ie=ur("%"),S=ur("px"),Ai=ur("vh"),Mi=ur("vw"),en={...ie,parse:e=>ie.parse(e)/100,transform:e=>ie.transform(e*100)};var He={test:Et("hsl","hue"),parse:Qr("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+ie.transform(Ue(t))+", "+ie.transform(Ue(r))+", "+Ue(Ie.transform(n))+")"};var N={test:e=>Ve.test(e)||cr.test(e)||He.test(e),parse:e=>Ve.test(e)?Ve.parse(e):He.test(e)?He.parse(e):cr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ve.transform(e):He.transform(e),getAnimatableNone:e=>{let t=N.parse(e);return t.alpha=0,N.transform(t)}};var fs=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Hc(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Vt))==null?void 0:t.length)||0)+(((r=e.match(fs))==null?void 0:r.length)||0)>0}var ds="number",ps="color",Kc="var",_c="var(",ms="${}",$c=/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:[]},i=[],s=0,a=t.replace($c,l=>(N.test(l)?(n.color.push(s),i.push(ps),r.push(N.parse(l))):l.startsWith(_c)?(n.var.push(s),i.push(Kc),r.push(l)):(n.number.push(s),i.push(ds),r.push(parseFloat(l))),++s,ms)).split(ms);return{values:r,split:a,indexes:n,types:i}}function Yc(e){return Ke(e).values}function hs({split:e,types:t}){let r=e.length;return n=>{let i="";for(let s=0;s<r;s++)if(i+=e[s],n[s]!==void 0){let o=t[s];o===ds?i+=Ue(n[s]):o===ps?i+=N.transform(n[s]):i+=n[s]}return i}}function Xc(e){return hs(Ke(e))}var qc=e=>typeof e=="number"?0:N.test(e)?N.getAnimatableNone(e):e,Zc=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:qc(e);function Jc(e){let t=Ke(e);return hs(t)(t.values.map((n,i)=>Zc(n,t.split[i])))}var J={test:Hc,parse:Yc,createTransformer:Xc,getAnimatableNone:Jc};function Di(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 gs({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,s=0,o=0;if(!t)i=s=o=r;else{let a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;i=Di(l,a,e+1/3),s=Di(l,a,e),o=Di(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function Pt(e,t){return r=>r>0?t:e}var M=(e,t,r)=>e+(t-e)*r;var ki=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},Qc=[cr,Ve,He],eu=e=>Qc.find(t=>t.test(e));function xs(e){let t=eu(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=gs(r)),r}var Ri=(e,t)=>{let r=xs(e),n=xs(t);if(!r||!n)return Pt(e,t);let i={...r};return s=>(i.red=ki(r.red,n.red,s),i.green=ki(r.green,n.green,s),i.blue=ki(r.blue,n.blue,s),i.alpha=M(r.alpha,n.alpha,s),Ve.transform(i))};var tn=new Set(["none","hidden"]);function ys(e,t){return tn.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function tu(e,t){return r=>M(e,t,r)}function rn(e){return typeof e=="number"?tu:typeof e=="string"?Ct(e)?Pt:N.test(e)?Ri:iu:Array.isArray(e)?vs:typeof e=="object"?N.test(e)?Ri:ru:Pt}function vs(e,t){let r=[...e],n=r.length,i=e.map((s,o)=>rn(s)(s,t[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}}function ru(e,t){let r={...e,...t},n={};for(let i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=rn(e[i])(e[i],t[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}}function nu(e,t){var i;let r=[],n={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){let o=t.types[s],a=e.indexes[o][n[o]],l=(i=e.values[a])!=null?i:0;r[s]=l,n[o]++}return r}var iu=(e,t)=>{let r=J.createTransformer(t),n=Ke(e),i=Ke(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?tn.has(e)&&!i.values.length||tn.has(t)&&!n.values.length?ys(e,t):be(vs(nu(n,i),i.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"),Pt(e,t))};function nn(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?M(e,t,r):rn(e)(e,t)}var bs=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>E.update(t,r),stop:()=>ue(t),now:()=>H.isProcessing?H.timestamp:G.now()}};var on=(e,t,r=10)=>{let n="",i=Math.max(Math.round(t/r),2);for(let s=0;s<i;s++)n+=Math.round(e(s/(i-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 ws(e,t=100,r){let n=r({...e,keyframes:[0,t]}),i=Math.min(At(n),2e4);return{type:"keyframes",ease:s=>n.next(i*s).value/t,duration:te(i)}}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 Oi(e,t){return e*Math.sqrt(1-t*t)}var ou=12;function su(e,t,r){let n=r;for(let i=1;i<ou;i++)n=n-e(n)/t(n);return n}var Ii=.001;function au({duration:e=W.duration,bounce:t=W.bounce,velocity:r=W.velocity,mass:n=W.mass}){let i,s;Re(e<=K(W.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=Z(W.minDamping,W.maxDamping,o),e=Z(W.minDuration,W.maxDuration,te(e)),o<1?(i=u=>{let c=u*o,f=c*e,m=c-r,d=Oi(u,o),h=Math.exp(-f);return Ii-m/d*h},s=u=>{let f=u*o*e,m=f*r+r,d=Math.pow(o,2)*Math.pow(u,2)*e,h=Math.exp(-f),g=Oi(Math.pow(u,2),o);return(-i(u)+Ii>0?-1:1)*((m-d)*h)/g}):(i=u=>{let c=Math.exp(-u*e),f=(u-r)*e+1;return-Ii+c*f},s=u=>{let c=Math.exp(-u*e),f=(r-u)*(e*e);return c*f});let a=5/e,l=su(i,s,a);if(e=K(e),isNaN(l))return{stiffness:W.stiffness,damping:W.damping,duration:e};{let u=Math.pow(l,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:e}}}var lu=["duration","bounce"],cu=["stiffness","damping","mass"];function Ts(e,t){return t.some(r=>e[r]!==void 0)}function uu(e){let t={velocity:W.velocity,stiffness:W.stiffness,damping:W.damping,mass:W.mass,isResolvedFromDuration:!1,...e};if(!Ts(e,cu)&&Ts(e,lu))if(t.velocity=0,e.visualDuration){let r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,s=2*Z(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:W.mass,stiffness:i,damping:s}}else{let r=au({...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:i}=r,s=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:c,duration:f,velocity:m,isResolvedFromDuration:d}=uu({...r,velocity:-te(r.velocity||0)}),h=m||0,g=u/(2*Math.sqrt(l*c)),x=o-s,y=te(Math.sqrt(l/c)),b=Math.abs(x)<5;n||(n=b?W.restSpeed.granular:W.restSpeed.default),i||(i=b?W.restDelta.granular:W.restDelta.default);let w,v,T,P,A,C;if(g<1)T=Oi(y,g),P=(h+g*y*x)/T,w=V=>{let O=Math.exp(-g*y*V);return o-O*(P*Math.sin(T*V)+x*Math.cos(T*V))},A=g*y*P+x*T,C=g*y*x-P*T,v=V=>Math.exp(-g*y*V)*(A*Math.sin(T*V)+C*Math.cos(T*V));else if(g===1){w=O=>o-Math.exp(-y*O)*(x+(h+y*x)*O);let V=h+y*x;v=O=>Math.exp(-y*O)*(y*V*O-h)}else{let V=y*Math.sqrt(g*g-1);w=ee=>{let q=Math.exp(-g*y*ee),ae=Math.min(V*ee,300);return o-q*((h+g*y*x)*Math.sinh(ae)+V*x*Math.cosh(ae))/V};let O=(h+g*y*x)/V,Y=g*y*O-x*V,X=g*y*x-O*V;v=ee=>{let q=Math.exp(-g*y*ee),ae=Math.min(V*ee,300);return q*(Y*Math.sinh(ae)+X*Math.cosh(ae))}}let U={calculatedDuration:d&&f||null,velocity:V=>K(v(V)),next:V=>{if(!d&&g<1){let Y=Math.exp(-g*y*V),X=Math.sin(T*V),ee=Math.cos(T*V),q=o-Y*(P*X+x*ee),ae=K(Y*(A*X+C*ee));return a.done=Math.abs(ae)<=n&&Math.abs(o-q)<=i,a.value=a.done?o:q,a}let O=w(V);if(d)a.done=V>=f;else{let Y=K(v(V));a.done=Math.abs(Y)<=n&&Math.abs(o-O)<=i}return a.value=a.done?o:O,a},toString:()=>{let V=Math.min(At(U),2e4),O=on(Y=>U.next(V*Y).value,V,30);return V+"ms "+O},toTransition:()=>{}};return U}Mt.applyToOptions=e=>{let t=ws(e,100,Mt);return e.ease=t.ease,e.duration=K(t.duration),e.type="keyframes",e};var fu=5;function sn(e,t,r){let n=Math.max(t-fu,0);return Jt(r-e(n),t-n)}function fr({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){let f=e[0],m={done:!1,value:f},d=C=>a!==void 0&&C<a||l!==void 0&&C>l,h=C=>a===void 0?l:l===void 0||Math.abs(a-C)<Math.abs(l-C)?a:l,g=r*t,x=f+g,y=o===void 0?x:o(x);y!==x&&(g=y-f);let b=C=>-g*Math.exp(-C/n),w=C=>y+b(C),v=C=>{let U=b(C),V=w(C);m.done=Math.abs(U)<=u,m.value=m.done?y:V},T,P,A=C=>{d(m.value)&&(T=C,P=Mt({keyframes:[m.value,h(m.value)],velocity:sn(w,C,m.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return A(0),{calculatedDuration:null,next:C=>{let U=!1;return!P&&T===void 0&&(U=!0,v(C),A(C)),T!==void 0&&C>=T?P.next(C-T):(!U&&v(C),m)}}}function mu(e,t,r){let n=[],i=r||oe.mix||nn,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){let l=Array.isArray(t)?t[o]||z:t;a=be(l,a)}n.push(a)}return n}function Ss(e,t,{clamp:r=!0,ease:n,mixer:i}={}){let s=e.length;if(ce(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 o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=mu(t,n,i),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(c<e[f+1]);f++);let m=Se(e[f],e[f+1],c);return a[f](m)};return r?c=>u(Z(e[0],e[s-1],c)):u}function Cs(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let i=Se(0,t,n);e.push(M(r,1,i))}}function Vs(e){let t=[0];return Cs(t,e.length-1),t}function Es(e,t){return e.map(r=>r*t)}function du(e,t){return e.map(()=>t||ir).splice(0,e.length-1)}function it({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let i=Vi(n)?n.map(Xr):Xr(n),s={done:!1,value:t[0]},o=Es(r&&r.length===t.length?r:Vs(t),e),a=Ss(o,t,{ease:Array.isArray(i)?i:du(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}var pu=e=>e!==null;function _e(e,{repeat:t,repeatType:r="loop"},n,i=1){let s=e.filter(pu),a=i<0||t&&r!=="loop"&&t%2===1?0:s.length-1;return!a||n===void 0?s[a]:n}var hu={decay:fr,inertia:fr,tween:it,keyframes:it,spring:Mt};function an(e){typeof e.type=="string"&&(e.type=hu[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 gu=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,i;let{motionValue:r}=this.options;r&&r.updatedAt!==G.now()&&this.tick(G.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;an(t);let{type:r=it,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t,{keyframes:a}=t,l=r||it;l!==it&&typeof a[0]!="number"&&(this.mixKeyframes=be(gu,nn(a[0],a[1])),a=[0,100]);let u=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=At(u));let{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,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:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return n.next(0);let{delay:u=0,keyframes:c,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-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,v=n;if(f){let C=Math.min(this.currentTime,i)/a,U=Math.floor(C),V=C%1;!V&&C>=1&&(V=1),V===1&&U--,U=Math.min(U,f+1),!!(U%2)&&(m==="reverse"?(V=1-V,d&&(V-=d/a)):m==="mirror"&&(v=o)),w=Z(0,1,V)*a}let T;b?(this.delayState.value=c[0],T=this.delayState):T=v.next(w),s&&!b&&(T.value=s(T.value));let{done:P}=T;!b&&l!==null&&(P=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return A&&h!==fr&&(T.value=_e(c,this.options,x,this.speed)),g&&g(T.value),A&&this.finish(),T}then(t,r){return this.finished.then(t,r)}get duration(){return te(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+te(t)}get time(){return te(this.currentTime)}set time(t){t=K(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),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 sn(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=te(this.currentTime))}play(){var i,s;if(this.isStopped)return;let{driver:t=bs,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);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 Ps(e){var t;for(let r=1;r<e.length;r++)(t=e[r])!=null||(e[r]=e[r-1])}var ot=e=>e*180/Math.PI,Bi=e=>{let t=ot(Math.atan2(e[1],e[0]));return Ni(t)},xu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Bi,rotateZ:Bi,skewX:e=>ot(Math.atan(e[1])),skewY:e=>ot(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ni=e=>(e=e%360,e<0&&(e+=360),e),As=Bi,Ms=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ds=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),yu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ms,scaleY:Ds,scale:e=>(Ms(e)+Ds(e))/2,rotateX:e=>Ni(ot(Math.atan2(e[6],e[5]))),rotateY:e=>Ni(ot(Math.atan2(-e[2],e[0]))),rotateZ:As,rotate:As,skewX:e=>ot(Math.atan(e[4])),skewY:e=>ot(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ln(e){return e.includes("scale")?1:0}function cn(e,t){if(!e||e==="none")return ln(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),n,i;if(r)n=yu,i=r;else{let a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=xu,i=a}if(!i)return ln(t);let s=n[t],o=i[1].split(",").map(vu);return typeof s=="function"?s(o):o[s]}var ks=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return cn(r,t)};function vu(e){return parseFloat(e.trim())}var Ee=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ge=new Set([...Ee,"pathRotation"]);var Fi=e=>e===Ce||e===S,bu=new Set(["x","y","z"]),wu=Ee.filter(e=>!bu.has(e));function Rs(e){let t=[];return wu.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 i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(r)},height:({y:e},{paddingTop:t="0",paddingBottom:r="0",boxSizing:n})=>{let i=e.max-e.min;return n==="border-box"?i:i-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})=>cn(t,"x"),y:(e,{transform:t})=>cn(t,"y")};Be.translateX=Be.x;Be.translateY=Be.y;var st=new Set,ji=!1,zi=!1,Gi=!1;function Ls(){if(zi){let e=Array.from(st).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{let i=Rs(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();let i=r.get(n);i&&i.forEach(([s,o])=>{var a;(a=n.getValue(s))==null||a.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}zi=!1,ji=!1,st.forEach(e=>e.complete(Gi)),st.clear()}function Is(){st.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zi=!0)})}function Os(){Gi=!0,Is(),Ls(),Gi=!1}var Ye=class{constructor(t,r,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(st.add(this),ji||(ji=!0,E.read(Is),E.resolveKeyframes(Ls))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){let s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(n&&r){let a=n.readValue(r,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}Ps(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 Bs=e=>e.startsWith("--");function un(e,t,r){Bs(t)?e.style.setProperty(t,r):e.style[t]=r}var Ns={};function fn(e,t){let r=Zt(e);return()=>{var n;return(n=Ns[t])!=null?n:r()}}var Fs=fn(()=>window.ScrollTimeline!==void 0,"scrollTimeline");var mn=fn(()=>{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 Wi={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 Ui(e,t){if(e)return typeof e=="function"?mn()?on(e,t):"ease-out":or(e)?at(e):Array.isArray(e)?e.map(r=>Ui(r,t)||Wi.easeOut):Wi[e]}function js(e,t,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){let c={[t]:r};l&&(c.offset=l);let f=Ui(a,i);Array.isArray(f)&&(c.easing=f);let m={delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(m.pseudoElement=u),e.animate(c,m)}function dn(e){return typeof e=="function"&&"applyToOptions"in e}function zs({type:e,...t}){var r,n;return dn(e)&&mn()?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:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,ce(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let u=zs(t);this.animation=js(r,n,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let c=_e(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(c),un(r,n,c),this.animation.cancel()}l==null||l(),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,i;let t=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.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 te(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+te(t)}get time(){return te(Number(this.animation.currentTime)||0)}set time(t){let r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=K(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:i}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Fs()?(this.animation.timeline=t,r&&(this.animation.rangeStart=r),n&&(this.animation.rangeEnd=n),z):i(this)}};var Gs={anticipate:er,backInOut:Qt,circInOut:nr};function Tu(e){return e in Gs}function Ws(e){typeof e.ease=="string"&&Tu(e.ease)&&(e.ease=Gs[e.ease])}var Hi=10,pn=class extends Dt{constructor(t){Ws(t),an(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:i,element:s,...o}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let a=new Oe({...o,autoplay:!1}),l=Math.max(Hi,G.now()-this.startTime),u=Z(0,Hi,l-Hi),c=a.sample(l).value,{name:f}=this.options;s&&f&&un(s,f,c),r.setWithVelocity(a.sample(Math.max(0,l-u)).value,c,u),a.stop()}};var Ki=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(J.test(e)||e==="0")&&!e.startsWith("url("));function Su(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 Us(e,t,r,n){let i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;let s=e[e.length-1],o=Ki(i,t),a=Ki(s,t);return Re(o===a,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Su(e)||(r==="spring"||dn(r))&&n}function mr(e){e.duration=0,e.type="keyframes"}var hn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);var Cu=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Hs(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Cu.test(e[t]))return!0;return!1}var Vu=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Eu=Zt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Ks(e){var f;let{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:s,type:o,keyframes:a}=e,l=(f=t==null?void 0:t.owner)==null?void 0:f.current;if(!(l instanceof HTMLElement)&&!(l instanceof SVGElement))return!1;let{onUpdate:u,transformTemplate:c}=t.owner.getProps();return Eu()&&r&&(hn.has(r)||Vu.has(r)&&Hs(a))&&(r!=="transform"||!c)&&!u&&!n&&i!=="mirror"&&s!==0&&o!=="inertia"}var Pu=40,gn=class extends $e{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:c,...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:i,repeatDelay:s,repeatType:o,name:l,motionValue:u,element:c,...f},d=(c==null?void 0:c.KeyframeResolver)||Ye;this.keyframeResolver=new d(a,(g,x,y)=>this.onKeyframesResolved(g,x,m,!y),l,u,c),(h=this.keyframeResolver)==null||h.scheduleResolve()}onKeyframesResolved(t,r,n,i){var y,b;this.keyframeResolver=void 0;let{name:s,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=n;this.resolvedAt=G.now();let f=!0;Us(t,s,o,a)||(f=!1,(oe.instantAnimations||!l)&&(c==null||c(_e(t,n,r))),t[0]=t[t.length-1],mr(n),n.repeat=0);let d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Pu?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},h=f&&!u&&Ks(d),g=(b=(y=d.motionValue)==null?void 0:y.owner)==null?void 0:b.current,x;if(h)try{x=new pn({...d,element:g})}catch(w){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(),Os()),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 xn(e,t,r,n=0,i=1){let s=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),o=e.size,a=(o-1)*n;return typeof r=="function"?r(s,o):i===1?s*n:a-s*n}var _s=30,Au=e=>!isNaN(parseFloat(e)),$s={current:void 0},_i=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var s;let i=G.now();if(this.updatedAt!==i&&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 o of this.dependents)o.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=Au(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(),E.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 $s.current&&$s.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=G.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>_s)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,_s);return Jt(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 we(e,t){return new _i(e,t)}function yn(e,t){if(e!=null&&e.inherit&&t){let{inherit:r,...n}=e;return{...t,...n}}return e}function kt(e,t){var n,i;let r=(i=(n=e==null?void 0:e[t])!=null?n:e==null?void 0:e.default)!=null?i:e;return r!==e?yn(r,e):r}var Mu={type:"spring",stiffness:500,damping:25,restSpeed:10},Du=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ku={type:"keyframes",duration:.8},Ru={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ys=(e,{keyframes:t})=>t.length>2?ku:ge.has(e)?e.startsWith("scale")?Du(t[1]):Mu:Ru;var Lu=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Xs(e){for(let t in e)if(!Lu.has(t))return!0;return!1}var lt=(e,t,r,n={},i,s)=>o=>{let a=kt(n,e)||{},l=a.delay||n.delay||0,{elapsed:u=0}=n;u=u-K(l);let c={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:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};Xs(a)||Object.assign(c,Ys(e,c)),c.duration&&(c.duration=K(c.duration)),c.repeatDelay&&(c.repeatDelay=K(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(mr(c),c.delay===0&&(f=!0)),(oe.instantAnimations||oe.skipAnimations||i!=null&&i.shouldSkipAnimations||a.skipAnimations)&&(f=!0,mr(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){let m=_e(c.keyframes,a);if(m!==void 0){E.update(()=>{c.onUpdate(m),c.onComplete()});return}}return a.isSync?new Oe(c):new gn(c)};var Iu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ou(e){let t=Iu.exec(e);if(!t)return[,];let[,r,n,i]=t;return[`--${r!=null?r:n}`,i]}var Bu=4;function $i(e,t,r=1){ce(r<=Bu,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,i]=Ou(e);if(!n)return;let s=window.getComputedStyle(t).getPropertyValue(n);if(s){let o=s.trim();return Yt(o)?parseFloat(o):o}return Ct(i)?$i(i,t,r+1):i}function qs(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[i,s]=qs(n);t=t(r!==void 0?r:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[i,s]=qs(n);t=t(r!==void 0?r:e.custom,i,s)}return t}function me(e,t,r){let n=e.getProps();return ct(n,t,r!==void 0?r:n.custom,e)}var vn=new Set(["width","height","top","left","right","bottom",...Ee]);var dr=e=>Array.isArray(e);function Nu(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,we(r))}function Fu(e){return dr(e)?e[e.length-1]||0:e}function Zs(e,t){let r=me(e,t),{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(let o in s){let a=Fu(s[o]);Nu(e,o,a)}}var I=e=>!!(e&&e.getVelocity);function Js(e){return!!(I(e)&&e.add)}function Rt(e,t){let r=e.getValue("willChange");if(Js(r))return r.add(t);if(!r&&oe.WillChange){let n=new oe.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function Lt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Qs="framerAppearId",pr="data-"+Lt(Qs);function bn(e){return e.props[pr]}function ju({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function wn(e,t,{delay:r=0,transitionOverride:n,type:i}={}){var h;let{transition:s,transitionEnd:o,...a}=t,l=e.getDefaultTransition();s=s?yn(s,l):l;let u=s==null?void 0:s.reduceMotion,c=s==null?void 0:s.skipAnimations;n&&(s=n);let f=[],m=i&&e.animationState&&e.animationState.getState()[i],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),y=a[g];if(y===void 0||m&&ju(m,g))continue;let b={delay:r,...kt(s||{},g)};c&&(b.skipAnimations=!0);let w=x.get();if(w!==void 0&&!x.isAnimating()&&!Array.isArray(y)&&y===w&&!b.velocity){E.update(()=>x.set(y));continue}let v=!1;if(window.MotionHandoffAnimation){let A=bn(e);if(A){let C=window.MotionHandoffAnimation(A,g,E);C!==null&&(b.startTime=C,v=!0)}}Rt(e,g);let T=u!=null?u:e.shouldReduceMotion;x.start(lt(g,x,y,T&&vn.has(g)?{type:!1}:b,e,v));let P=x.animation;P&&f.push(P)}if(o){let g=()=>E.update(()=>{o&&Zs(e,o)});f.length?Promise.all(f).then(g):g()}return f}function Tn(e,t,r={}){var l;let n=me(e,t,r.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let s=n?()=>Promise.all(wn(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:c=0,staggerChildren:f,staggerDirection:m}=i;return zu(e,t,u,c,f,m,r)}:()=>Promise.resolve(),{when:a}=i;if(a){let[u,c]=a==="beforeChildren"?[s,o]:[o,s];return u().then(()=>c())}else return Promise.all([s(),o(r.delay)])}function zu(e,t,r=0,n=0,i=0,s=1,o){let a=[];for(let l of e.variantChildren)l.notify("AnimationStart",t),a.push(Tn(l,t,{...o,delay:r+(typeof n=="function"?0:n)+xn(e.variantChildren,l,n,i,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function ea(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){let i=t.map(s=>Tn(e,s,r));n=Promise.all(i)}else if(typeof t=="string")n=Tn(e,t,r);else{let i=typeof t=="function"?me(e,t,r.custom):t;n=Promise.all(wn(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}var ta={test:e=>e==="auto",parse:e=>e};var Sn=e=>t=>t.test(e);var Yi=[Ce,S,ie,he,Mi,Ai,ta],Xi=e=>Yi.find(Sn(e));function ra(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||qt(e):!0}var Gu=new Set(["brightness","contrast","saturate","opacity"]);function Wu(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(Vt)||[];if(!n)return e;let i=r.replace(n,""),s=Gu.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}var Uu=/\b([a-z-]*)\(.*?\)/gu,hr={...J,getAnimatableNone:e=>{let t=e.match(Uu);return t?t.map(Wu).join(" "):e}};var gr={...J,getAnimatableNone:e=>{let t=J.parse(e);return J.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}};var qi={...Ce,transform:Math.round};var na={rotate:he,pathRotation:he,rotateX:he,rotateY:he,rotateZ:he,scale:lr,scaleX:lr,scaleY:lr,scaleZ:lr,skew:he,skewX:he,skewY:he,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:Ie,originX:en,originY:en,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,...na,zIndex:qi,fillOpacity:Ie,strokeOpacity:Ie,numOctaves:qi};var Hu={...ut,color:N,backgroundColor:N,outlineColor:N,fill:N,stroke:N,borderColor:N,borderTopColor:N,borderRightColor:N,borderBottomColor:N,borderLeftColor:N,filter:hr,WebkitFilter:hr,mask:gr,WebkitMask:gr},Cn=e=>Hu[e];var Ku=new Set([hr,gr]);function Vn(e,t){let r=Cn(e);return Ku.has(r)||(r=J),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var _u=new Set(["auto","none","0"]);function ia(e,t,r){let n=0,i;for(;n<e.length&&!i;){let s=e[n];typeof s=="string"&&!_u.has(s)&&Ke(s).values.length&&(i=e[n]),n++}if(i&&r)for(let s of t)e[s]=Vn(r,i)}var En=class extends Ye{constructor(t,r,n,i,s){super(t,r,n,i,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let f=t[c];if(typeof f=="string"&&(f=f.trim(),Ct(f))){let m=$i(f,r.current);m!==void 0&&(t[c]=m),c===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!vn.has(n)||t.length!==2)return;let[i,s]=t,o=Xi(i),a=Xi(s),l=Ei(i),u=Ei(s);if(l!==u&&Be[n]){this.needsMeasurement=!0;return}if(o!==a)if(Fi(o)&&Fi(a))for(let c=0;c<t.length;c++){let f=t[c];typeof f=="string"&&(t[c]=parseFloat(f))}else Be[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||ra(t[i]))&&n.push(i);n.length&&ia(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 i=r[r.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var a;let{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;let i=t.getValue(r);i&&i.jump(this.measuredOrigin,!1);let s=n.length-1,o=n[s];n[s]=Be[r](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var xr=["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 i=document;t&&(i=t.current);let s=(n=r==null?void 0:r[e])!=null?n:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(i=>i!=null)}var yr=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function oa(e){return Xt(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var{schedule:ft,cancel:$u}=qr(queueMicrotask,!1);var xe={x:!1,y:!1};function An(){return xe.x||xe.y}function Zi(e){return e==="x"||e==="y"?xe[e]?null:(xe[e]=!0,()=>{xe[e]=!1}):xe.x||xe.y?null:(xe.x=xe.y=!0,()=>{xe.x=xe.y=!1})}function Mn(e,t){let r=Pn(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function Yu(e){return!(e.pointerType==="touch"||An())}function Ji(e,t,r={}){let[n,i,s]=Mn(e,r);return n.forEach(o=>{let a=!1,l=!1,u,c=()=>{o.removeEventListener("pointerleave",h)},f=x=>{u&&(u(x),u=void 0),c()},m=x=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),l&&(l=!1,f(x))},d=()=>{a=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},h=x=>{if(x.pointerType!=="touch"){if(a){l=!0;return}f(x)}},g=x=>{if(!Yu(x))return;l=!1;let y=t(o,x);typeof y=="function"&&(u=y,o.addEventListener("pointerleave",h,i))};o.addEventListener("pointerenter",g,i),o.addEventListener("pointerdown",d,i)}),s}var Qi=(e,t)=>t?e===t?!0:Qi(e,t.parentElement):!1;var mt=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var Xu=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function eo(e){return Xu.has(e.tagName)||e.isContentEditable===!0}var qu=new Set(["INPUT","SELECT","TEXTAREA"]);function to(e){return qu.has(e.tagName)||e.isContentEditable===!0}var It=new WeakSet;function sa(e){return t=>{t.key==="Enter"&&e(t)}}function ro(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var aa=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=sa(()=>{if(It.has(r))return;ro(r,"down");let i=sa(()=>{ro(r,"up")}),s=()=>ro(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",s,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function la(e){return mt(e)&&!An()}var ca=new WeakSet;function no(e,t,r={}){let[n,i,s]=Mn(e,r),o=a=>{let l=a.currentTarget;if(!la(a)||ca.has(a))return;It.add(l),r.stopPropagation&&ca.add(a);let u=t(l,a),c={...i,capture:!0},f=(h,g)=>{window.removeEventListener("pointerup",m,c),window.removeEventListener("pointercancel",d,c),It.has(l)&&It.delete(l),la(h)&&typeof u=="function"&&u(h,{success:g})},m=h=>{f(h,l===window||l===document||r.useGlobalTarget||Qi(l,h.target))},d=h=>{f(h,!1)};window.addEventListener("pointerup",m,c),window.addEventListener("pointercancel",d,c)};return n.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),oa(a)&&(a.addEventListener("focus",u=>aa(u,i)),!eo(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Ot(e){return Xt(e)&&"ownerSVGElement"in e}var Dn=new WeakMap,Xe,ua=(e,t,r)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:Ot(n)&&"getBBox"in n?n.getBBox()[t]:n[r],Zu=ua("inline","width","offsetWidth"),Ju=ua("block","height","offsetHeight");function Qu({target:e,borderBoxSize:t}){var r;(r=Dn.get(e))==null||r.forEach(n=>{n(e,{get width(){return Zu(e,t)},get height(){return Ju(e,t)}})})}function ef(e){e.forEach(Qu)}function tf(){typeof ResizeObserver!="undefined"&&(Xe=new ResizeObserver(ef))}function fa(e,t){Xe||tf();let r=Pn(e);return r.forEach(n=>{let i=Dn.get(n);i||(i=new Set,Dn.set(n,i)),i.add(t),Xe==null||Xe.observe(n)}),()=>{r.forEach(n=>{let i=Dn.get(n);i==null||i.delete(t),i!=null&&i.size||Xe==null||Xe.unobserve(n)})}}var kn=new Set,Bt;function rf(){Bt=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};kn.forEach(t=>t(e))},window.addEventListener("resize",Bt)}function ma(e){return kn.add(e),Bt||rf(),()=>{kn.delete(e),!kn.size&&typeof Bt=="function"&&(window.removeEventListener("resize",Bt),Bt=void 0)}}function Rn(e,t){return typeof e=="function"?ma(e):fa(e,t)}var dt={value:null,addProjectionMetrics:null};function da(e){return Ot(e)&&e.tagName==="svg"}var nf=[...Yi,N,J],pa=e=>nf.find(Sn(e));var io=()=>({translate:0,scale:1,origin:0,originPoint:0}),qe=()=>({x:io(),y:io()}),oo=()=>({min:0,max:0}),F=()=>({x:oo(),y:oo()});var ha=new WeakMap;function Ne(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Pe(e){return typeof e=="string"||Array.isArray(e)}var Ln=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],vr=["initial",...Ln];function Ze(e){return Ne(e.animate)||vr.some(t=>Pe(e[t]))}function br(e){return!!(Ze(e)||e.variants)}function ga(e,t,r){for(let n in t){let i=t[n],s=r[n];if(I(i))e.addValue(n,i);else if(I(s))e.addValue(n,we(i,{owner:e}));else if(s!==i)if(e.hasValue(n)){let o=e.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{let o=e.getStaticValue(n);e.addValue(n,we(o!==void 0?o:i,{owner:e}))}}for(let n in r)t[n]===void 0&&e.removeValue(n);return t}var wr={current:null},In={current:!1};var of=typeof window!="undefined";function xa(){if(In.current=!0,!!of)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wr.current=e.matches;e.addEventListener("change",t),t()}else wr.current=!1}var ya=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],On={};function Sr(e){On=e}function so(){return On}var Tr=class{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:a},l={}){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,E.render(this.render,!1,!0))};let{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=r.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=Ze(r),this.isVariantNode=br(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,i;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,ha.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,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(In.current||xa(),this.shouldReduceMotion=wr.current),this.shouldSkipAnimations=(n=this.skipAnimationsConfig)!=null?n:!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),ue(this.notifyUpdate),ue(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&&hn.has(t)&&this.current instanceof HTMLElement){let{factory:o,keyframes:a,times:l,ease:u,duration:c}=r.accelerate,f=new Dt({element:this.current,name:t,keyframes:a,times:l,ease:u,duration:K(c)}),m=o(f);this.valueSubscriptions.set(t,()=>{m(),f.cancel()});return}let n=ge.has(t);n&&this.onBindTransform&&this.onBindTransform();let i=r.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&E.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,()=>{i(),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 On){let r=On[t];if(!r)continue;let{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(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<ya.length;n++){let i=ya[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=ga(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=we(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){var i;let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!=null?i:this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(Yt(n)||qt(n))?n=parseFloat(n):!pa(n)&&J.test(r)&&(n=Vn(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 o=ct(this.props,r,(s=this.presenceContext)==null?void 0:s.custom);o&&(n=o[t])}if(r&&n!==void 0)return n;let i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!I(i)?i: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 Nt=class extends Tr{constructor(){super(...arguments),this.KeyframeResolver=En}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 Cr({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function ao({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function lo(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 co(e){return e===void 0||e===1}function Bn({scale:e,scaleX:t,scaleY:r}){return!co(e)||!co(t)||!co(r)}function Fe(e){return Bn(e)||uo(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function uo(e){return va(e.x)||va(e.y)}function va(e){return e&&e!=="0%"}function Vr(e,t,r){let n=e-r,i=t*n;return r+i}function ba(e,t,r,n,i){return i!==void 0&&(e=Vr(e,i,n)),Vr(e,r,n)+t}function fo(e,t=0,r=1,n,i){e.min=ba(e.min,t,r,n,i),e.max=ba(e.max,t,r,n,i)}function mo(e,{x:t,y:r}){fo(e.x,t.translate,t.scale,t.originPoint),fo(e.y,r.translate,r.scale,r.originPoint)}var wa=.999999999999,Ta=1.0000000000001;function Va(e,t,r,n=!1){var a;let i=r.length;if(!i)return;t.x=t.y=1;let s,o;for(let l=0;l<i;l++){s=r[l],o=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&&(ye(e.x,-s.scroll.offset.x),ye(e.y,-s.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,mo(e,o)),n&&Fe(s.latestValues)&&Er(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<Ta&&t.x>wa&&(t.x=1),t.y<Ta&&t.y>wa&&(t.y=1)}function ye(e,t){e.min+=t,e.max+=t}function Sa(e,t,r,n,i=.5){let s=M(e.min,e.max,i);fo(e,t,r,s,n)}function Ca(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Er(e,t,r){let n=r!=null?r:e;Sa(e.x,Ca(t.x,n.x),t.scaleX,t.scale,t.originX),Sa(e.y,Ca(t.y,n.y),t.scaleY,t.scale,t.originY)}function Nn(e,t){return Cr(lo(e.getBoundingClientRect(),t))}function po(e,t,r){let n=Nn(e,r),{scroll:i}=t;return i&&(ye(n.x,i.offset.x),ye(n.y,i.offset.y)),n}var sf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},af=Ee.length;function Ea(e,t,r){let n="",i=!0;for(let o=0;o<af;o++){let a=Ee[o],l=e[a];if(l===void 0)continue;let u=!0;if(typeof l=="number")u=l===(a.startsWith("scale")?1:0);else{let c=parseFloat(l);u=a.startsWith("scale")?c===1:c===0}if(!u||r){let c=yr(l,ut[a]);if(!u){i=!1;let f=sf[a]||a;n+=`${f}(${c}) `}r&&(t[a]=c)}}let s=e.pathRotation;return s&&(i=!1,n+=`rotate(${yr(s,ut.pathRotation)}) `),n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}function pt(e,t,r){let{style:n,vars:i,transformOrigin:s}=e,o=!1,a=!1;for(let l in t){let u=t[l];if(ge.has(l)){o=!0;continue}else if(Jr(l)){i[l]=u;continue}else{let c=yr(u,ut[l]);l.startsWith("origin")?(a=!0,s[l]=c):n[l]=c}}if(t.transform||(o||r?n.transform=Ea(t,e.transform,r):n.transform&&(n.transform="none")),a){let{originX:l="50%",originY:u="50%",originZ:c=0}=s;n.transformOrigin=`${l} ${u} ${c}`}}function Fn(e,{style:t,vars:r},n,i){let s=e.style,o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,n);for(o in r)s.setProperty(o,r[o])}function Pa(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ft={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(S.test(e))e=parseFloat(e);else return e;let r=Pa(e,t.target.x),n=Pa(e,t.target.y);return`${r}% ${n}%`}};var Aa={correct:(e,{treeScale:t,projectionDelta:r})=>{let n=e,i=J.parse(e);if(i.length>5)return n;let s=J.createTransformer(e),o=typeof i[0]!="number"?1:0,a=r.x.scale*t.x,l=r.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;let u=M(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};var Pr={borderRadius:{...Ft,applyTo:[...xr]},borderTopLeftRadius:Ft,borderTopRightRadius:Ft,borderBottomLeftRadius:Ft,borderBottomRightRadius:Ft,boxShadow:Aa};function Ar(e,{layout:t,layoutId:r}){return ge.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Pr[e]||e==="opacity")}function ht(e,t,r){var o;let n=e.style,i=t==null?void 0:t.style,s={};if(!n)return s;for(let a in n)(I(n[a])||i&&I(i[a])||Ar(a,e)||((o=r==null?void 0:r.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(s[a]=n[a]);return s}function lf(e){return window.getComputedStyle(e)}var Mr=class extends Nt{constructor(){super(...arguments),this.type="html",this.renderInstance=Fn}mount(t){ce(!!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(ge.has(r))return(n=this.projection)!=null&&n.isProjecting?ln(r):ks(t,r);{let i=lf(t),s=(Jr(r)?i.getPropertyValue(r):i[r])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:r}){return Nn(t,r)}build(t,r,n){pt(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return ht(t,r,n)}};var cf={offset:"stroke-dashoffset",array:"stroke-dasharray"},uf={offset:"strokeDashoffset",array:"strokeDasharray"};function Ma(e,t,r=1,n=0,i=!0){e.pathLength=1;let s=i?cf:uf;e[s.offset]=`${-n}`,e[s.array]=`${t} ${r}`}var ff=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Dr(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},l,u,c){var d,h;if(pt(e,a,u),l){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=c==null?void 0:c.transformBox)!=null?h:"fill-box",delete f.transformBox);for(let g of ff)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),i!==void 0&&Ma(f,i,s,o,!1)}var jn=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 kr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Da(e,t,r,n){Fn(e,t,void 0,n);for(let i in t.attrs)e.setAttribute(jn.has(i)?i:Lt(i),t.attrs[i])}function Rr(e,t,r){let n=ht(e,t,r);for(let i in e)if(I(e[i])||I(t[i])){let s=Ee.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}var Lr=class extends Nt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=F}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(ge.has(r)){let n=Cn(r);return n&&n.default||0}return r=jn.has(r)?r:Lt(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return Rr(t,r,n)}build(t,r,n){Dr(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,i){Da(t,r,n,i)}mount(t){this.isSVGTag=kr(t.tagName),super.mount(t)}};var mf=vr.length;function ho(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?ho(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<mf;r++){let n=vr[r],i=e.props[n];(Pe(i)||i===!1)&&(t[n]=i)}return t}function go(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 df=[...Ln].reverse(),pf=Ln.length;function hf(e){return t=>Promise.all(t.map(({animation:r,options:n})=>ea(e,r,n)))}function xo(e){let t=hf(e),r=ka(),n=!0,i=!1,s=u=>(c,f)=>{var d;let m=me(e,f,u==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);if(m){let{transition:h,transitionEnd:g,...x}=m;c={...c,...x,...g}}return c};function o(u){t=u(e)}function a(u){let{props:c}=e,f=ho(e.parent)||{},m=[],d=new Set,h={},g=1/0;for(let y=0;y<pf;y++){let b=df[y],w=r[b],v=c[b]!==void 0?c[b]:f[b],T=Pe(v),P=b===u?w.isActive:null;P===!1&&(g=y);let A=v===f[b]&&v!==c[b]&&T;if(A&&(n||i)&&e.manuallyAnimateOnMount&&(A=!1),w.protectedKeys={...h},!w.isActive&&P===null||!v&&!w.prevProp||Ne(v)||typeof v=="boolean")continue;if(b==="exit"&&w.isActive&&P!==!0){w.prevResolvedValues&&(h={...h,...w.prevResolvedValues});continue}let C=Ra(w.prevProp,v),U=C||b===u&&w.isActive&&!A&&T||y>g&&T,V=!1,O=Array.isArray(v)?v:[v],Y=O.reduce(s(b),{});P===!1&&(Y={});let{prevResolvedValues:X={}}=w,ee={...X,...Y},q=k=>{U=!0,d.has(k)&&(V=!0,d.delete(k)),w.needsAnimating[k]=!0;let R=e.getValue(k);R&&(R.liveStyle=!1)};for(let k in ee){let R=Y[k],Te=X[k];if(h.hasOwnProperty(k))continue;let ke=!1;dr(R)&&dr(Te)?ke=!go(R,Te)||C:ke=R!==Te,ke?R!=null?q(k):d.add(k):R!==void 0&&d.has(k)?q(k):w.protectedKeys[k]=!0}w.prevProp=v,w.prevResolvedValues=Y,w.isActive&&(h={...h,...Y}),(n||i)&&e.blockInitialAnimation&&(U=!1);let ae=A&&C;U&&(!ae||V)&&m.push(...O.map(k=>{let R={type:b};if(typeof k=="string"&&(n||i)&&!ae&&e.manuallyAnimateOnMount&&e.parent){let{parent:Te}=e,ke=me(Te,k);if(Te.enteringChildren&&ke){let{delayChildren:vi}=ke.transition||{};R.delay=xn(Te.enteringChildren,e,vi)}}return{animation:k,options:R}}))}if(d.size){let y={};if(typeof c.initial!="boolean"){let b=me(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(y.transition=b.transition)}d.forEach(b=>{let w=e.getBaseTarget(b),v=e.getValue(b);v&&(v.liveStyle=!0),y[b]=w!=null?w:null}),m.push({animation:y})}let x=!!m.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),n=!1,i=!1,x?t(m):Promise.resolve()}function l(u,c){var m;if(r[u].isActive===c)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(d=>{var h;return(h=d.animationState)==null?void 0:h.setActive(u,c)}),r[u].isActive=c;let f=a(u);for(let d in r)r[d].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>r,reset:()=>{r=ka(),i=!0}}}function Ra(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!go(t,e):!1}function gt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ka(){return{animate:gt(!0),whileInView:gt(),whileHover:gt(),whileTap:gt(),whileDrag:gt(),whileFocus:gt(),exit:gt()}}function zn(e,t){e.min=t.min,e.max=t.max}function ve(e,t){zn(e.x,t.x),zn(e.y,t.y)}function yo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var La=1e-4,gf=1-La,xf=1+La,Ia=.01,yf=0-Ia,vf=0+Ia;function $(e){return e.max-e.min}function To(e,t,r){return Math.abs(e-t)<=r}function vo(e,t,r,n=.5){e.origin=n,e.originPoint=M(t.min,t.max,e.origin),e.scale=$(r)/$(t),e.translate=M(r.min,r.max,e.origin)-e.originPoint,(e.scale>=gf&&e.scale<=xf||isNaN(e.scale))&&(e.scale=1),(e.translate>=yf&&e.translate<=vf||isNaN(e.translate))&&(e.translate=0)}function xt(e,t,r,n){vo(e.x,t.x,r.x,n?n.originX:void 0),vo(e.y,t.y,r.y,n?n.originY:void 0)}function bo(e,t,r,n=0){let i=n?M(r.min,r.max,n):r.min;e.min=i+t.min,e.max=e.min+$(t)}function So(e,t,r,n){bo(e.x,t.x,r.x,n==null?void 0:n.x),bo(e.y,t.y,r.y,n==null?void 0:n.y)}function wo(e,t,r,n=0){let i=n?M(r.min,r.max,n):r.min;e.min=t.min-i,e.max=e.min+$(t)}function jt(e,t,r,n){wo(e.x,t.x,r.x,n==null?void 0:n.x),wo(e.y,t.y,r.y,n==null?void 0:n.y)}function Oa(e,t,r,n,i){return e-=t,e=Vr(e,1/r,n),i!==void 0&&(e=Vr(e,1/i,n)),e}function bf(e,t=0,r=1,n=.5,i,s=e,o=e){if(ie.test(t)&&(t=parseFloat(t),t=M(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=M(s.min,s.max,n);e===s&&(a-=t),e.min=Oa(e.min,t,r,a,i),e.max=Oa(e.max,t,r,a,i)}function Ba(e,t,[r,n,i],s,o){bf(e,t[r],t[n],t[i],t.scale,s,o)}var wf=["x","scaleX","originX"],Tf=["y","scaleY","originY"];function Co(e,t,r,n){Ba(e.x,t,wf,r?r.x:void 0,n?n.x:void 0),Ba(e.y,t,Tf,r?r.y:void 0,n?n.y:void 0)}function Na(e){return e.translate===0&&e.scale===1}function Vo(e){return Na(e.x)&&Na(e.y)}function Fa(e,t){return e.min===t.min&&e.max===t.max}function za(e,t){return Fa(e.x,t.x)&&Fa(e.y,t.y)}function ja(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Eo(e,t){return ja(e.x,t.x)&&ja(e.y,t.y)}function Po(e){return $(e.x)/$(e.y)}function Ao(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function de(e){return[e("x"),e("y")]}function Ga(e,t,r){let n="",i=e.x.translate/t.x,s=e.y.translate/t.y,o=(r==null?void 0:r.z)||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:c,pathRotation:f,rotateX:m,rotateY:d,skewX:h,skewY:g}=r;u&&(n=`perspective(${u}px) ${n}`),c&&(n+=`rotate(${c}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,l=e.y.scale*t.y;return(a!==1||l!==1)&&(n+=`scale(${a}, ${l})`),n||"none"}var Sf=xr.length,Wa=e=>typeof e=="string"?parseFloat(e):e,Ua=e=>typeof e=="number"||S.test(e);function Ka(e,t,r,n,i,s){var o,a,l,u;i?(e.opacity=M(0,(o=r.opacity)!=null?o:1,Cf(n)),e.opacityExit=M((a=t.opacity)!=null?a:1,0,Vf(n))):s&&(e.opacity=M((l=t.opacity)!=null?l:1,(u=r.opacity)!=null?u:1,n));for(let c=0;c<Sf;c++){let f=xr[c],m=Ha(t,f),d=Ha(r,f);if(m===void 0&&d===void 0)continue;m||(m=0),d||(d=0),m===0||d===0||Ua(m)===Ua(d)?(e[f]=Math.max(M(Wa(m),Wa(d),n),0),(ie.test(d)||ie.test(m))&&(e[f]+="%")):e[f]=d}(t.rotate||r.rotate)&&(e.rotate=M(t.rotate||0,r.rotate||0,n))}function Ha(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var Cf=_a(0,.5,rr),Vf=_a(.5,.95,z);function _a(e,t,r){return n=>n<e?0:n>t?1:r(Se(e,t,n))}function $a(e,t,r){let n=I(e)?e:we(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 Ya=(e,t)=>e.depth-t.depth;var Gn=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(Ya),this.isDirty=!1,this.children.forEach(t)}};function Xa(e,t){let r=G.now(),n=({timestamp:i})=>{let s=i-r;s>=t&&(ue(n),e(s-t))};return E.setup(n,!0),()=>ue(n)}function yt(e){return I(e)?e.get():e}var Wn=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 i=n.instance;(!i||i.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 i=this.members[n];if(i.isPresent!==!1&&((r=i.instance)==null?void 0:r.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,r){var i;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:o}=t.options;(s===void 0||s!==o)&&(t.resumeFrom=n,r&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var r,n,i,s,o;(n=(r=t.options).onExitComplete)==null||n.call(r),(o=(i=t.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||o.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},Mo=["","X","Y","Z"],Ef=1e3,Pf=0;function Do(e,t,r,n){let{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function il(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=bn(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",E,!(i||s))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&il(n)}function Un({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Pf++,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(Df),this.nodes.forEach(Bf),this.nodes.forEach(Nf),this.nodes.forEach(kf),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=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Gn)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Le),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){let l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Ot(o)&&!da(o),this.instance=o;let{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let c,f=0,m=()=>this.root.updateBlockedByResize=!1;E.read(()=>{f=window.innerWidth}),e(o,()=>{let d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,c&&c(),c=Xa(m,250),vt.hasAnimatedSinceResize&&(vt.hasAnimatedSinceResize=!1,this.nodes.forEach(Ja)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,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()||Wf,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=u.getProps(),y=!this.targetLayout||!Eo(this.targetLayout,d),b=!f&&m;if(this.options.layoutRoot||this.resumeFrom||b||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let w={...kt(h,"layout"),onPlay:g,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(c,b,w.path)}else f||Ja(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ue(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(Ff),this.animationId++)}getTransformTemplate(){let{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&il(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){let f=this.path[c];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:l}=this.options;if(a===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(Lf),this.nodes.forEach(qa);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Za);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(If),this.nodes.forEach(Of),this.nodes.forEach(Af),this.nodes.forEach(Mf)):this.nodes.forEach(Za),this.clearAllSnapshots();let a=G.now();H.delta=Z(0,1e3/60,a-H.timestamp),H.timestamp=a,H.isProcessing=!0,ar.update.process(H),ar.preRender.process(H),ar.render.process(H),H.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ft.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Rf),this.sharedNodes.forEach(jf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,E.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){E.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 l=0;l<this.path.length;l++)this.path[l].updateScroll();let o=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,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){let l=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;let o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Vo(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Fe(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){let a=this.measurePageBox(),l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Uf(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;let{visualElement:o}=this.options;if(!o)return F();let a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Hf))){let{scroll:c}=this.root;c&&(ye(a.x,c.offset.x),ye(a.y,c.offset.y))}return a}removeElementScroll(o){var l;let a=F();if(ve(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){let c=this.path[u],{scroll:f,options:m}=c;c!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&ve(a,o),ye(a.x,f.offset.x),ye(a.y,f.offset.y))}return a}applyTransform(o,a=!1,l){var c,f;let u=l||F();ve(u,o);for(let m=0;m<this.path.length;m++){let d=this.path[m];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(ye(u.x,-d.scroll.offset.x),ye(u.y,-d.scroll.offset.y)),Fe(d.latestValues)&&Er(u,d.latestValues,(c=d.layout)==null?void 0:c.layoutBox)}return Fe(this.latestValues)&&Er(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(o){var l;let a=F();ve(a,o);for(let u=0;u<this.path.length;u++){let c=this.path[u];if(!Fe(c.latestValues))continue;let f;c.instance&&(Bn(c.latestValues)&&c.updateSnapshot(),f=F(),ve(f,c.measurePageBox())),Co(a,c.latestValues,(l=c.snapshot)==null?void 0:l.layoutBox,f)}return Fe(this.latestValues)&&Co(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==H.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!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 l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:f}=this.options;if(!this.layout||!(c||f))return;this.resolvedRelativeTargetAt=H.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(),So(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ve(this.target,this.layout.layoutBox),mo(this.target,this.targetDelta)):ve(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||Bn(this.parent.latestValues)||uo(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),jt(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),ve(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var h;let o=this.getLead(),a=!!this.resumingFrom||this!==o,l=!0;if((this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===H.timestamp&&(l=!1),l)return;let{layout:u,layoutId:c}=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||c))return;ve(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;Va(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=F());let{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(yo(this.prevProjectionDelta.x,this.projectionDelta.x),yo(this.prevProjectionDelta.y,this.projectionDelta.y)),xt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ao(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ao(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(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qe(),this.projectionDelta=qe(),this.projectionDeltaWithTransform=qe()}setAnimationOrigin(o,a=!1,l){let u=this.snapshot,c=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,y=this.getStack(),b=!y||y.members.length<=1,w=!!(x&&!b&&this.options.crossfade===!0&&!this.path.some(Gf));this.animationProgress=0;let v,T=l==null?void 0:l.interpolateProjection(o);this.mixTargetDelta=P=>{let A=P/1e3,C=T==null?void 0:T(A);C?(m.x.translate=C.x,m.x.scale=M(o.x.scale,1,A),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=C.y,m.y.scale=M(o.y.scale,1,A),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(Qa(m.x,o.x,A),Qa(m.y,o.y,A)),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),zf(this.relativeTarget,this.relativeTargetOrigin,d,A),v&&za(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=F()),ve(v,this.relativeTarget)),x&&(this.animationValues=f,Ka(f,c,this.latestValues,A,w,b)),C&&C.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=C.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(ue(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=E.update(()=>{vt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=we(0)),this.motionValue.jump(0,!1),this.currentAnimation=$a(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),o.onUpdate&&o.onUpdate(c)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ef),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let o=this.getLead(),{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&ol(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||F();let f=$(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;let m=$(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+m}ve(a,l),Er(a,c),xt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Wn),this.sharedNodes.get(o).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 o=this.getStack();return o?o.lead===this:!0}getLead(){var a;let{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;let{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){let{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){let o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){let{visualElement:o}=this.options;if(!o)return;let a=!1,{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;let u={};l.z&&Do("z",o,u,this.animationValues);for(let c=0;c<Mo.length;c++)Do(`rotate${Mo[c]}`,o,u,this.animationValues),Do(`skew${Mo[c]}`,o,u,this.animationValues);o.render();for(let c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,a){var h,g;if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}let l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=yt(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}let u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=yt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Fe(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";let c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=Ga(this.projectionDeltaWithTransform,this.treeScale,c);l&&(f=l(c,f)),o.transform=f;let{x:m,y:d}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?(g=(h=c.opacity)!=null?h:this.latestValues.opacity)!=null?g:1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(let x in Pr){if(c[x]===void 0)continue;let{correct:y,applyTo:b,isCSSVariable:w}=Pr[x],v=f==="none"?c[x]:y(c[x],u);if(b){let T=b.length;for(let P=0;P<T;P++)o[b[P]]=v}else w?this.options.visualElement.renderState.vars[x]=v:o[x]=v}this.options.layoutId&&(o.pointerEvents=u===this?yt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(qa),this.root.sharedNodes.clear()}}}function Af(e){e.updateLayout()}function Mf(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:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;if(s==="size")de(f=>{let m=o?t.measuredBox[f]:t.layoutBox[f],d=$(m);m.min=n[f].min,m.max=m.min+d});else if(s==="x"||s==="y"){let f=s==="x"?"y":"x";zn(o?t.measuredBox[f]:t.layoutBox[f],n[f])}else ol(s,t.layoutBox,n)&&de(f=>{let m=o?t.measuredBox[f]:t.layoutBox[f],d=$(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 l=qe();o?xt(l,e.applyTransform(i,!0),t.measuredBox):xt(l,n,t.layoutBox);let u=!Vo(a),c=!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),Eo(g,x)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){let{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Df(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 kf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Rf(e){e.clearSnapshot()}function qa(e){e.clearMeasurements()}function Lf(e){e.isLayoutDirty=!0,e.updateLayout()}function Za(e){e.isLayoutDirty=!1}function If(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Of(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Ja(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Bf(e){e.resolveTargetDelta()}function Nf(e){e.calcProjection()}function Ff(e){e.resetSkewAndRotation()}function jf(e){e.removeLeadSnapshot()}function Qa(e,t,r){e.translate=M(t.translate,0,r),e.scale=M(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function el(e,t,r,n){e.min=M(t.min,r.min,n),e.max=M(t.max,r.max,n)}function zf(e,t,r,n){el(e.x,t.x,r.x,n),el(e.y,t.y,r.y,n)}function Gf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Wf={duration:.45,ease:[.4,0,.1,1]},tl=e=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),rl=tl("applewebkit/")&&!tl("chrome/")?Math.round:z;function nl(e){e.min=rl(e.min),e.max=rl(e.max)}function Uf(e){nl(e.x),nl(e.y)}function ol(e,t,r){return e==="position"||e==="preserve-aspect"&&!To(Po(t),Po(r),.2)}function Hf(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}var sl=Un({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 Hn={current:void 0},Ir=Un({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hn.current){let e=new sl({});e.mount(window),e.setOptions({layoutScroll:!0}),Hn.current=e}return Hn.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var al=require("react"),Kn=(0,al.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Je=require("react");function ll(e=!0){let t=(0,Je.useContext)(Tt);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:n,register:i}=t,s=(0,Je.useId)();(0,Je.useEffect)(()=>{if(e)return i(s)},[e]);let o=(0,Je.useCallback)(()=>e&&n&&n(s),[s,n,e]);return!r&&n?[!1,o]:[!0]}var cl=require("react"),_n=(0,cl.createContext)({strict:!1});var ul={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"]},fl=!1;function Kf(){if(fl)return;let e={};for(let t in ul)e[t]={isEnabled:r=>ul[t].some(n=>!!r[n])};Sr(e),fl=!0}function $n(){return Kf(),so()}function ml(e){let t=$n();for(let r in e)t[r]={...t[r],...e[r]};Sr(t)}var _f=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 Or(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||_f.has(e)}var dl=e=>!Or(e);function $f(e){typeof e=="function"&&(dl=t=>t.startsWith("on")?!Or(t):e(t))}try{$f(require("@emotion/is-prop-valid").default)}catch(e){}function pl(e,t,r){let n={};for(let i in e)i==="values"&&typeof e.values=="object"||I(e[i])||(dl(i)||r===!0&&Or(i)||!t&&!Or(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}var Jn=require("react/jsx-runtime");var Ut=require("react");var hl=require("react"),Qe=(0,hl.createContext)({});var Yn=require("react");function gl(e,t){if(Ze(e)){let{initial:r,animate:n}=e;return{initial:r===!1||Pe(r)?r:void 0,animate:Pe(n)?n:void 0}}return e.inherit!==!1?t:{}}function yl(e){let{initial:t,animate:r}=gl(e,(0,Yn.useContext)(Qe));return(0,Yn.useMemo)(()=>({initial:t,animate:r}),[xl(t),xl(r)])}function xl(e){return Array.isArray(e)?e.join(" "):e}var Wt=require("react");var vl=require("react");var zt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ko(e,t,r){for(let n in t)!I(t[n])&&!Ar(n,r)&&(e[n]=t[n])}function Yf({transformTemplate:e},t){return(0,vl.useMemo)(()=>{let r=zt();return pt(r,t,e),Object.assign({},r.vars,r.style)},[t])}function Xf(e,t){let r=e.style||{},n={};return ko(n,r,e),Object.assign(n,Yf(e,t)),n}function bl(e,t){let r={},n=Xf(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 wl=require("react");var Xn=()=>({...zt(),attrs:{}});function Tl(e,t,r,n){let i=(0,wl.useMemo)(()=>{let s=Xn();return Dr(s,t,kr(n),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let s={};ko(s,e.style,e),i.style={...s,...i.style}}return i}var Sl=["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:!!(Sl.indexOf(e)>-1||/[A-Z]/u.test(e))}function Cl(e,t,r,{latestValues:n},i,s=!1,o){let l=((o!=null?o:Gt(e))?Tl:bl)(t,n,i,e),u=pl(t,typeof e=="string",s),c=e!==Wt.Fragment?{...u,...l,ref:r}:{},{children:f}=t,m=(0,Wt.useMemo)(()=>I(f)?f.get():f,[f]);return(0,Wt.createElement)(e,{...c,children:m})}var Ro=require("react");function qf({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:Zf(r,n,i,e),renderState:t()}}function Zf(e,t,r,n){let i={},s=n(e,{});for(let m in s)i[m]=yt(s[m]);let{initial:o,animate:a}=e,l=Ze(e),u=br(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=r?r.initial===!1:!1;c=c||o===!1;let f=c?a:o;if(f&&typeof f!="boolean"&&!Ne(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,...y}=h;for(let b in y){let w=y[b];if(Array.isArray(w)){let v=c?w.length-1:0;w=w[v]}w!==null&&(i[b]=w)}for(let b in g)i[b]=g[b]}}}return i}var qn=e=>(t,r)=>{let n=(0,Ro.useContext)(Qe),i=(0,Ro.useContext)(Tt),s=()=>qf(e,t,n,i);return r?s():ts(s)};var Vl=qn({scrapeMotionValuesFromProps:ht,createRenderState:zt});var El=qn({scrapeMotionValuesFromProps:Rr,createRenderState:Xn});var Pl=Symbol.for("motionComponentSymbol");var wt=require("react");function Al(e,t,r){let n=(0,wt.useRef)(r);(0,wt.useInsertionEffect)(()=>{n.current=r});let i=(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 o=n.current;if(typeof o=="function")if(s){let l=o(s);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(s);else o&&(o.current=s)},[t])}var se=require("react");var Ml=require("react"),Zn=(0,Ml.createContext)({});function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Dl(e,t,r,n,i,s){var w,v;let{visualElement:o}=(0,se.useContext)(Qe),a=(0,se.useContext)(_n),l=(0,se.useContext)(Tt),u=(0,se.useContext)(Kn),c=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:o,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:f,isSVG:s}),d.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let h=m.current,g=(0,se.useContext)(Zn);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&Jf(m.current,r,i,g);let x=(0,se.useRef)(!1);(0,se.useInsertionEffect)(()=>{h&&x.current&&h.update(r,l)});let y=r[pr],b=(0,se.useRef)(!!y&&typeof window!="undefined"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,y))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,y)));return ns(()=>{d.current=!0,h&&(x.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),b.current&&h.animationState&&h.animationState.animateChanges())}),(0,se.useEffect)(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,y)}),b.current=!1),h.enteringChildren=void 0)}),h}function Jf(e,t,r,n){let{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutAnchor:c,layoutCrossfade:f}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:kl(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&et(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,crossfade:f,layoutScroll:l,layoutRoot:u,layoutAnchor:c})}function kl(e){if(e)return e.options.allowProjection!==!1?e.projection:kl(e.parent)}function Qn(e,{forwardMotionProps:t=!1,type:r}={},n,i){var u,c;n&&ml(n);let s=r?r==="svg":Gt(e),o=s?El:Vl;function a(f,m){let d,h={...(0,Ut.useContext)(Kn),...f,layoutId:Qf(f)},{isStatic:g}=h,x=yl(f),y=o(f,g);if(!g&&typeof window!="undefined"){em(h,n);let b=tm(h);d=b.MeasureLayout,x.visualElement=Dl(e,y,h,i,b.ProjectionNode,s)}return(0,Jn.jsxs)(Qe.Provider,{value:x,children:[d&&x.visualElement?(0,Jn.jsx)(d,{visualElement:x.visualElement,...h}):null,Cl(e,f,Al(y,x.visualElement,m),y,g,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${(c=(u=e.displayName)!=null?u:e.name)!=null?c:""})`}`;let l=(0,Ut.forwardRef)(a);return l[Pl]=e,l}function Qf({layoutId:e}){let t=(0,Ut.useContext)(Hr).id;return t&&e!==void 0?t+"-"+e:e}function em(e,t){let r=(0,Ut.useContext)(_n).strict}function tm(e){let t=$n(),{drag:r,layout:n}=t;if(!r&&!n)return{};let i={...r,...n};return{MeasureLayout:r!=null&&r.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Rl(e,t){if(typeof Proxy=="undefined")return Qn;let r=new Map,n=(s,o)=>Qn(s,o,e,t),i=(s,o)=>n(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?n:(r.has(o)||r.set(o,Qn(o,void 0,e,t)),r.get(o))})}var Ll=require("react");var Il=(e,t)=>{var n;return((n=t.isSVG)!=null?n:Gt(e))?new Lr(t):new Mr(t,{allowProjection:e!==Ll.Fragment})};var ei=class extends Q{constructor(t){super(t),t.animationState||(t.animationState=xo(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();Ne(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 rm=0,ti=class extends Q{constructor(){super(...arguments),this.id=rm++,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:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){let l=me(this.node,o,a);if(l){let{transition:u,transitionEnd:c,...f}=l;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 i=this.node.animationState.setActive("exit",!t);r&&!t&&i.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 Ol={animation:{Feature:ei},exit:{Feature:ti}};function je(e){return{point:{x:e.pageX,y:e.pageY}}}var Bl=e=>t=>mt(t)&&e(t,je(t));function tt(e,t,r,n){return Ae(e,t,Bl(r),n)}var ri=({current:e})=>e?e.ownerDocument.defaultView:null;var Nl=(e,t)=>Math.abs(e-t);function Fl(e,t){let r=Nl(e.x,t.x),n=Nl(e.y,t.y);return Math.sqrt(r**2+n**2)}var jl=new Set(["auto","scroll"]),Ht=class{constructor(t,r,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ni(this.lastRawMoveEventInfo,this.transformPagePoint));let h=Lo(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=Fl(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;let{point:y}=h,{timestamp:b}=H;this.history.push({...y,timestamp:b});let{onStart:w,onMove:v}=this.handlers;g||(w&&w(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,g)=>{this.lastMoveEvent=h,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=ni(g,this.transformPagePoint),E.update(this.updatePoint,!0)},this.handlePointerUp=(h,g)=>{this.end();let{onEnd:x,onSessionEnd:y,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let w=Lo(h.type==="pointercancel"?this.lastMoveEventInfo:ni(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(h,w),y&&y(h,w)},!mt(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;let l=je(t),u=ni(l,this.transformPagePoint),{point:c}=u,{timestamp:f}=H;this.history=[{...c,timestamp:f}];let{onSessionStart:m}=r;m&&m(t,Lo(u,this.history));let d={passive:!0,capture:!0};this.removeListeners=be(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);(jl.has(n.overflowX)||jl.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,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-r.x,y:i.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,i),E.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ue(this.updatePoint)}};function ni(e,t){return t?{point:t(e.point)}:e}function zl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Lo({point:e},t){return{point:e,delta:zl(e,Gl(t)),offset:zl(e,nm(t)),velocity:im(t,.1)}}function nm(e){return e[0]}function Gl(e){return e[e.length-1]}function im(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,i=Gl(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>K(t)));)r--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>K(t)*2&&(n=e[1]);let s=te(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};let o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function _l(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?M(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?M(r,e,n.max):Math.min(e,r)),e}function Wl(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 $l(e,{top:t,left:r,bottom:n,right:i}){return{x:Wl(e.x,r,i),y:Wl(e.y,t,n)}}function Ul(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 Yl(e,t){return{x:Ul(e.x,t.x),y:Ul(e.y,t.y)}}function Xl(e,t){let r=.5,n=$(e),i=$(t);return i>n?r=Se(t.min,t.max-n,e.min):n>i&&(r=Se(e.min,e.max-i,t.min)),Z(0,1,r)}function ql(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 ii=.35;function Zl(e=ii){return e===!1?e=0:e===!0&&(e=ii),{x:Hl(e,"left","right"),y:Hl(e,"top","bottom")}}function Hl(e,t,r){return{min:Kl(e,t),max:Kl(e,r)}}function Kl(e,t){return typeof e=="number"?e:e[t]||0}var om=new WeakMap,si=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:i}=this.visualElement;if(i&&i.isPresent===!1)return;let s=f=>{r&&this.snapToCursor(je(f).point),this.stopAnimation()},o=(f,m)=>{let{drag:d,dragPropagation:h,onDragStart:g}=this.getProps();if(d&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Zi(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),de(y=>{let b=this.getAxisMotionValue(y).get()||0;if(ie.test(b)){let{projection:w}=this.visualElement;if(w&&w.layout){let v=w.layout.layoutBox[y];v&&(b=$(v)*(parseFloat(b)/100))}}this.originPoint[y]=b}),g&&E.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:y}=m;if(h&&this.currentDirection===null){this.currentDirection=am(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,y),this.updateAxis("y",m.point,y),this.visualElement.render(),x&&E.update(()=>x(f,m),!1,!0)},l=(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:c}=this.getProps();this.panSession=new Ht(t,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:n,contextWindow:ri(this.visualElement),element:this.visualElement.current})}stop(t,r){let n=t||this.latestPointerEvent,i=r||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;let{velocity:o}=i;this.startAnimation(o);let{onDragEnd:a}=this.getProps();a&&E.postRender(()=>a(n,i))}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:i}=this.getProps();if(!n||!oi(t,i,this.currentDirection))return;let s=this.getAxisMotionValue(t),o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=_l(o,this.constraints[t],this.elastic[t])),s.set(o)}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,i=this.constraints;t&&et(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=$l(n.layoutBox,t):this.constraints=!1,this.elastic=Zl(r),i!==this.constraints&&!et(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&de(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=ql(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!et(t))return!1;let n=t.current;ce(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:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());let s=po(n,i.root,this.visualElement.getTransformPagePoint()),o=Yl(i.layout.layoutBox,s);if(r){let a=r(ao(o));this.hasMutatedConstraints=!!a,a&&(o=Cr(a))}return o}startAnimation(t){let{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=de(c=>{if(!oi(c,r,this.currentDirection))return;let f=l&&l[c]||{};(o===!0||o===c)&&(f={min:0,max:0});let m=i?200:1e6,d=i?40:1e7,h={type:"inertia",velocity:n?t[c]:0,bounceStiffness:m,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(c,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(){de(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var s;let r=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[r];return i||this.visualElement.getValue(t,(s=this.visualElement.latestValues[t])!=null?s:0)}snapToCursor(t){de(r=>{let{drag:n}=this.getProps();if(!oi(r,n,this.currentDirection))return;let{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){let{min:o,max:a}=i.layout.layoutBox[r],l=s.get()||0;s.set(t[r]-M(o,a,.5)+l)}})}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 i={x:0,y:0};de(o=>{let a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){let l=a.get();i[o]=Xl({min:l,max:l},this.constraints[o])}});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(),de(o=>{if(!oi(o,t,null))return;let a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(M(l,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;om.set(this.visualElement,this);let t=this.visualElement.current,r=tt(t,"pointerdown",u=>{let{drag:c,dragListener:f=!0}=this.getProps(),m=u.target,d=m!==t&&to(m);c&&f&&!d&&this.start(u)}),n,i=()=>{let{dragConstraints:u}=this.getProps();et(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),n||(n=sm(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),E.read(i);let a=Ae(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(de(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(),o(),l&&l(),n&&n()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ii,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}};function Jl(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function sm(e,t,r){let n=Rn(e,Jl(r)),i=Rn(t,Jl(r));return()=>{n(),i()}}function oi(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function am(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var ai=class extends Q{constructor(t){super(t),this.removeGroupControls=z,this.removeListeners=z,this.controls=new si(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 Io=e=>(t,r)=>{e&&E.update(()=>e(t,r),!1,!0)},li=class extends Q{constructor(){super(...arguments),this.removePointerDownListener=z}onPointerDown(t){this.session=new Ht(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ri(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Io(t),onStart:Io(r),onMove:Io(n),onEnd:(s,o)=>{delete this.session,i&&E.postRender(()=>i(s,o))}}}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 Ql=require("react/jsx-runtime");var Br=require("react");var Oo=!1,Bo=class extends Br.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),Oo&&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:i,isPresent:s}=this.props,{projection:o}=n;return o&&(o.isPresent=s,t.layoutDependency!==r&&o.setOptions({...o.options,layoutDependency:r}),Oo=!0,i||t.layoutDependency!==r||r===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||E.postRender(()=>{let a=o.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:i}=t;Oo=!0,i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function ci(e){let[t,r]=ll(),n=(0,Br.useContext)(Hr);return(0,Ql.jsx)(Bo,{...e,layoutGroup:n,switchLayoutGroup:(0,Br.useContext)(Zn),isPresent:t,safeToRemove:r})}var ec={pan:{Feature:li},drag:{Feature:ai,ProjectionNode:Ir,MeasureLayout:ci}};function tc(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");let i="onHover"+r,s=n[i];s&&E.postRender(()=>s(t,je(t)))}var ui=class extends Q{mount(){let{current:t}=this.node;t&&(this.unmount=Ji(t,(r,n)=>(tc(this.node,n,"Start"),i=>tc(this.node,i,"End"))))}unmount(){}};var fi=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=be(Ae(this.node.current,"focus",()=>this.onFocus()),Ae(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function rc(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 i="onTap"+(r==="End"?"":r),s=n[i];s&&E.postRender(()=>s(t,je(t)))}var mi=class extends Q{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:r,propagate:n}=this.node.props;this.unmount=no(t,(i,s)=>(rc(this.node,s,"Start"),(o,{success:a})=>rc(this.node,o,a?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}};var Fo=new WeakMap,No=new WeakMap,lm=e=>{let t=Fo.get(e.target);t&&t(e)},cm=e=>{e.forEach(lm)};function um({root:e,...t}){let r=e||document;No.has(r)||No.set(r,{});let n=No.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(cm,{root:e,...t})),n[i]}function nc(e,t,r){let n=um(t);return Fo.set(e,r),n.observe(e),()=>{Fo.delete(e),n.unobserve(e)}}var fm={some:0,all:1},di=class extends Q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);let{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=t,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:fm[i]},a=u=>{let{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);let{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),d=c?f:m;d&&d(u)};this.stopObserver=nc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver=="undefined")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(mm(t,r))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}};function mm({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var ic={inView:{Feature:di},tap:{Feature:mi},focus:{Feature:fi},hover:{Feature:ui}};var oc={layout:{ProjectionNode:Ir,MeasureLayout:ci}};var sc={...Ol,...ic,...ec,...oc};var jo=Rl(sc,Il);var zo=jo;var p=require("react"),dc=require("react-dom"),Ko=new Set,_o={open:!1,status:null,busy:!1,ballPos:null,guideVisible:!1,guideDismissed:!1,sidebarActive:!1};function B(e){_o=Object.assign({},_o,e),Ko.forEach(function(t){t()})}function pm(e){return Ko.add(e),function(){Ko.delete(e)}}function $o(){return _o}function Fr(){return p.useSyncExternalStore(pm,$o)}var ac="dshcs-setup-error-banner";function hm(e){try{if(typeof document=="undefined"||document.getElementById(ac)!=null)return;var t=document.createElement("div");t.id=ac,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">'+lc(e.error!=null?e.error:"\u5B89\u88C5\u811A\u672C\u9519\u8BEF")+"</span>"+(e.at!=null?'<br><span style="color:#b07a7a;font-size:11px">'+lc(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",_("/code-server/setup",{}).then(function(o){o!=null&&o.ok===!0?(n.textContent="\u5DF2\u5728\u540E\u53F0\u5B89\u88C5\u2026",setTimeout(function(){_("/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(){_("/code-server/status").then(function(o){if(!(o==null||o.setup==null)){if(o.setup.running===!0){setTimeout(s,2e3);return}o.setup.ok===!0?(t.remove(),B({status:o})):(n.disabled=!1,n.textContent="\u91CD\u65B0\u5B89\u88C5")}})};setTimeout(s,3e3)};var i=document.createElement("button");i.type="button",i.setAttribute("aria-label","\u5173\u95ED"),i.style.cssText="flex:none;font:inherit;cursor:pointer;border:none;background:none;color:#8a3c3c;font-size:16px;line-height:1;padding:2px 6px",i.textContent="\xD7",i.onclick=function(){t.remove()},t.appendChild(r),t.appendChild(n),t.appendChild(i),document.body.appendChild(t)}catch(s){console.error("[code-server] banner failed:",s!=null&&s.message!=null?s.message:String(s))}}function lc(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}async function _(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),i=await n.text(),s=null;try{s=i===""?null:JSON.parse(i)}catch(o){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 xi(e,t){try{var r=e(function(f){return f}),n=t===null?null:typeof t=="function"?t(function(f){return f}):null,i=r!=null?r.current:void 0;if(i!==void 0&&r!=null&&r.byId!=null){var s=r.byId[i];if(s!=null&&typeof s.cwd=="string"&&s.cwd!=="")return s.cwd}var o=n!=null&&Array.isArray(n.items)?n.items:[];if(i!==void 0)for(var a=0;a<o.length;a++){var l=o[a];if(l.sessionIds!=null&&l.sessionIds.indexOf(i)!==-1&&typeof l.path=="string"&&l.path!=="")return l.path}var u=n!=null?n.recentWorkspaceId:void 0;if(u!==void 0){for(var c=0;c<o.length;c++)if(o[c].workspaceId===u&&typeof o[c].path=="string"&&o[c].path!=="")return o[c].path}if(o.length>0&&typeof o[0].path=="string"&&o[0].path!=="")return o[0].path}catch(f){}}function pc(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,"/"),i=n;return(/^[A-Za-z]:\//.test(n)||n.charCodeAt(0)!==47)&&(i="/"+n),e.url+"?folder="+encodeURIComponent(i)}function hc(e,t,r){var n=e!=null&&e.ok===!0&&e.running===!0,i=e!=null&&e.status==="starting",s=e!=null&&e.ok===!1,o=function(l){return p.createElement("iframe",{key:r,className:"dshcs-frame",src:l,title:"code-server",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write",allow:"clipboard-read; clipboard-write"})};if(n&&t!==null)return o(t);if(i)return p.createElement(p.Fragment,null,o("about:blank"),p.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026"));var a=s&&e!=null&&e.error?e.error:"code-server \u672A\u8FD0\u884C";return 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"},a),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 "+(e!=null?e.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E\u3002")))}function gc(e){var t=function(n){var i=pc(n,e);i!=null&&typeof window.open=="function"&&window.open(i,"_blank","noopener")},r=$o().status;if(r!=null&&r.running===!0){t(r);return}$o().busy!==!0&&(B({busy:!0}),_("/code-server/start",typeof e=="string"?{cwd:e}:{}).then(function(n){B({status:n,busy:!1}),t(n)}).catch(function(){B({busy:!1})}))}var gm=["nw","n","ne","w","e","sw","s","se"],re=12,xm=720,ym=520,xc=360,yc=260,cc=24;function Yo(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,i=0;i<t.length;i++){var s=t[i].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 o=window.innerHeight;return o-n>24?0:Math.min(Math.max(1,o-r+8),420)}catch(a){return 0}}function Me(){return{width:Math.max(1,window.innerWidth),height:Math.max(1,window.innerHeight)}}function yi(e,t){return{width:Math.max(1,e.width-re*2),height:Math.max(1,e.height-re*2-t)}}function rt(e,t,r){return Math.min(r,Math.max(t,e))}function Kt(e,t,r){let n=yi(t,r),i=rt(e.width,Math.min(xc,n.width),n.width),s=rt(e.height,Math.min(yc,n.height),n.height);return{x:rt(e.x,re,Math.max(re,t.width-re-i)),y:rt(e.y,re,Math.max(re,t.height-re-r-s)),width:i,height:s}}function vm(e,t,r){let n=yi(t,r),i=Math.min(xm,n.width),s=Math.min(ym,n.height),o=bm(),a=o>0?o-8:t.height-re-r;return Kt({x:t.width-re-i-e*cc,y:Math.max(re,a-s-e*cc),width:i,height:s},t,r)}function bm(){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(i){return-1}}function wm(e,t,r,n,i){return Kt({...e,x:e.x+t,y:e.y+r},n,i)}function Tm(e,t,r,n,i,s){let o=Kt(e,i,s),a=yi(i,s),l=Math.min(xc,a.width),u=Math.min(yc,a.height),c=i.height-re-s,f=o.x,m=o.x+o.width,d=o.y,h=o.y+o.height;return t.includes("w")&&(f=rt(o.x+r,re,m-l)),t.includes("e")&&(m=rt(m+r,f+l,i.width-re)),t.includes("n")&&(d=rt(o.y+n,re,h-u)),t.includes("s")&&(h=rt(h+n,d+u,c)),{x:f,y:d,width:m-f,height:h-d}}function pi(e,t){let r=yi(e,t);return{x:re,y:re,width:r.width,height:r.height}}var Sm='.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}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}@keyframes dshcs-pulse{0%{transform:scale(.7);opacity:.35}70%,100%{transform:scale(1.65);opacity:0}}',uc="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(uc)+"]")===null&&(hi=document.createElement("style"),hi.setAttribute("data-dshcs",uc),hi.textContent=Sm,document.head.appendChild(hi));var hi;function Cm(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,vc="dshcs-ball-pos";function gi(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(vc);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 gi(t)}catch(r){}return null}function Em(e){try{window.localStorage.setItem(vc,JSON.stringify(e))}catch(t){}}function Pm(e){var t=Fr(),r=t.status,n=r!=null?r.env:null,i=r!=null&&r.running===!0,s=i?"running":r!=null&&r.status==="starting"?"starting":r!=null&&r.status==="error"?"error":"idle",o=Yo(r!=null?r.reserveComposer:!0),a=t.open===!0,l="/code-server/icon.svg",[u,c]=p.useState(Vm),[f,m]=p.useState(!1),d=p.useRef(null),h=p.useRef(!1);if(p.useEffect(function(){var v=function(){c(function(T){return T==null?T:gi(T)})};return window.addEventListener("resize",v),function(){window.removeEventListener("resize",v)}},[]),p.useEffect(function(){var v=u!=null?u:(function(){var T=Yo(r!=null?r.reserveComposer:!0);return{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(T>0?T+10:18)}})();B({ballPos:gi(v)})},[u,r]),n!=null&&n.ok!==!0||t.sidebarActive===!0)return null;var g=function(v){if(v.button===0){var T=v.currentTarget,P=T.getBoundingClientRect();d.current={pointerId:v.pointerId,dx:v.clientX-P.left,dy:v.clientY-P.top,moved:!1},h.current=!1,m(!0);try{T.setPointerCapture(v.pointerId)}catch(A){}}},x=function(v){var T=d.current;if(!(T==null||v.pointerId!==T.pointerId)){var P=v.clientX-T.dx,A=v.clientY-T.dy;(Math.abs(P-(u!=null?u.x:0))>2||Math.abs(A-(u!=null?u.y:0))>2)&&(T.moved=!0),c(gi({x:P,y:A}))}},y=function(){var v=d.current;d.current=null,m(!1),v!=null&&v.moved===!0&&(h.current=!0),v!=null&&v.moved===!0&&c(function(T){return T!=null&&Em(T),T})},b=function(){if(h.current===!0){h.current=!1;return}if(r!=null&&r.windowedOpen===!0){gc(xi(e&&e.useSessions,e&&e.useWorkspaces));return}B({open:!a})},w=u!=null?{left:u.x,top:u.y}:{right:14,bottom:o>0?o+10:18};return dc.createPortal(p.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:g,onPointerMove:x,onPointerUp:y,onPointerCancel:y,onDragStart:function(v){v&&v.preventDefault&&v.preventDefault()},onClick:b},p.createElement(Cm,{url:l}),p.createElement("span",{className:"dshcs-ball-dot","data-status":s,"aria-hidden":!0})),document.body)}function Am(e){var t=Fr(),r=t.status,n=r!=null&&r.ok===!0&&r.running===!0,i=r!=null&&r.status==="starting",s=r!=null&&r.ok===!1,o=xi(e&&e.useSessions,e&&e.useWorkspaces),a=p.useRef(void 0),[l,u]=p.useState(0),c=Yo(r!=null?r.reserveComposer:!0),[f,m]=p.useState(!1),[d,h]=p.useState(null),[g,x]=p.useState(function(){return vm(0,Me(),c)}),y=p.useRef(g),b=p.useRef(function(){});y.current=g,p.useEffect(function(){var D=function(){x(function(ne){return f?pi(Me(),c):Kt(ne,Me(),c)})};return window.addEventListener("resize",D),function(){window.removeEventListener("resize",D)}},[f,c]),p.useEffect(function(){x(function(D){return Kt(D,Me(),c)})},[c]),p.useEffect(function(){return function(){b.current()}},[]);var w=12,v=4,[T,P]=p.useState(!1),A=p.useRef(null),C=function(D,ne){if(D.button===0){D.preventDefault(),D.stopPropagation(),b.current();var le=D.currentTarget.ownerDocument.defaultView;if(le!==null){var pe=D.pointerId,zr=D.currentTarget,Xo=f,$t=Xo?pi(Me(),c):y.current,Cc=$t.width>0?(D.clientX-$t.x)/$t.width:0,Vc=Math.min(14,Math.max(0,D.clientY-$t.y)),j={pointerId:pe,origin:{x:D.clientX,y:D.clientY},start:$t,ratio:Cc,grabY:Vc,wasMaximized:Xo,restored:!1,snapped:!1,moved:!1};A.current=j,h(ne);try{zr.setPointerCapture(pe)}catch(fe){}var qo=function(fe){if(fe.pointerId===pe){if(ne!=="move"){x(Tm(j.start,ne,fe.clientX-j.origin.x,fe.clientY-j.origin.y,Me(),c));return}var Jo=fe.clientX-j.origin.x,Wr=fe.clientY-j.origin.y;if(Math.abs(Jo)+Math.abs(Wr)>3&&(j.moved=!0),j.wasMaximized&&!j.restored){if(Wr<v)return;var bi=y.current,Ur={x:fe.clientX-bi.width*Math.min(.9,Math.max(.1,j.ratio)),y:fe.clientY-j.grabY,width:bi.width,height:bi.height};Ur=Kt(Ur,Me(),c),j.restored=!0,j.start=Ur,j.origin={x:fe.clientX,y:fe.clientY},m(!1),x(Ur);return}var Ec=j.start.y+Wr,Pc=wm(j.start,Jo,Wr,Me(),c);x(Pc);var wi=Ec<=w;wi!==j.snapped&&(j.snapped=wi,P(wi))}},Zo=function(){le.removeEventListener("pointermove",qo),le.removeEventListener("pointerup",Gr),le.removeEventListener("pointercancel",Gr),b.current=function(){},A.current=null;try{zr.releasePointerCapture(pe)}catch(fe){}},Gr=function(fe){fe.pointerId===pe&&(Zo(),h(null),(!j.wasMaximized||j.restored===!0)&&(j.snapped===!0&&j.moved===!0&&m(!0),j.snapped===!0&&P(!1)))};b.current=Zo,le.addEventListener("pointermove",qo),le.addEventListener("pointerup",Gr),le.addEventListener("pointercancel",Gr)}}},U=function(){m(function(D){return!D})},V=function(D){D.target.closest("[data-window-control]")===null&&C(D,"move")},O=function(D){D.target.closest("[data-window-control]")===null&&U()};if(p.useEffect(function(){if(!t.open||t.sidebarActive===!0)return;var D=!1;async function ne(){B({busy:!0});var le=await _("/code-server/status");if(!D){if(le!=null&&le.ok===!0&&le.running===!0){B({status:le,busy:!1});return}var pe=await _("/code-server/start",typeof o=="string"?{cwd:o}:{});D||B({status:pe,busy:!1})}}return ne(),function(){D=!0}},[t.open,t.sidebarActive]),p.useEffect(function(){if(t.sidebarActive===!0||typeof o!="string"||o===""||a.current===o)return;var D=a.current!==void 0&&a.current!==o;a.current=o;var ne=!1;async function le(){B({busy:!0});var pe=await _("/code-server/start",{cwd:o});ne||(B({status:pe,busy:!1}),D&&pe!=null&&pe.ok===!0&&pe.running===!0&&u(function(zr){return zr+1}))}return le(),function(){ne=!0}},[o,t.sidebarActive]),p.useEffect(function(){t.open||(a.current=void 0)},[t.open]),p.useEffect(function(){if(t.sidebarActive!==!0){var D=window.setInterval(function(){_("/code-server/status").then(function(ne){B({status:ne})})},3e3);return function(){window.clearInterval(D)}}},[t.sidebarActive]),p.useEffect(function(){if(!t.open)return;function D(ne){ne.key==="Escape"&&B({open:!1})}return window.addEventListener("keydown",D),function(){window.removeEventListener("keydown",D)}},[t.open]),t.sidebarActive===!0)return null;var Y=r!=null&&typeof r.url=="string"?r.url:null,X=n&&r!=null&&typeof r.cwd=="string"&&r.cwd!==""?r.cwd:null,ee=null;if(X!==null){var q=X.replace(/\\/g,"/");ee=q,(/^[A-Za-z]:\//.test(q)||q.charCodeAt(0)!==47)&&(ee="/"+q)}var ae=Y!==null?Y+(ee!==null?"?folder="+encodeURIComponent(ee):""):null,L=hc(r,ae,l),k=["dshcs-win",f?"dshcs-win-max":"",T?"dshcs-win-snap":"",t.open===!1?"dshcs-win-hidden":""].filter(Boolean).join(" "),R=f?pi(Me(),c):g,Te=t.ballPos!=null?t.ballPos:{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(c>0?c+10:18)},ke={x:Te.x+ze/2,y:Te.y+ze/2},vi=Math.max(.05,ze/Math.max(R.width,R.height)),bc=t.open===!1?{x:ke.x-R.width/2,y:ke.y-R.height/2,width:R.width,height:R.height,scale:vi,borderRadius:19,opacity:0}:{x:R.x,y:R.y,width:R.width,height:R.height,scale:1,borderRadius:12,opacity:1},wc=d!==null?{duration:0}:{type:"spring",stiffness:340,damping:38,mass:.9,opacity:{type:"spring",stiffness:420,damping:40,mass:.8},borderRadius:{duration:.2}},Tc=p.createElement(zo.section,{className:k,style:t.open===!1?{left:0,top:0,pointerEvents:"none"}:{left:0,top:0},animate:bc,initial:!1,transition:wc,"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:V,onDoubleClick:O}),p.createElement("div",{className:"dshcs-body"},L),f?null:gm.map(function(D){return p.createElement("span",{key:D,className:"dshcs-resize dshcs-resize-"+D,"data-direction":D,onPointerDown:function(ne){C(ne,D)}})})),jr=pi(Me(),c),Sc=p.createElement(zo.div,{className:"dshcs-snapghost",initial:!1,animate:{opacity:T===!0?1:0,x:jr.x,y:jr.y,width:jr.width,height:jr.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 dc.createPortal(p.createElement(p.Fragment,null,Tc,Sc),document.body)}var Go="code-server",fc="dsh-code-server-app",_t={openTab:null};function Mm(e){var t=e!=null&&typeof e.size=="number"?e.size:16;return p.createElement("img",{src:"/code-server/icon.svg",alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:t,height:t,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Dm(e){var t=e.useTabInfo(),r=t.tab,n=Fr(),i=n.status,s=xi(e.useSessions,null),o=p.useRef(void 0),[a,l]=p.useState(0),u=r.navigation,c=u!=null&&typeof u.revision=="number"?u.revision:0;return p.useEffect(function(){if(!(typeof s!="string"||s==="")&&o.current!==s){var f=o.current!==void 0;o.current=s;var m=!1;return _("/code-server/start",{cwd:s}).then(function(d){m||(B({status:d}),f&&d!=null&&d.ok===!0&&d.running===!0&&l(function(h){return h+1}))}).catch(function(){}),function(){m=!0}}},[s]),p.useEffect(function(){_("/code-server/status").then(function(m){m!=null&&B({status:m})}).catch(function(){});var f=window.setInterval(function(){_("/code-server/status").then(function(m){B({status:m})}).catch(function(){})},3e3);return function(){window.clearInterval(f)}},[]),p.useEffect(function(){var f=u!=null?u.params:null,m=f!=null&&typeof f.path=="string"?f.path:"";m!==""&&_("/code-server/open-file",{file:m}).catch(function(){})},[c]),p.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body"},hc(i,pc(i,s),a))}function km(e){var t=e.sidebarRightTabs,r=e.sidebarRight;t==null||r==null||(e.effect(function(){return t.register({id:fc,kind:Go,priority:"extension",title:function(){return"Code Server"},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A\u3002"},icon:Mm}]})},"code-server: sidebar tab type"),e.effect(function(){return e.slots.inject("sidebar.right.pane.tab",function(){return e.slots.register({name:"sidebar.right.pane.tab",key:fc},Dm)})},"code-server: sidebar tab body"),_t.openTab=function(n){try{return r.openTab(Go,n!=null?{params:n}:void 0),!0}catch(i){return console.warn("[code-server] sidebar openTab failed:",i!=null&&i.message!=null?i.message:String(i)),!1}},e.effect(function(){return function(){_t.openTab=null,B({sidebarActive:!1})}},"code-server: sidebar mode reset"),B({sidebarActive:!0,open:!1}),console.log("[code-server] right-sidebar tab registered (kind="+Go+")"))}var Rm=".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}",Lm="dsh-code-server/Card.module.css";function Im(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)}}Im(Lm,Rm);function Om(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 Nr(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 Wo(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 Uo(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 Bm(e){var[t,r]=p.useState(!1),n=e.state;if(n==null||n.available!==!0)return null;var i=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"},i),p.createElement("span",{className:"dshcs-cardDescription"},e.description)),n.dirty===!0?p.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,p.createElement(Om,{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(Nr,{disabled:n.dirty!==!0||n.saving===!0,onClick:e.onDiscard},e.discardLabel),p.createElement(Nr,{variant:"primary",disabled:s,onClick:e.onSave},n.saving===!0?e.savingLabel:e.saveLabel))):null)}var Ho="dshcs-guide-modal";function mc(e){try{let u=function(){var c=document.getElementById(Ho);c!=null&&c.remove()};if(typeof document=="undefined"||document.getElementById(Ho)!=null)return;var t=document.createElement("div");t.id=Ho,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label","\u5B89\u88C5 Code Server \u73AF\u5883"),t.style.cssText="position:fixed;inset:0;z-index:2147483998;display:grid;place-items:center;background:rgba(13,22,38,.35)";var r=document.createElement("div");r.style.cssText="width:min(520px,92vw);background:var(--dsw-alias-bg-base,#fff);border-radius:14px;padding:20px 22px;box-shadow: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)";var n=document.createElement("div");n.style.cssText="display:flex;align-items:center;gap:10px;margin-bottom:10px",n.innerHTML='<img src="/code-server/icon.svg" alt="" style="width:26px;height:26px;object-fit:contain"><strong style="font-size:15px">\u5B89\u88C5 Code Server \u73AF\u5883</strong>';var i=document.createElement("button");i.type="button",i.setAttribute("aria-label","\u5173\u95ED"),i.textContent="\xD7",i.style.cssText="margin-left:auto;border:none;background:none;cursor:pointer;font-size:16px;color:var(--dsw-alias-label-tertiary,#7d8798);padding:2px 6px",i.onclick=function(){u()},n.appendChild(i);var s=document.createElement("div");s.style.cssText="color:var(--dsw-alias-label-secondary,#566174);margin-bottom:12px",s.textContent="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";var o=document.createElement("div");o.style.cssText="display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap";var a=document.createElement("button");a.type="button",a.textContent="\u4E0D\u518D\u63D0\u793A(\u6C38\u4E45\u5173\u95ED)",a.style.cssText="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",a.onclick=function(){try{e!=null&&typeof e.set=="function"&&e.set("installGuideDismissed",!0)}catch(c){}B({guideDismissed:!0}),u()};var l=document.createElement("button");l.type="button",l.textContent="\u5F00\u59CB\u5B89\u88C5",l.style.cssText="appearance:none;font:inherit;font-size:13px;cursor:pointer;border:1px solid #5b6cff;background:#5b6cff;color:#fff;border-radius:7px;padding:7px 16px",l.onclick=function(){l.disabled=!0,l.textContent="\u5B89\u88C5\u4E2D\u2026",_("/code-server/setup",{}).then(function(c){if(c==null||c.ok!==!0){l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5",window.alert(c!=null&&c.error?c.error:"\u542F\u52A8\u5B89\u88C5\u5931\u8D25");return}var f=function(){_("/code-server/status").then(function(m){if(m==null||m.setup==null){l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5";return}if(m.setup.running===!0){setTimeout(f,2e3);return}l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5",B({status:m}),m.setup.ok===!0&&u()}).catch(function(){l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5"})};setTimeout(f,3e3)}).catch(function(){l.disabled=!1,l.textContent="\u5F00\u59CB\u5B89\u88C5"})},o.appendChild(a),o.appendChild(l),r.appendChild(n),r.appendChild(s),r.appendChild(o),t.appendChild(r),document.body.appendChild(t)}catch(u){console.error("[code-server] guide modal failed:",u!=null&&u.message!=null?u.message:String(u))}}function Nm(e){try{let X=function(){_("/code-server/status").then(function(L){L!=null&&typeof L=="object"&&B({status:L})}).catch(function(){})};var t=e.scope,[r,n]=p.useState(function(){return t!==void 0?t.getSnapshot():null}),[i,s]=p.useState(null),[o,a]=p.useState(!1),[l,u]=p.useState(!1),c=Fr();if(p.useEffect(function(){if(t===void 0||typeof t.subscribe!="function")return;function L(){try{n(t.getSnapshot())}catch(R){}}var k=t.subscribe(L);return function(){typeof k=="function"&&k()}},[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 f=r.value!==void 0&&r.value!==null?r.value:{},m=r.user,d={reserveComposer:f.reserveComposer!==!1,windowedOpen:f.windowedOpen===!0,installGuideDismissed:f.installGuideDismissed===!0},h=m!=null&&Object.prototype.hasOwnProperty.call(m,"reserveComposer"),g=m!=null&&Object.prototype.hasOwnProperty.call(m,"windowedOpen"),x=m!=null&&Object.prototype.hasOwnProperty.call(m,"installGuideDismissed"),y=c!=null&&c.sidebarActive===!0,b=i!==null&&(i.reserveComposer!==d.reserveComposer||i.windowedOpen!==d.windowedOpen||i.installGuideDismissed!==d.installGuideDismissed),w=!b||o,v={available:!0,writable:r.writable,dirty:b,invalid:!1,saving:o,failed:l,reserveComposer:{text:i!==null?i.reserveComposer:d.reserveComposer,overridden:h}};async function ee(){if(b&&!o){a(!0),u(!1);try{var L=i!==null?i:d;await e.scope.set("reserveComposer",L.reserveComposer===!0),await e.scope.set("windowedOpen",L.windowedOpen===!0),await e.scope.set("installGuideDismissed",L.installGuideDismissed===!0),s(null),X()}catch(k){u(!0)}a(!1)}}async function q(){if(!(o||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",f.reserveComposer===void 0||f.reserveComposer===null?!0:f.reserveComposer),await e.scope.set("windowedOpen",f.windowedOpen===!0),await e.scope.set("installGuideDismissed",!1)),s(null),X()}catch(L){u(!0)}a(!1)}}var[T,P]=p.useState(null),[A,C]=p.useState(!1),[U,V]=p.useState(null),O=p.useRef(!0);p.useEffect(function(){return O.current=!0,function(){O.current=!1}},[]);async function ae(){if(A)return;C(!0),V(null);var L=await _("/code-server/setup",{});if(L==null||L.ok!==!0){V(L!=null&&L.error?L.error:"\u542F\u52A8\u5B89\u88C5\u5931\u8D25"),C(!1);return}V("\u73AF\u5883\u5B89\u88C5\u5DF2\u5728\u540E\u53F0\u5F00\u59CB,\u5B8C\u6210\u540E\u81EA\u52A8\u5237\u65B0\u2026");function k(){O.current===!0&&_("/code-server/status").then(function(R){if(O.current===!0){if(R==null||R.setup==null){C(!1);return}if(R.setup.running===!0){setTimeout(k,2e3);return}C(!1),P(R.env!=null?R.env:{error:"status \u672A\u8FD4\u56DE env"}),V(R.setup.ok===!0?"\u73AF\u5883\u5B89\u88C5\u5B8C\u6210":`\u73AF\u5883\u5B89\u88C5\u5931\u8D25:
3
+ `+(R.setup.logTail!=null?R.setup.logTail.slice(-600):"(\u65E0\u65E5\u5FD7)"))}})}k()}var Y=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(Nr,{variant:"primary",disabled:A,onClick:async function(){C(!0),V(null);var L=await _("/code-server/status");P(L!=null&&L.env!=null?L.env:{error:"status \u672A\u8FD4\u56DE env"}),C(!1)}},"\u68C0\u6D4B\u73AF\u5883"),p.createElement(Nr,{disabled:A,onClick:function(){ae()}},A?"\u5B89\u88C5\u4E2D\u2026":"\u5B89\u88C5\u73AF\u5883"))),T!=null?p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},T.error!=null?p.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+T.error):p.createElement("span",null,"\u72B6\u6001: "+(T.ok===!0?"\u2705 \u5C31\u7EEA":"\u274C \u4E0D\u901A\u8FC7")+(T.entry!=null?" \xB7 \u5165\u53E3: "+T.entry:" \xB7 \u5165\u53E3\u7F3A\u5931")+" \xB7 native: "+(T.native===!0?"\u2705":"\u274C")+" \xB7 VS Code \u5185\u90E8\u4F9D\u8D56: "+(T.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'),U!=null?p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},U):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: "+(T!=null&&T.entry!=null?T.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(Bm,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1)/ \u60AC\u6D6E\u7403\u56DE\u9000;\u7A97\u53E3\u5316\u8BBE\u7F6E\u63A7\u5236\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:ee,onDiscard:function(){s(null),u(!1)}},p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u5165\u53E3"),p.createElement("span",{className:"dshcs-badges"},p.createElement(Nr,{disabled:y!==!0,onClick:function(){_t.openTab!==null&&_t.openTab(null)}},"\u5728\u53F3\u4FA7\u680F\u6253\u5F00"))),p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},y===!0?"\u5F53\u524D:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1)\u3002\u4ECE\u53F3\u4FA7\u680F\u300C\u5F00\u59CB\u300D\u9875\u7684 Code Server \u5165\u53E3\u6846\u3001\u4EA7\u7269\u65C1\u6309\u94AE\u6216\u4E0A\u9762\u7684\u6309\u94AE\u6253\u5F00\u3002":"\u5F53\u524D:\u60AC\u6D6E\u7403(\u672C\u90E8\u7F72\u65E0\u53F3\u4FA7\u680F\u670D\u52A1)\u3002\u70B9\u51FB\u53F3\u4E0B\u89D2\u60AC\u6D6E\u7403\u5C55\u5F00\u6D6E\u7A97\u3002")),y===!0?null: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"),h===!0?p.createElement(Uo,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){q()}}):null),p.createElement(Wo,{checked:i!==null?i.reserveComposer:d.reserveComposer,disabled:r.writable!==!0,onChange:function(L){s(function(k){return Object.assign({},k!==null?k:d,{reserveComposer:L===!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)"),g===!0?p.createElement(Uo,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){q()}}):null),p.createElement(Wo,{checked:i!==null?i.windowedOpen:d.windowedOpen,disabled:r.writable!==!0,onChange:function(L){s(function(k){return Object.assign({},k!==null?k:d,{windowedOpen:L===!0})}),u(!1)}},"\u5F00\u542F\u540E\u5165\u53E3(\u4EA7\u7269\u6309\u94AE/\u8BBE\u7F6E\u5361/\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\u53F3\u4FA7\u680F\u6807\u7B7E\u6216\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"),x===!0?p.createElement(Uo,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){q()}}):null),p.createElement(Wo,{checked:i!==null?i.installGuideDismissed:d.installGuideDismissed,disabled:r.writable!==!0,onChange:function(L){s(function(k){return Object.assign({},k!==null?k:d,{installGuideDismissed:L===!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")),Y)}catch(X){return console.error("[code-server] card render error:",X!=null&&X.message!==void 0?X.message:String(X)),null}}function Fm(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 i={},s=0;s<r.produced.length;s++){var o=r.produced[s];o==null||typeof o.path!="string"||o.path===""||o.seq!=null&&o.seq>n||i[o.path]!==!0&&(i[o.path]=!0,t.push(o.path))}}catch(a){}return t}function jm(e){var t=Fm(e);return t.length===0?null:t}function zm(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 Gm(e){var t=Fr();if(e==null||!Array.isArray(e.matched)||e.matched.length===0)return null;var r=e.matched;function n(s){var o=String(s).replace(/\\/g,"/"),a=o.lastIndexOf("/");return a>=0?o.slice(a+1):o}function i(s){var o=t.status;if(o!=null&&o.windowedOpen===!0){gc(xi(e.useSessions,e.useWorkspaces));return}t.sidebarActive===!0&&_t.openTab!==null&&_t.openTab({path:s})===!0||(B({open:!0}),_("/code-server/open-file",{file:s}).then(function(a){(a==null||a.ok!==!0)&&window.alert(a!=null&&a.error?a.error:"\u6253\u5F00\u5931\u8D25")}).catch(function(a){window.alert("\u6253\u5F00\u5931\u8D25: "+String(a))}))}return p.createElement("div",{className:"dshcs-artifacts"},p.createElement("span",{className:"dshcs-artlabel"},"\u4EA7\u7269"),p.createElement("div",{className:"dshcs-artrow"},r.slice(0,6).map(function(s){return p.createElement("span",{key:s,className:"dshcs-artitem"},p.createElement("button",{type:"button",className:"dshcs-artfile",title:s,"aria-label":"\u6253\u5F00: "+s,onClick:function(){i(s)}},n(s)),p.createElement("button",{type:"button",className:"dshcs-artbtn",title:"\u5728 Code Server \u6253\u5F00: "+s,"aria-label":"\u5728 Code Server \u6253\u5F00: "+s,onClick:function(){i(s)}},p.createElement(zm,null)))}),r.length>6?p.createElement("span",{className:"dshcs-artmore"},"\u2026"):null))}function Wm(e){try{Um(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 Um(e){var t=e.get("slots");if(t===void 0){console.error("[code-server] slots service unavailable");return}var r=e.settingsScope,n=null;if(r!==void 0&&typeof r.bind=="function")n=r.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}_("/code-server/status").then(function(o){B({status:o}),o!=null&&typeof o=="object"&&o.lastSetupError!=null&&hm(o.lastSetupError)}).catch(function(){}),t.inject("shell.overlay",()=>t.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},o=>p.createElement(p.Fragment,null,p.createElement(Pm,o),p.createElement(Am,o))));try{t.inject("conversation.chat.turnTail",function(){return t.register({name:"conversation.chat.turnTail",priority:-9,id:"dshcs-open-file",select:jm},Gm)}),console.log("[code-server] turnTail artifacts buttons registered")}catch(o){console.warn("[code-server] turnTail register failed:",o!=null&&o.message!=null?o.message:String(o))}t.inject("settings.plugin.item",()=>t.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:n}}},Nm));try{var i=!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)&&(i=!0)}catch(o){}B({guideDismissed:i===!0}),i!==!0&&_("/code-server/status").then(function(o){if(B({status:o}),o!=null&&o.installGuideDismissed===!0){B({guideDismissed:!0});return}mc(n)}).catch(function(){mc(n)})}catch(o){console.warn("[code-server] guide check failed:",o!=null&&o.message!=null?o.message:String(o))}try{typeof e.inject=="function"?e.inject(["sidebarRightTabs","sidebarRight"],function(o){try{km(o)}catch(a){console.warn("[code-server] sidebar tab registration failed; keep floating ball:",a!=null&&a.message!=null?a.message:String(a))}}):console.warn("[code-server] ctx.inject unavailable; keep floating ball")}catch(o){console.warn("[code-server] sidebar inject failed; keep floating ball:",o!=null&&o.message!=null?o.message:String(o))}console.log("[code-server] client bundle registered (floating ball + window + settings card; right-sidebar tab pending/active)")}var Hm=["slots","settingsScope"],Km="code-server";
5
5
  return module.exports;}});
6
6